belongsTo('app\common\model\user\User'); } /** * 业绩明细 * @param $data */ public static function add($data) { $model = new static; return $model->save($data); } public static function getPerformanceCount($user_id, $is_own = false) { $where = ['performance_id' => $user_id]; if ($is_own) { $where['is_own'] = 1; } return (new static())->where($where)->count(); } }