作者 lyh

gx

... ... @@ -190,9 +190,13 @@ class SyncProject extends Command
$this->setPostId($data['deploy_build']['plan'],$id);
@file_put_contents(storage_path('logs/lyh_error.log'), var_export(222, true) . PHP_EOL, FILE_APPEND);
$this->savePayment($data['payment'],$id);
@file_put_contents(storage_path('logs/lyh_error.log'), var_export(444, true) . PHP_EOL, FILE_APPEND);
$this->saveDeployBuild($data['deploy_build'],$id);
@file_put_contents(storage_path('logs/lyh_error.log'), var_export(555, true) . PHP_EOL, FILE_APPEND);
$this->saveDeployOptimize($data['deploy_optimize'],$id);
@file_put_contents(storage_path('logs/lyh_error.log'), var_export(666, true) . PHP_EOL, FILE_APPEND);
$this->saveAfter($data['project_after'],$id);
@file_put_contents(storage_path('logs/lyh_error.log'), var_export(777, true) . PHP_EOL, FILE_APPEND);
DB::commit();
}catch (\Exception $e){
DB::rollBack();
... ... @@ -208,12 +212,10 @@ class SyncProject extends Command
* @time :2023/8/9 14:47
*/
public function setPostId($plan,$id){
@file_put_contents(storage_path('logs/lyh_error.log'), var_export(333, true) . PHP_EOL, FILE_APPEND);
$length = strlen((string)$id); // 获取变量的位数
$paddingLength = Project::TYPE_FIVE - $length; // 计算填充前面的 0 的位数
$zeros = str_repeat("0", $paddingLength);
$number = Project::TYPE_SIX.$plan.$zeros.$id;
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($number, true) . PHP_EOL, FILE_APPEND);
$projectModel = new Project();
$projectModel->edit(['post_id'=>$number],['id'=>$id]);
return true;
... ...