合并分支 'lyh-server' 到 'master'
Lyh server 查看合并请求 !2116
正在显示
3 个修改的文件
包含
39 行增加
和
22 行删除
| @@ -10,6 +10,7 @@ | @@ -10,6 +10,7 @@ | ||
| 10 | namespace App\Console\Commands\LyhTest; | 10 | namespace App\Console\Commands\LyhTest; |
| 11 | 11 | ||
| 12 | use App\Console\Commands\Domain\DomainInfo; | 12 | use App\Console\Commands\Domain\DomainInfo; |
| 13 | +use App\Helper\OaGlobalsoApi; | ||
| 13 | use App\Http\Logic\Aside\Project\ProjectLogic; | 14 | use App\Http\Logic\Aside\Project\ProjectLogic; |
| 14 | use App\Models\Ai\AiBlog; | 15 | use App\Models\Ai\AiBlog; |
| 15 | use App\Models\Ai\AiBlogAuthor; | 16 | use App\Models\Ai\AiBlogAuthor; |
| @@ -58,18 +59,27 @@ class lyhDemo extends Command | @@ -58,18 +59,27 @@ class lyhDemo extends Command | ||
| 58 | 59 | ||
| 59 | public function handle(){ | 60 | public function handle(){ |
| 60 | $projectModel = new Project(); | 61 | $projectModel = new Project(); |
| 61 | - $lists = $projectModel->list(['delete_status' => 0,'project_type'=>0,'extend_type'=>0,'type'=>['in',[1,2,3,4,6]]], 'id', ['id']); | 62 | + $buildModel = new DeployBuild(); |
| 63 | + $lists = $projectModel->list(['delete_status' => 0,'project_type'=>0,'is_upgrade'=>0,'id'=>['<',1659],'extend_type'=>0,'type'=>['in',[1,2,3,4,6]]], 'id', ['id','notice_order_id']); | ||
| 62 | foreach ($lists as $item){ | 64 | foreach ($lists as $item){ |
| 63 | -// echo date('Y-m-d H:i:s') . '开始--项目的id:'. $item['id'] . PHP_EOL; | ||
| 64 | - ProjectServer::useProject($item['id']); | ||
| 65 | - $webSettingModel = new WebSetting(); | ||
| 66 | - $info = $webSettingModel->read(['project_id'=>$item['id']]); | ||
| 67 | - if($info === false){ | ||
| 68 | - $webSettingModel->addReturnId(['project_id'=>$item['id']]); | ||
| 69 | - echo '当前数据为空:'.$item['id'].PHP_EOL; | 65 | + echo date('Y-m-d H:i:s') . '开始--项目的id:'. $item['id'] . PHP_EOL; |
| 66 | + try { | ||
| 67 | + if(!empty($item['notice_order_id'])){ | ||
| 68 | + $api = new OaGlobalsoApi(); | ||
| 69 | + $data = $api->order_info($item['notice_order_id']); | ||
| 70 | + if(!empty($data)){ | ||
| 71 | + if(isset($data['data']['ads_price'])){ | ||
| 72 | + echo '奖励金额:'.$data['data']['ads_price'].PHP_EOL; | ||
| 73 | + $buildModel->edit(['ads_price'=>$data['data']['ads_price'] ?? 0],['project_id'=>$item['id']]); | ||
| 74 | + } | ||
| 75 | + } | ||
| 76 | + } | ||
| 77 | + }catch (\Exception $e){ | ||
| 78 | + continue; | ||
| 70 | } | 79 | } |
| 71 | DB::disconnect('custom_mysql'); | 80 | DB::disconnect('custom_mysql'); |
| 72 | } | 81 | } |
| 82 | + echo date('Y-m-d H:i:s') . '结束。。。' . PHP_EOL; | ||
| 73 | } | 83 | } |
| 74 | 84 | ||
| 75 | public function _actionTemplateMain(){ | 85 | public function _actionTemplateMain(){ |
| @@ -81,12 +81,14 @@ class RenewLogic extends BaseLogic | @@ -81,12 +81,14 @@ class RenewLogic extends BaseLogic | ||
| 81 | } | 81 | } |
| 82 | DB::beginTransaction(); | 82 | DB::beginTransaction(); |
| 83 | try { | 83 | try { |
| 84 | - $this->model->edit(['project_id'=>$this->param['id'],'operator_id'=>$this->manager['id']],['id'=>$this->param['renew_id']]); | 84 | + if($this->param['renew_id'] != 0){ |
| 85 | + $this->model->edit(['project_id'=>$this->param['id'],'operator_id'=>$this->manager['id']],['id'=>$this->param['renew_id']]); | ||
| 86 | + } | ||
| 85 | $param = $this->param; | 87 | $param = $this->param; |
| 86 | $param['api_no'] = $info['api_no'] ?? 0; | 88 | $param['api_no'] = $info['api_no'] ?? 0; |
| 87 | $this->saveLog($param); | 89 | $this->saveLog($param); |
| 88 | $this->updateProject($this->param['id'],$this->param['type']); | 90 | $this->updateProject($this->param['id'],$this->param['type']); |
| 89 | - $this->updateProjectBuild($this->param['id'],$this->param['service_duration'],$this->param['plan']); | 91 | + $this->updateProjectBuild($this->param['id'],$this->param['service_duration'] ?? 0,$this->param['plan']); |
| 90 | DB::commit(); | 92 | DB::commit(); |
| 91 | }catch (\Exception $e){ | 93 | }catch (\Exception $e){ |
| 92 | DB::rollBack(); | 94 | DB::rollBack(); |
| @@ -120,12 +122,12 @@ class RenewLogic extends BaseLogic | @@ -120,12 +122,12 @@ class RenewLogic extends BaseLogic | ||
| 120 | public function saveLog($param){ | 122 | public function saveLog($param){ |
| 121 | $data = [ | 123 | $data = [ |
| 122 | 'renew_id'=>$param['renew_id'], | 124 | 'renew_id'=>$param['renew_id'], |
| 123 | - 'service_duration'=>$param['service_duration'], | 125 | + 'service_duration'=>$param['service_duration'] ?? 0, |
| 124 | 'plan'=>$param['plan'], | 126 | 'plan'=>$param['plan'], |
| 125 | 'old_plan'=>$param['old_plan'], | 127 | 'old_plan'=>$param['old_plan'], |
| 126 | 'type'=>$param['type'], | 128 | 'type'=>$param['type'], |
| 127 | 'old_type'=>$param['old_type'], | 129 | 'old_type'=>$param['old_type'], |
| 128 | - 'amount'=>$param['amount'], | 130 | + 'amount'=>$param['amount'] ?? 0, |
| 129 | 'api_no'=>$param['api_no'], | 131 | 'api_no'=>$param['api_no'], |
| 130 | 'project_id'=>$param['id'], | 132 | 'project_id'=>$param['id'], |
| 131 | 'operator_id'=>$this->manager['id'], | 133 | 'operator_id'=>$this->manager['id'], |
| @@ -356,17 +356,22 @@ class KeywordLogic extends BaseLogic | @@ -356,17 +356,22 @@ class KeywordLogic extends BaseLogic | ||
| 356 | * @time :2025/6/9 14:29 | 356 | * @time :2025/6/9 14:29 |
| 357 | */ | 357 | */ |
| 358 | public function saveComment(){ | 358 | public function saveComment(){ |
| 359 | - $param = [ | ||
| 360 | - 'nickname' => $this->param['nickname'], | ||
| 361 | - 'text' => $this->param['text'], | ||
| 362 | - 'project_id' => $this->user['project_id'], | ||
| 363 | - 'type' => 1, | ||
| 364 | - 'uid' => 0, | ||
| 365 | - 'created_at' => date('Y-m-d H:i:s'), | ||
| 366 | - 'updated_at' => date('Y-m-d H:i:s') | ||
| 367 | - ]; | ||
| 368 | $keywordCommonModel = new AggregateKeywordComment(); | 359 | $keywordCommonModel = new AggregateKeywordComment(); |
| 369 | - $id = $keywordCommonModel->addReturnId($param); | 360 | + if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 361 | + $id = $this->param['id']; | ||
| 362 | + $keywordCommonModel->edit($this->param,['id'=>$this->param['id']]); | ||
| 363 | + }else{ | ||
| 364 | + $param = [ | ||
| 365 | + 'nickname' => $this->param['nickname'], | ||
| 366 | + 'text' => $this->param['text'], | ||
| 367 | + 'project_id' => $this->user['project_id'], | ||
| 368 | + 'type' => 1, | ||
| 369 | + 'uid' => 0, | ||
| 370 | + 'created_at' => date('Y-m-d H:i:s'), | ||
| 371 | + 'updated_at' => date('Y-m-d H:i:s') | ||
| 372 | + ]; | ||
| 373 | + $id = $keywordCommonModel->addReturnId($param); | ||
| 374 | + } | ||
| 370 | return $this->success(['id'=>$id]); | 375 | return $this->success(['id'=>$id]); |
| 371 | } | 376 | } |
| 372 | 377 |
-
请 注册 或 登录 后发表评论