配置修改
This commit is contained in:
@ -35,11 +35,12 @@ class Shop extends Api
|
||||
{
|
||||
if($this->request->isGet()) {
|
||||
$shopId = $this->request->get('shop_id', '', 'trim');
|
||||
$city_id = $this->request->get('city_id', 0);
|
||||
$validate = Validate::rule('shop_id', 'require|integer|gt:0');
|
||||
if(!$validate->check(['shop_id'=>$shopId])) {
|
||||
return JsonServer::error($validate->getError());
|
||||
}
|
||||
$data = ShopLogic::getShopInfo($shopId, $this->user_id, input());
|
||||
$data = ShopLogic::getShopInfo($city_id,$shopId, $this->user_id, input());
|
||||
return JsonServer::success('获取店铺信息成功', $data);
|
||||
}else{
|
||||
return JsonServer::error('请求类型错误');
|
||||
|
||||
@ -22,12 +22,22 @@ class ShopLogic extends Logic
|
||||
/**
|
||||
* 获取店铺信息
|
||||
*/
|
||||
public static function getShopInfo($shopId, $userId, $params = [])
|
||||
public static function getShopInfo($city_id,$shopId, $userId, $params = [])
|
||||
{
|
||||
// 记录统计信息(访问商铺用户量)
|
||||
Event::listen('ShopStat', 'app\common\listener\ShopStat');
|
||||
event('ShopStat', $shopId);
|
||||
|
||||
$shop_msg = Shop::where("city_id",$city_id)
|
||||
->where("is_run",1)
|
||||
->where("is_freeze",0)
|
||||
->where("del",0)
|
||||
->find();
|
||||
$c = "";
|
||||
if($shop_msg == null){
|
||||
$c = "id = 0";
|
||||
}else{
|
||||
$c = "city_id = ".$city_id."";
|
||||
}
|
||||
$where = [
|
||||
'del' => 0,
|
||||
'id' => $shopId
|
||||
@ -41,6 +51,7 @@ class ShopLogic extends Logic
|
||||
'run_start_time', 'run_end_time', 'weekdays',
|
||||
];
|
||||
$shop = Shop::field($field)
|
||||
->where($c)
|
||||
->where($where)
|
||||
->append([ 'type_desc', 'is_expire' ])
|
||||
->findOrEmpty();
|
||||
|
||||
Reference in New Issue
Block a user