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
<?php
 
namespace app\supplier\model\supplier;
 
use app\common\model\supplier\Capital as SupplierCapitalModel;
/**
 * 后台管理员登录模型
 */
class Capital extends SupplierCapitalModel
{
    /**
     * 获取列表数据
     */
    public function getList($shop_supplier_id, $params)
    {
        $model = $this;
        if(isset($params['flow_type']) && $params['flow_type'] != 0){
            $model = $model->where('flow_type', '=', $params['flow_type']);
        }
        if(isset($params['start_day']) && !empty($params['start_day'])){
            $model = $model->where('create_time', '>=', strtotime($params['start_day']));
        }
        if(isset($params['end_day']) && !empty($params['end_day'])){
            $model = $model->where('create_time', '<', strtotime($params['end_day']));
        }
        // 查询列表数据
        return $model->where('shop_supplier_id', '=', $shop_supplier_id)
            ->order(['create_time' => 'desc'])
            ->paginate($params);
    }
}