处理订单详情的错误
This commit is contained in:
parent
0524721634
commit
80b5274065
@ -15,6 +15,7 @@ namespace app\common\repositories\store\order;
|
||||
|
||||
|
||||
use app\common\dao\store\order\StoreGroupOrderDao;
|
||||
use app\common\model\store\order\StoreGroupOrder;
|
||||
use app\common\repositories\BaseRepository;
|
||||
use app\common\repositories\store\coupon\StoreCouponRepository;
|
||||
use app\common\repositories\store\coupon\StoreCouponUserRepository;
|
||||
@ -37,7 +38,6 @@ class StoreGroupOrderRepository extends BaseRepository
|
||||
{
|
||||
|
||||
public $getAll = false;
|
||||
public $productType;
|
||||
|
||||
/**
|
||||
* StoreGroupOrderRepository constructor.
|
||||
@ -82,16 +82,17 @@ 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('StoreGroupOrder.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');
|
||||
})->with(['merchant' => function ($query) use ($flag) {
|
||||
$flag && $query->field('mer_id,mer_name');
|
||||
}, 'orderProduct', 'presellOrder']);
|
||||
}])->find();
|
||||
return StoreGroupOrder::where($where)
|
||||
->where('group_order_id', $id)
|
||||
->where('is_del', 0)
|
||||
->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');
|
||||
})->with(['merchant' => function ($query) use ($flag) {
|
||||
$flag && $query->field('mer_id,mer_name');
|
||||
}, 'orderProduct', 'presellOrder']);
|
||||
}])
|
||||
->order('create_time DESC')->find();
|
||||
}
|
||||
|
||||
public function status($uid, $id)
|
||||
|
@ -192,7 +192,6 @@ 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