|
@@ -171,6 +171,8 @@ class Order extends Model |
|
@@ -171,6 +171,8 @@ class Order extends Model |
171
|
{
|
171
|
{
|
172
|
// 筛选条件
|
172
|
// 筛选条件
|
173
|
$filter = [];
|
173
|
$filter = [];
|
|
|
174
|
+ // 排序方式
|
|
|
175
|
+ $order = ['createtime' => 'desc'];
|
174
|
// 订单数据类型
|
176
|
// 订单数据类型
|
175
|
switch ($type) {
|
177
|
switch ($type) {
|
176
|
case 'all':
|
178
|
case 'all':
|
|
@@ -178,6 +180,7 @@ class Order extends Model |
|
@@ -178,6 +180,7 @@ class Order extends Model |
178
|
case 'payment';//待支付
|
180
|
case 'payment';//待支付
|
179
|
$filter['pay_status'] = '0';
|
181
|
$filter['pay_status'] = '0';
|
180
|
$filter['refund_status'] = '0';
|
182
|
$filter['refund_status'] = '0';
|
|
|
183
|
+ $order = ['createtime' => 'asc'];
|
181
|
break;
|
184
|
break;
|
182
|
case 'delivery';//待发货
|
185
|
case 'delivery';//待发货
|
183
|
$filter['pay_status'] = '1';
|
186
|
$filter['pay_status'] = '1';
|
|
@@ -202,7 +205,7 @@ class Order extends Model |
|
@@ -202,7 +205,7 @@ class Order extends Model |
202
|
->where('user_id', $user_id)
|
205
|
->where('user_id', $user_id)
|
203
|
->where('order_status', '<>', '2')
|
206
|
->where('order_status', '<>', '2')
|
204
|
->where($filter)
|
207
|
->where($filter)
|
205
|
- ->order(['createtime' => 'desc'])
|
208
|
+ ->order($order)
|
206
|
->select();
|
209
|
->select();
|
207
|
}
|
210
|
}
|
208
|
|
211
|
|
|
@@ -388,6 +391,18 @@ class Order extends Model |
|
@@ -388,6 +391,18 @@ class Order extends Model |
388
|
}
|
391
|
}
|
389
|
|
392
|
|
390
|
/**
|
393
|
/**
|
|
|
394
|
+ * 待支付订单时效为24小时,超时将成为无效订单,系统自动将订单从待付款页面移出。
|
|
|
395
|
+ */
|
|
|
396
|
+ public function checkPaymentOrder($user_id)
|
|
|
397
|
+ {
|
|
|
398
|
+ $list = $this->getList($user_id,'payment');
|
|
|
399
|
+ foreach($list as $v){
|
|
|
400
|
+ $v->cancel();
|
|
|
401
|
+ }
|
|
|
402
|
+ return true;
|
|
|
403
|
+ }
|
|
|
404
|
+
|
|
|
405
|
+ /**
|
391
|
* 设置错误信息
|
406
|
* 设置错误信息
|
392
|
* @param $error
|
407
|
* @param $error
|
393
|
*/
|
408
|
*/
|