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
$address = !empty($params['address']) ? $params['address'] : '';
$phone = !empty($params['phone']) ? $params['phone'] : '';
$subShopId = !empty($params['sub_shop_id']) ? $params['sub_shop_id'] : '';
if (empty($subShopId)) {
throw new ShopException(['cus' => 9]);
}
$lifeAccountId = !empty($params['life_account_id']) ? $params['life_account_id'] : '';
// if (empty($subShopId)) {
// throw new ShopException(['cus' => 9]);
// }
$colums = [];
if (!empty($name)) {
$detectParams = [
......@@ -187,7 +187,28 @@ class ShopService
if (!empty($phone)) {
$colums['phone'] = $phone;
}
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)) {
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