修改订单列表
This commit is contained in:
parent
4463fb9daf
commit
bc6387bff8
@ -37,6 +37,7 @@ class StoreGroupOrderRepository extends BaseRepository
|
||||
{
|
||||
|
||||
public $getAll = false;
|
||||
public $productType;
|
||||
|
||||
/**
|
||||
* StoreGroupOrderRepository constructor.
|
||||
@ -81,6 +82,9 @@ class StoreGroupOrderRepository extends BaseRepository
|
||||
public function detail($uid, $id, $flag = true)
|
||||
{
|
||||
$where = $this->getAll ? ['uid' => $uid] : ['paid' => 0, 'uid' => $uid];
|
||||
if ($this->productType !== '') {
|
||||
$where['product_type'] = $this->productType;
|
||||
}
|
||||
return $this->search($where)->where('group_order_id', $id)->with(['orderList' => function (Relation $query) use ($flag) {
|
||||
$query->when($flag, function ($query) {
|
||||
$query->field('order_id,group_order_id,mer_id,order_sn,activity_type,pay_price,order_extend,order_type,is_virtual');
|
||||
|
@ -192,6 +192,7 @@ class StoreOrder extends BaseController
|
||||
public function groupOrderDetail($id, StoreGroupOrderRepository $groupOrderRepository)
|
||||
{
|
||||
$groupOrderRepository->getAll = true;
|
||||
$groupOrderRepository->productType = $this->request->param('product_type', 0);
|
||||
$groupOrder = $groupOrderRepository->detail($this->request->uid(), (int)$id);
|
||||
if (!$groupOrder)
|
||||
return app('json')->fail('订单不存在');
|
||||
|
Loading…
x
Reference in New Issue
Block a user