|
...
|
...
|
@@ -25,22 +25,9 @@ class TemplateController extends BaseController |
|
|
|
*/
|
|
|
|
public function index(){
|
|
|
|
|
|
|
|
$limit = $this->param['limit']??20;
|
|
|
|
$lists = (new ATemplate)->lists($this->map,$this->page,$this->row,$this->order,['id','name','status','is_default','sort','thumb','url','created_at','updated_at']);
|
|
|
|
$this->response('success',Code::SUCCESS,$lists);
|
|
|
|
|
|
|
|
|
|
|
|
$lists = ATemplate::where(function ($query){
|
|
|
|
|
|
|
|
!empty($this->param['status']) && $query->where('status',$this->param['status']);
|
|
|
|
!empty($this->param['name']) && $query->where('status',$this->param['name']);
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
->select(['id','name','status','is_default','sort','thumb','url','created_at','updated_at'])
|
|
|
|
->orderBy('sort')
|
|
|
|
->paginate($limit);
|
|
|
|
|
|
|
|
|
|
|
|
return $this->success($lists->toArray());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
...
|
...
|
@@ -142,11 +129,9 @@ class TemplateController extends BaseController |
|
|
|
*/
|
|
|
|
public function html_index($template_id){
|
|
|
|
|
|
|
|
$lists = (new ATemplate)->list($this->map,$this->order,['id','name','status','is_default','sort','thumb','url','created_at','updated_at']);
|
|
|
|
$this->response('success',Code::SUCCESS,$lists);
|
|
|
|
|
|
|
|
$lists = ATemplateHtml::where('template_id',$template_id)->get();
|
|
|
|
|
|
|
|
|
|
|
|
return $this->success($lists->toArray());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
...
|
...
|
|