修改待付款订单列表
This commit is contained in:
parent
1e4be9da6f
commit
c51850a61d
@ -16,6 +16,7 @@ namespace app\common\dao\store\order;
|
||||
|
||||
use app\common\dao\BaseDao;
|
||||
use app\common\model\store\order\StoreGroupOrder;
|
||||
use app\common\model\store\order\StoreOrder;
|
||||
|
||||
/**
|
||||
* Class StoreGroupOrderDao
|
||||
@ -57,14 +58,16 @@ class StoreGroupOrderDao extends BaseDao
|
||||
*/
|
||||
public function search(array $where)
|
||||
{
|
||||
return StoreGroupOrder::getDB()->when(isset($where['paid']) && $where['paid'] !== '', function ($query) use ($where) {
|
||||
$query->where('paid', $where['paid']);
|
||||
$storeOrderWhere = StoreOrder::where('activity_type', $where['product_type']);
|
||||
return StoreGroupOrder::hasWhere('orderList', $storeOrderWhere)
|
||||
->when(isset($where['paid']) && $where['paid'] !== '', function ($query) use ($where) {
|
||||
$query->where('StoreGroupOrder.paid', $where['paid']);
|
||||
})->when(isset($where['uid']) && $where['uid'] !== '', function ($query) use ($where) {
|
||||
$query->where('uid', $where['uid']);
|
||||
$query->where('StoreGroupOrder.uid', $where['uid']);
|
||||
})->order('create_time DESC')->when(isset($where['is_del']) && $where['is_del'] !== '', function ($query) use ($where) {
|
||||
$query->where('is_del', $where['is_del']);
|
||||
$query->where('StoreGroupOrder.is_del', $where['is_del']);
|
||||
}, function ($query) {
|
||||
$query->where('is_del', 0);
|
||||
$query->where('StoreGroupOrder.is_del', 0);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ class StoreGroupOrderRepository extends BaseRepository
|
||||
$query = $this->search($where);
|
||||
$count = $query->count();
|
||||
$list = $query->with(['orderList' => function (Relation $query) {
|
||||
$query->field('order_id,group_order_id,activity_type,pay_price')->with(['orderProduct','presellOrder']);
|
||||
$query->field('order_id,group_order_id,activity_type,pay_price,status')->with(['orderProduct','presellOrder']);
|
||||
}])->page($page, $limit)->order('create_time DESC')->select();
|
||||
return compact('count', 'list');
|
||||
}
|
||||
|
@ -179,7 +179,8 @@ class StoreOrder extends BaseController
|
||||
public function groupOrderList(StoreGroupOrderRepository $groupOrderRepository)
|
||||
{
|
||||
[$page, $limit] = $this->getPage();
|
||||
$list = $groupOrderRepository->getList(['uid' => $this->request->uid(), 'paid' => 0], $page, $limit);
|
||||
$productType = $this->request->param('product_type', 0);
|
||||
$list = $groupOrderRepository->getList(['uid' => $this->request->uid(), 'paid' => 0, 'product_type' => $productType], $page, $limit);
|
||||
return app('json')->success($list);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user