配置地址
This commit is contained in:
@@ -18,8 +18,8 @@ return [
|
|||||||
'tokenUri' => 'https://open.cyzl.com/beta/auth/oauth/token',
|
'tokenUri' => 'https://open.cyzl.com/beta/auth/oauth/token',
|
||||||
'baseUri' => 'https://open.cyzl.com/beta/api',
|
'baseUri' => 'https://open.cyzl.com/beta/api',
|
||||||
'indexUri' => 'https://v.cyzl.com/beta/activity/helongjiangWashCar/index.html?activityId={{activityId}}#/?accessToken={{accessToken}}',
|
'indexUri' => 'https://v.cyzl.com/beta/activity/helongjiangWashCar/index.html?activityId={{activityId}}#/?accessToken={{accessToken}}',
|
||||||
'infoUri' => 'https://v.cyzl.com/beta/xtz-v2/portal/index.html?activityId={{activityId}}#/heilongjiang-car-ticketInfo?ticketCode={{ticketCode}}&isShowHead=1&accessToken={{accessToken}}',
|
|
||||||
//优惠券详情地址
|
//优惠券详情地址
|
||||||
|
'infoUri' => 'https://v.cyzl.com/beta/xtz-v2/portal/index.html?activityId={{activityId}}&activityNo=heilongjiang#/car-ticketInfo?ticketCode={{ticketCode}}&isShowHead=1&accessToken={{accessToken}}',
|
||||||
],
|
],
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -32,9 +32,10 @@ return [
|
|||||||
'grant_type' => 'client_credentials',
|
'grant_type' => 'client_credentials',
|
||||||
'tokenUri' => 'https://open.cyzl.com/api/auth/oauth/token',
|
'tokenUri' => 'https://open.cyzl.com/api/auth/oauth/token',
|
||||||
'baseUri' => 'https://open.cyzl.com/api',
|
'baseUri' => 'https://open.cyzl.com/api',
|
||||||
|
//首页购买页
|
||||||
'indexUri' => 'https://v.cyzl.com/activity/helongjiangWashCar/index.html?activityId={{activityId}}#/?accessToken={{accessToken}}',
|
'indexUri' => 'https://v.cyzl.com/activity/helongjiangWashCar/index.html?activityId={{activityId}}#/?accessToken={{accessToken}}',
|
||||||
'infoUri' => 'https://v.cyzl.com/xtz-v2/portal/index.html?activityId={{activityId}}#/heilongjiang-car-ticketInfo?ticketCode={{ticketCode}}&isShowHead=1&accessToken={{accessToken}}',
|
|
||||||
//优惠券详情地址
|
//优惠券详情地址
|
||||||
|
'infoUri' => 'https://v.cyzl.com/xtz-v2/portal/index.html?activityId={{activityId}}&activityNo=heilongjiang#/car-ticketInfo?ticketCode={{ticketCode}}&isShowHead=1&accessToken={{accessToken}}',
|
||||||
],
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -123,13 +123,31 @@ class CouponAction extends Init
|
|||||||
*/
|
*/
|
||||||
public function callback()
|
public function callback()
|
||||||
{
|
{
|
||||||
$couponCode = $this->params['couponCode'];
|
$validator = \Validator::make($this->params, [
|
||||||
$verifyTime = $this->params['verifyTime'];
|
'couponCode' => 'required',
|
||||||
$this->url = $this->params['url'];
|
'verifyTime' => 'required',
|
||||||
|
'url' => 'required',
|
||||||
|
], [
|
||||||
|
'couponCode.required' => '缺少参数:couponCode',
|
||||||
|
'verifyTime.required' => '缺少参数:verifyTime',
|
||||||
|
'url.required' => '缺少参数:url',
|
||||||
|
]);
|
||||||
|
|
||||||
|
if ($validator->fails()) {
|
||||||
|
$this->error = 999;
|
||||||
|
$this->message = $validator->errors()->first();
|
||||||
|
|
||||||
|
return $this->getResponse();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//插入日志
|
//插入日志
|
||||||
$this->addLog($this->params);
|
$this->addLog($this->params);
|
||||||
|
|
||||||
|
$couponCode = $this->params['couponCode'];
|
||||||
|
$verifyTime = $this->params['verifyTime'];
|
||||||
|
$this->url = $this->params['url'];
|
||||||
|
|
||||||
$coupon = Coupon::where('code', $couponCode)->first();
|
$coupon = Coupon::where('code', $couponCode)->first();
|
||||||
|
|
||||||
if ($coupon) {
|
if ($coupon) {
|
||||||
@@ -137,7 +155,7 @@ class CouponAction extends Init
|
|||||||
if (in_array($coupon->status, [Coupon::STATUS_INIT, Coupon::STATUS_ERROR])) {
|
if (in_array($coupon->status, [Coupon::STATUS_INIT, Coupon::STATUS_ERROR])) {
|
||||||
$coupon->status = Coupon::STATUS_USED;
|
$coupon->status = Coupon::STATUS_USED;
|
||||||
$coupon->used_at = $verifyTime;
|
$coupon->used_at = $verifyTime;
|
||||||
$coupon->source = $request->all();
|
$coupon->source = $this->params;
|
||||||
$coupon->save();
|
$coupon->save();
|
||||||
|
|
||||||
CouponLog::create([
|
CouponLog::create([
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
namespace XuanChen\WashCar\Models;
|
namespace XuanChen\WashCar\Models;
|
||||||
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
use XuanChen\WoUnicom\Action\Order;
|
||||||
|
|
||||||
class WashcarCoupon extends Model
|
class WashcarCoupon extends Model
|
||||||
{
|
{
|
||||||
@@ -22,4 +23,9 @@ class WashcarCoupon extends Model
|
|||||||
self::STATUS_ERROR => '失败',
|
self::STATUS_ERROR => '失败',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
public function order()
|
||||||
|
{
|
||||||
|
return $this->morphTo();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user