<?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;
|
}
|
}
|