This commit is contained in:
root
2020-01-01 23:54:20 +08:00
parent 20be5c3182
commit 453a078cd5
3 changed files with 0 additions and 35 deletions

View File

@ -12,7 +12,6 @@ use App\Models\Order;
use App\Models\Plan;
use App\Models\User;
use App\Models\Coupon;
use App\Models\CouponLog;
use App\Utils\Helper;
use Omnipay\Omnipay;
use Stripe\Stripe;
@ -134,17 +133,6 @@ class OrderController extends Controller
abort(500, '优惠券使用失败');
}
}
// add coupon log
if (!CouponLog::create([
'coupon_id' => $coupon->id,
'user_id' => $order->user_id,
'order_trade_no' => $order->trade_no,
'total_amount' => $order->total_amount,
'discount_amount' => $order->discount_amount
])) {
DB::rollback();
abort(500, '优惠券使用失败');
}
}
// free process
if ($order->total_amount <= 0) {

View File

@ -1,12 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class CouponLog extends Model
{
protected $table = 'v2_coupon_log';
protected $dateFormat = 'U';
protected $guarded = ['id'];
}