Commit 2bc3d8f7 authored by luhongguang's avatar luhongguang

Merge branch 'develop' of https://git.yidian-inc.com:8021/bp/goods into develop

parents f73b5cb1 12a648a2
...@@ -146,10 +146,10 @@ class ShopService ...@@ -146,10 +146,10 @@ class ShopService
$address = !empty($params['address']) ? $params['address'] : ''; $address = !empty($params['address']) ? $params['address'] : '';
$phone = !empty($params['phone']) ? $params['phone'] : ''; $phone = !empty($params['phone']) ? $params['phone'] : '';
$subShopId = !empty($params['sub_shop_id']) ? $params['sub_shop_id'] : ''; $subShopId = !empty($params['sub_shop_id']) ? $params['sub_shop_id'] : '';
if (empty($subShopId)) { $lifeAccountId = !empty($params['life_account_id']) ? $params['life_account_id'] : '';
throw new ShopException(['cus' => 9]); // if (empty($subShopId)) {
} // throw new ShopException(['cus' => 9]);
// }
$colums = []; $colums = [];
if (!empty($name)) { if (!empty($name)) {
$detectParams = [ $detectParams = [
...@@ -187,7 +187,28 @@ class ShopService ...@@ -187,7 +187,28 @@ class ShopService
if (!empty($phone)) { if (!empty($phone)) {
$colums['phone'] = $phone; $colums['phone'] = $phone;
} }
$subShop = SubShop::updateRecord($colums, $where);
if (!empty($where['sub_shop_id'])) {
$subShop = SubShop::updateRecord($colums, $where);
}else{
$shopInfo = Shop::getRecord(['life_account_id' => $lifeAccountId]);
$shopId = !empty($shopInfo['shop_id']) ? $shopInfo['shop_id'] : '';
$res = self::getIdgenId(1, 'goods', $count = 1);
$subShopId = !empty($res[0]) ? $res[0] : '';
$colums = [
'sub_shop_id' => $subShopId,
'life_account_id' => $lifeAccountId,
'shop_id' => $shopId,
'shop_name' => $name,
'longitude' => $longitude,
'latitude' => $latitude,
'address' => $address,
'phone' => $phone,
'create_time' => date("Y-m-d H:i:s"),
];
$subShop = SubShop::insertRecord($colums);
}
if (empty($subShop)) { if (empty($subShop)) {
throw new ShopException(['cus' => 6]); throw new ShopException(['cus' => 6]);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment