Merge branch 'feature/purchase_record' into dev

This commit is contained in:
luofei 2023-07-07 10:54:33 +08:00
commit fd4f98f756
2 changed files with 6 additions and 2 deletions

View File

@ -2554,11 +2554,14 @@ class StoreOrderRepository extends BaseRepository
* @throws DbException
* @throws ModelNotFoundException
*/
public function purchaseOrder($merId, $page, $limit)
public function purchaseOrder($merId, $keyword, $page, $limit)
{
$orders = StoreOrder::where('mer_id', $merId)
->where('pay_type', StoreGroupOrder::PAY_TYPE_CREDIT_BUY)
->where('status', StoreOrder::STATUS_WAIT_COMMENT)
->when($keyword !== '', function ($query) use ($keyword) {
$query->where('order_sn|user_phone', 'like', "%$keyword%");
})
->page($page, $limit)
->select();
foreach ($orders as $order) {

View File

@ -383,7 +383,8 @@ class StoreOrder extends BaseController
public function purchaseOrder($merId, StoreOrderRepository $orderRepository)
{
[$page, $limit] = $this->getPage();
$list = $orderRepository->purchaseOrder($merId, $page, $limit);
$keyword = $this->request->param('keyword');
$list = $orderRepository->purchaseOrder($merId, $keyword, $page, $limit);
return app('json')->success($list);
}