...
|
...
|
@@ -171,6 +171,8 @@ class Order extends Model |
|
|
{
|
|
|
// 筛选条件
|
|
|
$filter = [];
|
|
|
// 排序方式
|
|
|
$order = ['createtime' => 'desc'];
|
|
|
// 订单数据类型
|
|
|
switch ($type) {
|
|
|
case 'all':
|
...
|
...
|
@@ -178,6 +180,7 @@ class Order extends Model |
|
|
case 'payment';//待支付
|
|
|
$filter['pay_status'] = '0';
|
|
|
$filter['refund_status'] = '0';
|
|
|
$order = ['createtime' => 'asc'];
|
|
|
break;
|
|
|
case 'delivery';//待发货
|
|
|
$filter['pay_status'] = '1';
|
...
|
...
|
@@ -202,7 +205,7 @@ class Order extends Model |
|
|
->where('user_id', $user_id)
|
|
|
->where('order_status', '<>', '2')
|
|
|
->where($filter)
|
|
|
->order(['createtime' => 'desc'])
|
|
|
->order($order)
|
|
|
->select();
|
|
|
}
|
|
|
|
...
|
...
|
@@ -388,6 +391,18 @@ class Order extends Model |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 待支付订单时效为24小时,超时将成为无效订单,系统自动将订单从待付款页面移出。
|
|
|
*/
|
|
|
public function checkPaymentOrder($user_id)
|
|
|
{
|
|
|
$list = $this->getList($user_id,'payment');
|
|
|
foreach($list as $v){
|
|
|
$v->cancel();
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 设置错误信息
|
|
|
* @param $error
|
|
|
*/
|
...
|
...
|
|