applyConditions

This commit is contained in:
邓皓元 2018-12-13 15:29:52 +08:00
parent 2a46e58e23
commit 0d7b480f9f
2 changed files with 5 additions and 4 deletions

View File

@ -26,8 +26,9 @@ class OrderRepository extends Repository
* @var array * @var array
*/ */
protected $fieldSearchable = [ protected $fieldSearchable = [
'id' => '=', 'id' => '=',
'created_at' => 'like', 'sn' => 'like',
'package.name' => 'like',
]; ];
public function model() public function model()

View File

@ -38,7 +38,7 @@ class OrderService extends Service
$limit = $conditions['limit'] ?? 35; $limit = $conditions['limit'] ?? 35;
$res = $this->orderRepository->with(['company:id,name','package:id,name,carrier_operator']) $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; return $res;
} }