Commit 11696ef8 by 杨树贤

回调

parent 62204f8f
...@@ -152,11 +152,21 @@ class SyncSupplierService ...@@ -152,11 +152,21 @@ class SyncSupplierService
$groupCode = array_get($syncResult, 'group_code'); $groupCode = array_get($syncResult, 'group_code');
$sourceSn = array_get($syncResult, 'source_sn'); $sourceSn = array_get($syncResult, 'source_sn');
$supplierId = $sourceSn; $supplierId = $sourceSn;
return SupplierChannelModel::where('supplier_id', $supplierId) if ($supplierId) {
->update([ return SupplierChannelModel::where('supplier_id', $supplierId)
'sync_united_status' => SupplierChannelModel::SYNC_UNITED_STATUS_OK, ->update([
'group_code' => $groupCode, 'sync_united_status' => SupplierChannelModel::SYNC_UNITED_STATUS_OK,
'company_nature' => $syncResult['company_nature'], 'group_code' => $groupCode,
]); 'company_nature' => $syncResult['company_nature'],
]);
}else{
return SupplierChannelModel::where('group_code', $groupCode)
->update([
'sync_united_status' => SupplierChannelModel::SYNC_UNITED_STATUS_OK,
'group_code' => $groupCode,
'company_nature' => $syncResult['company_nature'],
]);
}
} }
} }
\ No newline at end of file
...@@ -60,5 +60,6 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function () ...@@ -60,5 +60,6 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
}); });
Route::match(['get', 'post'], '/test', function () { Route::match(['get', 'post'], '/test', function () {
(new \App\Http\Services\SyncSupplierService())->syncSupplierToUnited(12421); $resut = json_decode('{"group_code":"G000010","source_sn":0,"company_name":"深圳大事件科技有限公司","init_nature":"原厂","company_nature":"方案商","company_type":2}',true);
dd((new \App\Http\Services\SyncSupplierService())->syncSupplierToUnitedResult($resut));
}); });
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 sign in to comment