增加作废
This commit is contained in:
@@ -20,20 +20,22 @@ class ConponCallbackListener implements ShouldQueue
|
|||||||
public function handle(ConponCallback $event)
|
public function handle(ConponCallback $event)
|
||||||
{
|
{
|
||||||
$acticity_coupon = $event->acticity_coupon;
|
$acticity_coupon = $event->acticity_coupon;
|
||||||
$user = $acticity_coupon->outlet->parent;
|
|
||||||
|
|
||||||
|
$user = $acticity_coupon->outlet->parent;
|
||||||
if ($user->callback) {
|
if ($user->callback) {
|
||||||
$client = new Client();
|
$client = new Client();
|
||||||
|
|
||||||
$response = $client->request('post', $user->callback, [
|
$response = $client->request('post', $user->callback, [
|
||||||
'timeout' => 30,
|
'timeout' => 30,
|
||||||
'query' => [
|
'query' => [
|
||||||
'code' => $acticity_coupon->code,
|
'code' => $acticity_coupon->code,
|
||||||
|
'status' => $acticity_coupon->status,
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'code' => $acticity_coupon->code,
|
'code' => $acticity_coupon->code,
|
||||||
|
'type' => $acticity_coupon->status == 2 ? 'Verification' : 'Destroy',
|
||||||
'url' => $user->callback,
|
'url' => $user->callback,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace XuanChen\Coupon\Action\ysd;
|
namespace XuanChen\Coupon\Action\ysd;
|
||||||
|
|
||||||
|
use App\Events\ConponCallback;
|
||||||
use App\Models\ActivityCoupon;
|
use App\Models\ActivityCoupon;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use XuanChen\Coupon\Action\Init;
|
use XuanChen\Coupon\Action\Init;
|
||||||
@@ -45,6 +46,8 @@ class YsdDestroy extends Init
|
|||||||
$info->status = ActivityCoupon::STATUS_CLOSE;
|
$info->status = ActivityCoupon::STATUS_CLOSE;
|
||||||
$info->save();
|
$info->save();
|
||||||
|
|
||||||
|
event(new ConponCallback($info));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return $e->getMessage();
|
return $e->getMessage();
|
||||||
|
|||||||
Reference in New Issue
Block a user