$jsStatDistance) { util::fail('前端计算距离有误!'); } $sjId = $shopInfo['sjId']; $ext = MerchantExtendService::getBySjId($sjId); $freight = MerchantExtendService::getFreight($ext); $firstDistance = $freight[0]; $addPrice = $freight[1]; $remainDistance = $jsStatDistance > $firstDistance ? stringUtil::calcSub($jsStatDistance, $firstDistance) : 0; $sendCost = ceil($remainDistance * 1000 / 1000 / 1000) * $addPrice; return $sendCost; } //获取默认门店信息 ssh 2019.12.6 public static function getDefaultShop($merchant) { $defaultShopId = $merchant['defaultShopId']; return ShopClass::getById($defaultShopId); } //验证门店 public static function valid($shopInfo, $sjId) { ShopClass::valid($shopInfo, $sjId); } public static function getShopList($where) { $list = ShopClass::getShopList($where); return $list; } //获取默认门店 ssh 2020.1.19 public static function getDefaultShopId($merchant) { return ShopClass::getDefaultShopId($merchant); } //更新门店 ssh 2020.2.29 /*public static function updateShop($id, $data) { return ShopClass::updateShop($id, $data); }*/ //删除门店 ssh 2020.3.1 /*public static function deleteShop($shop) { return ShopClass::deleteShop($shop); }*/ //获取收款码 ssh 2020.3.9 /*public static function generateGatheringCode($sjId, $shopId) { return ShopClass::generateGatheringCode($sjId, $shopId); }*/ //根据商家ID,获取所有门店 shopIds lqh 2021.3.4 public static function getShopIds($sjId) { $shops = ShopClass::getAllShop($sjId); $shopIds = []; if($shops){ $shopIds = array_column($shops,'id'); } return $shopIds; } //获取门店资产信息 lqh 2021.4.14 public static function getById($shopId, $returnObj = false) { return ShopClass::getById($shopId, $returnObj); } //总订单加1 public static function totalOrderPlus($shopId) { $shop = ShopClass::getById($shopId); if($shop){ $data = [ 'totalOrder'=>$shop['totalOrder'] + 1 ]; ShopClass::updateById($shopId,$data); } } //更新总收入 public static function updateTotalIncome($shopId,$amount) { $shop = ShopClass::getById($shopId); if($shop){ $data = [ 'totalIncome'=>bcadd($shop['totalIncome'],$amount,2) ]; ShopClass::updateById($shopId,$data); } } //更新总访问数 +1 public static function totalViewPlus($shopId) { $shop = ShopClass::getById($shopId); if($shop){ $data = [ 'totalView'=>$shop['totalView'] + 1 ]; ShopClass::updateById($shopId,$data); } } }