Commit dbe63ef9 authored by luhongguang's avatar luhongguang

update:goods 数据脚本

parent 44de058d
......@@ -79,6 +79,11 @@ class GoodsToInitController extends Cli
$merchantId = $lifeAccountInfo["merchant_id"];
}
if (empty($lifeAccountId) || empty($merchantId)) {
echo "add goods data, user_id: $userId 没有 life_account_id \n";
continue;
}
$lifeAccount = [
"life_account_id" => $lifeAccountId,
"merchant_id" => $merchantId,
......@@ -92,13 +97,15 @@ class GoodsToInitController extends Cli
$res = ShopService::getIdgenId(substr($shopId, -2), 'goods');
$subShopId = !empty($res[0]) ? $res[0] : '';
$lbs = explode(",", $sub["lbs"]);
if (!empty($sub["lbs"])) {
$lbs = explode(",", $sub["lbs"]);
}
$data["sub_shop_id"] = $subShopId;
$data["life_account_id"] = $lifeAccountId;
$data["shop_id"] = $shopId;
$data["shop_name"] = $sub["shopName"];
$data["longitude"] = $lbs[0];
$data["latitude"] = $lbs[1];
$data["longitude"] = empty($lbs[0]) ? "" : $lbs[0];
$data["latitude"] = empty($lbs[1]) ? "" : $lbs[1];
$data["address"] = $sub["address"];
$data["phone"] = $sub["phone"];
......@@ -133,7 +140,6 @@ class GoodsToInitController extends Cli
*/
private function getLifeAccountIdAndMerchantId($userId)
{
sleep(1);
$url = config('interface', 'merchant.lifeaccount.get_lid_by_uid');
if (empty($url)) {
throw new InterfaceException(['cus' => 0]);
......@@ -179,7 +185,10 @@ class GoodsToInitController extends Cli
$lifeAccountId = $lifeAccountInfo["life_account_id"];
$merchantId = $lifeAccountInfo["merchant_id"];
}
if (empty($lifeAccountId)) {
echo "add goods data, user_id: $userId 没有 life_account_id \n";
continue;
}
$shopInfo = Shop::getRecord(["life_account_id" => $lifeAccountId]);
$shopId = $shopInfo["shop_id"];
......
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