'08-2278-ae1q-9999', // 'goodsId' => '982012220836', // 'resourceContents' => [ // [ // 'content' => 'aaa', // 'sort' => 1 // ] // ] // ]; // $result = ZopOrderService::resourceUpload($params); // dd($result); // $sum = 0; // $codes = ZopOrderService::PROVINCE_CODE; // // $code = 17; // foreach ($codes as $code => $name) { // $params = [ // 'provinceCode' => $code // ]; // $result = ZopOrderService::postInfo($params); // if ($result['code'] == 0) { // $data = $result['data']; // foreach ($data as $val) { // $val['code'] = $code; // AreaApi::create($val); // } // } // } // $provinces = Area::where('level', 1)->select(); // $failIds = []; // foreach ($provinces as $province) { // $shortName = $province->shortname ?? ''; // if (empty($shortName)) { // $failIds[] = $province->id; // continue; // } // // 查询省份对应的code // $areaApi = AreaApi::where('postProvinceName', $shortName)->find(); // if (empty($areaApi)) { // $failIds[] = $province->id; // continue; // } // $province->post_code = $areaApi->postProvinceCode; // $province->num_code = $areaApi->numProvinceCode; // $province->save(); // } // dd($failIds); // $cities = Area::where('level', 2)->select(); // $failIds = []; // foreach ($cities as $city) { // $shortName = $city->shortname ?? ''; // $pid = $city->pid ?? 0; // if (empty($shortName)) { // $failIds[] = $city->id; // continue; // } // $province = Area::where('id', $pid)->find(); // if (empty($province)) { // $failIds[] = $city->id; // continue; // } // $postProvinceCode = $province->post_code ?? ''; // // 查询省份对应的code // $areaApi = AreaApi::where([ // 'postProvinceCode' => $postProvinceCode, // 'postCityName' => ['like', $shortName . '%'] // ])->find(); // if (empty($areaApi)) { // $failIds[] = $city->id; // continue; // } // $city->post_code = $areaApi->postCityCode; // $city->num_code = $areaApi->numCityCode; // $city->save(); // } // $districts = Area::where('level', 3)->select(); // $failIds = []; // foreach ($districts as $district) { // $shortName = $district->shortname ?? ''; // $pid = $district->pid ?? 0; // if (empty($shortName)) { // $failIds[] = $district->id; // continue; // } // $city = Area::where('id', $pid)->find(); // if (empty($city)) { // $failIds[] = $district->id; // continue; // } // $postCityCode = $city->post_code ?? ''; // // 查询省份对应的code // $areaApi = AreaApi::where([ // 'postCityCode' => $postCityCode, // 'postDistrictName' => ['like', $shortName . '%'] // ])->find(); // if (empty($areaApi)) { // $failIds[] = $district->id; // continue; // } // $district->post_code = $areaApi->postDistrictCode; // $district->save(); // } // dd($failIds); } }