Commit c7e7676f authored by hangjun83's avatar hangjun83

更新

parent 264384b7
......@@ -63,6 +63,9 @@ class LeyanJobCommand extends Command
case 'batchUpdateProduct' :
$service->batchUpdateProducts($params);
break;
case 'updateProductEveryDay' :
$service->updateProductsByEveryDay();
break;
case 'updateProductByCas' :
default:
$service->updateProductByCas($params);
......
......@@ -53,8 +53,23 @@ class LeyanApiService extends PlatformAbstractService
}
}
public function pushBatchUpdateProduct($token){
public function pushBatchUpdateProduct($token)
{
try{
if($this->checkPlatformStatus()){
$params = [];
$uri = $this->platformInfo['platform_url'].'/ProductDate/findProductDataPool';
$response = $this->getPostClient($uri,$params,null,[
'token' => $token,
],false);
return $this->apiResponse($response);
}
}catch(\exception $exception){
SimpleLogs::writeLog($exception->getMessage(), __CLASS__.':pushBatchUpdateProduct error', 'error');
return false;
}
}
public function getToken(){
......
......@@ -25,6 +25,19 @@ class LeyanService
$this->apiService = (new LeyanApiService(app(ThirdApiPlatformRepository::class)));
}
public function updateProductsByEveryDay()
{
$result = $this->apiService->pushBatchUpdateProduct($this->getToken());
if(!$result){
return null;
}
try{
$result = $this->storeLeyanProducts($result);
}catch(\Exception $exception){
SimpleLogs::writeLog($exception->getMessage(),__CLASS__.':updateProductsByEveryDay', 'error');
}
}
public function batchUpdateProducts($params = null)
{
ini_set('memory_limit','3072M');
......
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