applyConditions
This commit is contained in:
parent
2a46e58e23
commit
0d7b480f9f
@ -26,8 +26,9 @@ class OrderRepository extends Repository
|
||||
* @var array
|
||||
*/
|
||||
protected $fieldSearchable = [
|
||||
'id' => '=',
|
||||
'created_at' => 'like',
|
||||
'id' => '=',
|
||||
'sn' => 'like',
|
||||
'package.name' => 'like',
|
||||
];
|
||||
|
||||
public function model()
|
||||
@ -62,7 +63,7 @@ class OrderRepository extends Repository
|
||||
if (isset($conditions['company_id'])) {
|
||||
$this->model = $this->model->where('company_id', $conditions['company_id']);
|
||||
}
|
||||
|
||||
|
||||
if (isset($conditions['sn'])) {
|
||||
$this->model = $this->model->where('sn', $conditions['sn']);
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ class OrderService extends Service
|
||||
$limit = $conditions['limit'] ?? 35;
|
||||
|
||||
$res = $this->orderRepository->with(['company:id,name','package:id,name,carrier_operator'])
|
||||
->withConditions($conditions)->orderBy('order_at', 'desc')->paginate($limit);
|
||||
->withConditions($conditions)->applyConditions()->orderBy('order_at', 'desc')->paginate($limit);
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user