|
@@ -49,8 +49,8 @@ class ProductController extends BaseController |
|
@@ -49,8 +49,8 @@ class ProductController extends BaseController |
|
49
|
{
|
49
|
{
|
|
50
|
$filed = ['id', 'project_id', 'title', 'sort' ,'thumb' ,'product_type' , 'route' ,
|
50
|
$filed = ['id', 'project_id', 'title', 'sort' ,'thumb' ,'product_type' , 'route' ,
|
|
51
|
'category_id', 'keyword_id', 'status', 'created_uid', 'is_upgrade' ,'created_at', 'updated_at','six_read'];
|
51
|
'category_id', 'keyword_id', 'status', 'created_uid', 'is_upgrade' ,'created_at', 'updated_at','six_read'];
|
|
52
|
- $this->order = 'sort';
|
|
|
|
53
|
- $query = $product->orderBy($this->order ,'desc')->orderBy('id','desc');
|
52
|
+ $this->order = $this->order ?? 'sort';
|
|
|
|
53
|
+ $query = $product->orderBy($this->order ,$this->order_type)->orderBy('id','desc');
|
|
54
|
$query = $this->searchParam($query);
|
54
|
$query = $this->searchParam($query);
|
|
55
|
$lists = $query->select($filed)->paginate($this->row, ['*'], 'page', $this->page);
|
55
|
$lists = $query->select($filed)->paginate($this->row, ['*'], 'page', $this->page);
|
|
56
|
if(!empty($lists)){
|
56
|
if(!empty($lists)){
|
|
@@ -71,6 +71,10 @@ class ProductController extends BaseController |
|
@@ -71,6 +71,10 @@ class ProductController extends BaseController |
|
71
|
}
|
71
|
}
|
|
72
|
$this->response('success',Code::SUCCESS,$lists);
|
72
|
$this->response('success',Code::SUCCESS,$lists);
|
|
73
|
}
|
73
|
}
|
|
|
|
74
|
+
|
|
|
|
75
|
+ public function setOrderBy(){
|
|
|
|
76
|
+
|
|
|
|
77
|
+ }
|
|
74
|
/**
|
78
|
/**
|
|
75
|
* @remark :列表
|
79
|
* @remark :列表
|
|
76
|
* @name :index
|
80
|
* @name :index
|