You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.3 KiB

  1. <?php
  2. namespace common\models;
  3. /**
  4. * Created by PhpStorm.
  5. * User: iron
  6. * Date: 19-1-15
  7. * Time: 下午7:40
  8. *
  9. * @property int $admin_id 管理员id
  10. * @property string $admin_name 管理员名
  11. * @property string $ip 客户端ip
  12. * @property string $admin_agent 客户端版本
  13. * @property string $path 访问路径
  14. * @property string $method http方法
  15. * @property array $params 各类参数
  16. * @property int $created_at 创建时间
  17. */
  18. use yii\mongodb\ActiveRecord;
  19. class DailyActiveUser extends ActiveRecord
  20. {
  21. /**
  22. * @return string the name of the index associated with this ActiveRecord class.
  23. */
  24. public static function collectionName()
  25. {
  26. return 'daily_active_user';
  27. }
  28. /**
  29. * @return array list of attribute names.
  30. */
  31. public function attributes()
  32. {
  33. return ['_id', 'date', 'created_at', 'user_ids', 'count'];
  34. }
  35. public function rules()
  36. {
  37. return [
  38. ['count','default','value'=>1],
  39. ['created_at','default','value'=>time()]
  40. ];
  41. }
  42. public function attributeLabels()
  43. {
  44. return [
  45. 'date' => '日期',
  46. 'created_at' => '创建时间',
  47. 'user_ids' => '用户id',
  48. 'count' => '数量'
  49. ];
  50. }
  51. }