代购接口修改2
This commit is contained in:
parent
edbeb1cf0f
commit
8c7be15591
@ -75,7 +75,7 @@ class StoreOrder extends BaseController
|
|||||||
return app('json')->success($orderInfo);
|
return app('json')->success($orderInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function v2CreateOrder(StoreCartRepository $cartRepository, StoreOrderCreateRepository $orderCreateRepository)
|
public function v2CreateOrder(StoreCartRepository $cartRepository, StoreOrderCreateRepository $orderCreateRepository,StoreCartDgRepository $StoreCartDgRepository,StoreOrderCreateDgRepository $StoreOrderCreateDgRepository)
|
||||||
{
|
{
|
||||||
$cartId = (array)$this->request->param('cart_id', []);
|
$cartId = (array)$this->request->param('cart_id', []);
|
||||||
$addressId = (int)$this->request->param('address_id');
|
$addressId = (int)$this->request->param('address_id');
|
||||||
@ -87,7 +87,7 @@ class StoreOrder extends BaseController
|
|||||||
$mark = (array)$this->request->param('mark', []);
|
$mark = (array)$this->request->param('mark', []);
|
||||||
$payType = $this->request->param('pay_type');
|
$payType = $this->request->param('pay_type');
|
||||||
$post = (array)$this->request->param('post');
|
$post = (array)$this->request->param('post');
|
||||||
|
$is_dg = $this->request->param('is_dg',0);
|
||||||
$isPc = $payType === 'pc';
|
$isPc = $payType === 'pc';
|
||||||
if ($isPc) {
|
if ($isPc) {
|
||||||
$payType = 'balance';
|
$payType = 'balance';
|
||||||
@ -103,8 +103,15 @@ class StoreOrder extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$uid = $this->request->uid();
|
$uid = $this->request->uid();
|
||||||
if (!($count = count($cartId)) || $count != count($cartRepository->validIntersection($cartId, $uid)))
|
// if (!($count = count($cartId)) || $count != count($cartRepository->validIntersection($cartId, $uid)))
|
||||||
return app('json')->fail('数据无效');
|
// return app('json')->fail('数据无效');
|
||||||
|
if($is_dg){
|
||||||
|
if (!($count = count($cartId)) || $count != count($StoreCartDgRepository->validIntersection($cartId, $uid)))
|
||||||
|
return app('json')->fail('数据无效');
|
||||||
|
}else{
|
||||||
|
if (!($count = count($cartId)) || $count != count($cartRepository->validIntersection($cartId, $uid)))
|
||||||
|
return app('json')->fail('数据无效');
|
||||||
|
}
|
||||||
// if (!$addressId)
|
// if (!$addressId)
|
||||||
// return app('json')->fail('请选择地址');
|
// return app('json')->fail('请选择地址');
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user