1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- declare (strict_types = 1);
- namespace app\common\model\analysis;
- use app\common\model\BaseModel;
- /**
- * 每月访问留存模型
- * Class AnalysisMonthlyRetain
- * @package app\common\model\analysis
- */
- class AnalysisMonthlyRetain extends BaseModel
- {
- // 定义表名
- protected $name = 'analysis_monthly_retain';
- // 定义主键
- protected $pk = 'id';
- /**
- * 一对多关联 新增用户留存
- * @return \think\model\relation\HasMany
- */
- public function retainTagNew()
- {
- return $this->hasMany(AnalysisMonthlyRetainTag::class, 'retain_id')
- ->where('type', AnalysisMonthlyRetainTag::TYPE_NEW)
- ->order(['key' => 'asc']);
- }
- /**
- * 一对多关联 活跃用户留存
- * @return \think\model\relation\HasMany
- */
- public function retainTagActive()
- {
- return $this->hasMany(AnalysisMonthlyRetainTag::class, 'retain_id')
- ->where('type', AnalysisMonthlyRetainTag::TYPE_ACTIVE)
- ->order(['key' => 'asc']);
- }
- }
|