quanwei
2025-10-30 204b4cb1fcf1234010f722e0c9d4e88d10e654b1
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\api\model\plus\goodstore;
 
use app\common\model\store\Store as StoreModel;
 
/**
 * 限时秒杀模型
 */
class Store extends StoreModel
{
    /**
     * 获取门店列表
     */
    public function getList($postData)
    {
        $model = $this;
        if(!empty($postData["store_name"])){
            $model = $model->where('store_name', 'like', '%' . trim($postData['store_name']) . '%');
        }
        if(!empty($postData["category_id"])){
            $model = $model->where('supplier.category_id', '=', $postData["category_id"]);
        }
        $postData["list_rows"] = 100;
        // 获取列表数据
        $list = $model->alias("s")
            ->with(['logo', 'supplier'])
            ->join('good_store goodstore', 'goodstore.store_id=s.store_id')
            ->join('supplier supplier', 's.shop_supplier_id = supplier.shop_supplier_id', 'left')
            ->where('s.is_delete', '=', 0)
            ->where('s.status', '=', 1)
            ->where('s.is_good', '=', 1)
            ->where('supplier.is_delete', '=', 0)
            ->order('goodstore.store_sort asc')
            ->paginate($postData);
        return $list;
    }
}