|
|
@@ -33,6 +33,7 @@ class MovieRepository extends BaseRepository
|
|
33
|
33
|
const yanglaojin_ratio = 0.3;
|
|
34
|
34
|
|
|
35
|
35
|
const pv_ratio = 0.7;
|
|
|
36
|
+ const tenMinute = 600;
|
|
36
|
37
|
|
|
37
|
38
|
/**
|
|
38
|
39
|
* ProductRepository constructor.
|
|
|
@@ -249,7 +250,7 @@ class MovieRepository extends BaseRepository
|
|
249
|
250
|
if ($orderModel) return $orderModel['order_id'];
|
|
250
|
251
|
throw new ValidateException('锁座下单失败');
|
|
251
|
252
|
});
|
|
252
|
|
- return $order_id;
|
|
|
253
|
+ return compact('order_id', 'order_sn');
|
|
253
|
254
|
} else {
|
|
254
|
255
|
throw new ValidateException($submitOrder['msg']);
|
|
255
|
256
|
}
|
|
|
@@ -519,6 +520,7 @@ class MovieRepository extends BaseRepository
|
|
519
|
520
|
$orderinfo = $this->dao->search(['order_sn' => $order_sn, 'uid' => $userinfo['uid']])->find();
|
|
520
|
521
|
if (empty($orderinfo)) throw new ValidateException('订单不存在');
|
|
521
|
522
|
|
|
|
523
|
+ $time = time();
|
|
522
|
524
|
$result = DouHuoMallFilmApiRequest::getOrderInfo($order_sn);
|
|
523
|
525
|
if (!empty($result) && ($result['code'] == ApiResponseService::DEFAULT_SUCCESS_CODE)) {
|
|
524
|
526
|
$plat_orderinfo = $result['data'];
|
|
|
@@ -549,9 +551,18 @@ class MovieRepository extends BaseRepository
|
|
549
|
551
|
];
|
|
550
|
552
|
$plat_orderinfo['sched_time'] = date('Y-m-d H:i', strtotime($result['data']['sched_time']));
|
|
551
|
553
|
$plat_orderinfo['schedend_time'] = date('m-d H:i', strtotime($result['data']['sched_time']) + $film['duration'] * 60);
|
|
552
|
|
- if ($plat_orderinfo['status'] == 1) {
|
|
|
554
|
+ $plat_orderinfo['time_remaining'] = 0;// 剩余时间
|
|
|
555
|
+ // 0 待支付 1 已支付 2已超时 3已取消 4已成功
|
|
|
556
|
+ $create_time = $plat_orderinfo['create_time'] + self::tenMinute;
|
|
|
557
|
+ if ($orderinfo['status'] == 0 && ($create_time < $time)) {
|
|
553
|
558
|
$plat_orderinfo['status'] = 0;
|
|
554
|
559
|
$plat_orderinfo['state'] = '待付款';
|
|
|
560
|
+ } elseif ($orderinfo['status'] == 1) {
|
|
|
561
|
+ $plat_orderinfo['status'] = 1;
|
|
|
562
|
+ $plat_orderinfo['state'] = '已支付';
|
|
|
563
|
+ } else {
|
|
|
564
|
+ $plat_orderinfo['status'] = 3;
|
|
|
565
|
+ $plat_orderinfo['state'] = '支付超时,已取消';
|
|
555
|
566
|
}
|
|
556
|
567
|
|
|
557
|
568
|
unset($plat_orderinfo['plat_order']);
|