生成取货码和修改核销码判断
This commit is contained in:
parent
ecf559d4bc
commit
797090de46
@ -1998,8 +1998,11 @@ class StoreOrderRepository extends BaseRepository
|
|||||||
|
|
||||||
public function verifyOrder(int $id, int $merId, array $data, $serviceId = 0)
|
public function verifyOrder(int $id, int $merId, array $data, $serviceId = 0)
|
||||||
{
|
{
|
||||||
$order = $this->dao->getWhere(['order_id' => $id, 'mer_id' => $merId, 'verify_code' => $data['verify_code'], 'order_type' => 1], '*', ['orderProduct']);
|
$order = $this->dao->getWhere(['order_id' => $id, 'mer_id' => $merId, 'order_type' => 1], '*', ['orderProduct']);
|
||||||
if (!$order) throw new ValidateException('订单不存在');
|
if (!$order) throw new ValidateException('订单不存在');
|
||||||
|
if($order['verify_code']!=$data['verify_code']){
|
||||||
|
throw new ValidateException('核销码不正确');
|
||||||
|
}
|
||||||
if (!$order->paid) throw new ValidateException('订单未支付');
|
if (!$order->paid) throw new ValidateException('订单未支付');
|
||||||
if ($order['status']) throw new ValidateException('订单已全部核销,请勿重复操作');
|
if ($order['status']) throw new ValidateException('订单已全部核销,请勿重复操作');
|
||||||
foreach ($data['data'] as $v) {
|
foreach ($data['data'] as $v) {
|
||||||
|
@ -147,8 +147,7 @@ class Order extends BaseController
|
|||||||
$split = $this->request->params(['is_split', ['split', []]]);
|
$split = $this->request->params(['is_split', ['split', []]]);
|
||||||
if (!$this->repository->merDeliveryExists($id, $this->request->merId()))
|
if (!$this->repository->merDeliveryExists($id, $this->request->merId()))
|
||||||
return app('json')->fail('订单信息或状态错误');
|
return app('json')->fail('订单信息或状态错误');
|
||||||
switch ($type)
|
switch ($type) {
|
||||||
{
|
|
||||||
case 3: //虚拟发货
|
case 3: //虚拟发货
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
'delivery_type',
|
'delivery_type',
|
||||||
@ -170,7 +169,8 @@ class Order extends BaseController
|
|||||||
'temp_id',
|
'temp_id',
|
||||||
'remark',
|
'remark',
|
||||||
]);
|
]);
|
||||||
if (!$data['from_name'] ||
|
if (
|
||||||
|
!$data['from_name'] ||
|
||||||
!$data['delivery_name'] ||
|
!$data['delivery_name'] ||
|
||||||
!$data['from_tel'] ||
|
!$data['from_tel'] ||
|
||||||
!$data['from_addr'] ||
|
!$data['from_addr'] ||
|
||||||
@ -349,6 +349,16 @@ class Order extends BaseController
|
|||||||
return app('json')->success($order);
|
return app('json')->success($order);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成取货码
|
||||||
|
*/
|
||||||
|
public function logisticsCode($id)
|
||||||
|
{
|
||||||
|
$order = $this->repository->getWhere(['order_id' => $id, 'mer_id' => $this->request->merId(), 'is_del' => 0]);
|
||||||
|
if (!$order)
|
||||||
|
return app('json')->fail('订单状态有误');
|
||||||
|
return app('json')->success(['qrcode' => $this->repository->logisticsQrcode($id, $order->order_sn)]);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* @param $id
|
* @param $id
|
||||||
* @return mixed
|
* @return mixed
|
||||||
|
@ -109,6 +109,9 @@ Route::group(function () {
|
|||||||
Route::get('children/:id', 'Order/childrenList')->name('merchantStoreOrderChildrenList')->option([
|
Route::get('children/:id', 'Order/childrenList')->name('merchantStoreOrderChildrenList')->option([
|
||||||
'_alias' => '关联订单',
|
'_alias' => '关联订单',
|
||||||
]);
|
]);
|
||||||
|
Route::get('logistics_code/:id', 'Order/logisticsCode')->name('merchantStoreOrderLogisticsCode')->option([
|
||||||
|
'_alias' => '生成取货码',
|
||||||
|
]);
|
||||||
})->prefix('merchant.store.order.')->option([
|
})->prefix('merchant.store.order.')->option([
|
||||||
'_path' => '/order/list',
|
'_path' => '/order/list',
|
||||||
'_auth' => true,
|
'_auth' => true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user