hasMany(AnalysisDailyRetainTag::class, 'retain_id') ->where('type', AnalysisDailyRetainTag::TYPE_NEW) ->order(['key' => 'asc']); } /** * 一对多关联 活跃用户留存 * @return \think\model\relation\HasMany */ public function retainTagActive() { return $this->hasMany(AnalysisDailyRetainTag::class, 'retain_id') ->where('type', AnalysisDailyRetainTag::TYPE_ACTIVE) ->order(['key' => 'asc']); } }