配置修改

This commit is contained in:
2026-07-13 16:33:09 +08:00
parent 9998f4651b
commit d1a15a4c42
15 changed files with 348 additions and 38 deletions

View File

@ -5,6 +5,7 @@ use app\common\basics\Logic;
use app\common\enum\GoodsEnum;
use app\common\enum\ShopAdEnum;
use app\common\enum\ShopEnum;
use app\common\logic\CityLogic;
use app\common\logic\QrCodeLogic;
use app\common\model\dev\DevRegion;
use app\common\model\shop\ShopAd;
@ -108,21 +109,32 @@ class ShopLogic extends Logic
return $shop;
}
public static function getShopCityInfo($city_id,$userId, $params = [])
public static function getShopCityInfo($city_id, $userId, $params = [])
{
// 未扫码进入:上海总部;扫码进入:码主人所属城市(忽略定位 city_id
$entryCity = CityLogic::getEntryCity([
'invite_code' => $params['invite_code'] ?? '',
'user_id' => (int)($params['user_id'] ?? 0),
]);
$city_id = (int)($entryCity['id'] ?? 0);
$entryShopId = (int)($entryCity['shop_id'] ?? 0);
// 记录统计信息(访问商铺用户量)
Event::listen('ShopStat', 'app\common\listener\ShopStat');
$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 = 1";
}else{
$c = "city_id = ".$city_id."";
if ($entryShopId > 0) {
$c = 'id = ' . $entryShopId;
} else {
$shop_msg = Shop::where("city_id", $city_id)
->where("is_run", 1)
->where("is_freeze", 0)
->where("del", 0)
->find();
if ($shop_msg == null) {
$c = "id = 1";
} else {
$c = "city_id = " . $city_id . "";
}
}
$field = [
@ -199,6 +211,8 @@ class ShopLogic extends Logic
'mobile' => ShopAd::where($adWhere)->where('terminal', ShopAdEnum::TERMINAL_MOBILE)->append([ 'link_path', 'link_query' ])->order('sort desc,id desc')->select()->toArray(),
];
$shop['entry_city'] = $entryCity;
return $shop;
}