belongsTo('app\\common\\model\\user\\User'); } /** * 预售结束时间 */ public function getImageListAttr($value, $data) { return (isset($data['image_list']) && $data['image_list']) ? json_decode($data['image_list'],true) : ''; } /** * 获取详情 */ public static function detail($id) { return (new static())->find($id); } /** * 获取列表记录 */ public static function getAll($prject_id) { return (new static())->with('user')->where('project_id', '=', $prject_id) ->order(['create_time' => 'asc']) ->select(); } /** * 获取好评条数 */ public static function getGoodsEvaluateNum($project_user_id) { return (new static())->where('project_user_id', '=', $project_user_id) ->where('score', '=', 10) ->count(); } }