|
|
|
@ -41,6 +41,7 @@ class VerificationController extends Controller |
|
|
|
return $this->success(); |
|
|
|
} |
|
|
|
|
|
|
|
//生成核销二维码
|
|
|
|
public function qrcode() |
|
|
|
{ |
|
|
|
$id = request()->input('id'); //订单ID
|
|
|
|
@ -48,7 +49,7 @@ class VerificationController extends Controller |
|
|
|
$order = Order::where(['agent_id' => $this->agent_id, 'user_id' => $this->user_id])->find($id); |
|
|
|
if (!$order) { |
|
|
|
return $this->error('订单不存在!'); |
|
|
|
} else if (!in_array($order->status, [OrderStatus::PAID, OrderStatus::PAID_RETAINAGE, OrderStatus::REFUSED_REFUND])) { |
|
|
|
} else if (!in_array($order->status, [OrderStatus::PAID, OrderStatus::PAID_RETAINAGE, OrderStatus::OFFLINE_PAID, OrderStatus::REFUSED_REFUND])) { |
|
|
|
return $this->error('当前订单状态不允许核销!'); |
|
|
|
} else if (!$order->verify_code) { |
|
|
|
$order->verify_code = uniqid(); |
|
|
|
@ -64,7 +65,7 @@ class VerificationController extends Controller |
|
|
|
]; |
|
|
|
$app = Factory::miniProgram($config); |
|
|
|
|
|
|
|
$response = $app->app_code->getUnlimit($verify_code, ['path' => 'pages/index/index']); |
|
|
|
$response = $app->app_code->getUnlimit($verify_code, ['path' => 'pages/verification/index']); |
|
|
|
|
|
|
|
if ($response instanceof \EasyWeChat\Kernel\Http\StreamResponse) { |
|
|
|
$filename = $response->saveAs(storage_path('app/public/verify_code'), $verify_code); |
|
|
|
|