quanwei
2 days ago 73b874c72ad55eb9eef21c36160ac0de58f0189e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
 
namespace app\job\model\plus\operations;
 
use app\common\model\plus\operations\Order as OrderModel;
use app\common\service\order\OrderService;
 
/**
 * 运营中心订单模型
 */
class Order extends OrderModel
{
    /**
     * 获取未结算的运营中心订单
     */
    public function getUnSettledList()
    {
        $list = $this->where('is_invalid', '=', 0)
            ->where('is_settled', '=', 0)
            ->select();
        if ($list->isEmpty()) {
            return $list;
        }
        // 整理订单信息
        $with = ['product' => ['refund']];
        return OrderService::getOrderList($list, 'order_master', $with);
    }
 
    /**
     * 标记订单已失效(批量)
     */
    public function setInvalid($ids)
    {
        return $this->where('id', 'in', $ids)
            ->save(['is_invalid' => 1]);
    }
 
}