作者 lyh

Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into develop

@@ -16,6 +16,7 @@ use App\Models\Project\ProjectRenew; @@ -16,6 +16,7 @@ use App\Models\Project\ProjectRenew;
16 use App\Utils\LogUtils; 16 use App\Utils\LogUtils;
17 use Hashids\Hashids; 17 use Hashids\Hashids;
18 use Illuminate\Console\Command; 18 use Illuminate\Console\Command;
  19 +use Illuminate\Database\Eloquent\Model;
19 use Illuminate\Support\Facades\DB; 20 use Illuminate\Support\Facades\DB;
20 use Illuminate\Support\Facades\Http; 21 use Illuminate\Support\Facades\Http;
21 22
@@ -237,8 +238,14 @@ class SyncProject extends Command @@ -237,8 +238,14 @@ class SyncProject extends Command
237 if(isset($param['channel']) && !empty($param['channel'])){ 238 if(isset($param['channel']) && !empty($param['channel'])){
238 $param['channel'] = Arr::a2s($param['channel']); 239 $param['channel'] = Arr::a2s($param['channel']);
239 } 240 }
240 - $projectModel = new Project();  
241 - return $projectModel->addReturnId($param); 241 + $projectModel = Project::where('from_order_id', $param['from_order_id'])->first();
  242 + if($projectModel){
  243 + $projectModel->edit($param, ['from_order_id' => $param['from_order_id']]);
  244 + return $projectModel->id;
  245 + }else{
  246 + $projectModel = new Project();
  247 + return $projectModel->addReturnId($param);
  248 + }
242 } 249 }
243 250
244 /** 251 /**
@@ -342,7 +349,7 @@ class SyncProject extends Command @@ -342,7 +349,7 @@ class SyncProject extends Command
342 * @date 2023/9/1 349 * @date 2023/9/1
343 */ 350 */
344 protected function toHagro($data){ 351 protected function toHagro($data){
345 - $url = 'https://beta.hagro.cn/globalso/create_project'; 352 + $url = 'https://admin.hagro.cn/globalso/create_project';
346 $param = [ 353 $param = [
347 'company' => $data['company_name'], 354 'company' => $data['company_name'],
348 'phone' => $data['principal_mobile'], 355 'phone' => $data['principal_mobile'],