'微信', 20 => '支付宝']; return ['text' => $status[$value], 'value' => $value]; } /** * 关联模板市场表 */ public function template() { return $this->belongsTo('app\\common\\model\\Template','app_type','app_type'); } /** * 获取列表 */ public function getList() { // 执行查询 return $this->order('template_code_id','desc') ->paginate(['list_rows'=>15,'query' => request()->param()]); } /** * 获取详情 */ public static function detail($template_code_id) { $filter = [ 'template_code_id' => $template_code_id ]; return self::where($filter)->find(); } /** * 获取最新模板 */ public static function getNew(string $app_type,$mp = '10') { $filter = [ 'app_type' => $app_type, 'mp' => $mp ]; return self::where($filter) ->order('template_code_id','desc') ->find(); } /** * 获取指定版本模板详情 */ public static function getCode(string $app_type,$user_version,$mp = '10') { $filter = [ 'app_type' => $app_type, 'user_version' => $user_version, 'mp' => $mp ]; return self::where($filter) ->order('template_code_id','desc') ->find(); } }