|
...
|
...
|
@@ -10,6 +10,7 @@ |
|
|
|
namespace App\Http\Logic\Aside\Project;
|
|
|
|
|
|
|
|
use App\Http\Logic\Aside\BaseLogic;
|
|
|
|
use App\Models\Project\DeployBuild;
|
|
|
|
use App\Models\Project\Project;
|
|
|
|
use App\Models\Project\ProjectRenew;
|
|
|
|
|
|
...
|
...
|
@@ -32,8 +33,10 @@ class RenewLogic extends BaseLogic |
|
|
|
public function renewListsLog($map,$page,$row,$order,$field = ['*']){
|
|
|
|
$lists = $this->model->lists($map,$page,$row,$order,$field);
|
|
|
|
if(!empty($lists['list'])){
|
|
|
|
$projectModel = new Project();
|
|
|
|
foreach ($lists['list'] as $k => $v){
|
|
|
|
$v['plan'] = Project::planMap()[$v['plan']];
|
|
|
|
$v['project_name'] = $projectModel->getProjectName($v['project_id']);
|
|
|
|
$lists['list'][$k] = $v;
|
|
|
|
}
|
|
|
|
}
|
|
...
|
...
|
@@ -54,4 +57,45 @@ class RenewLogic extends BaseLogic |
|
|
|
}
|
|
|
|
return $this->success($info);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :关联续费单
|
|
|
|
* @name :editProjectRenew
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/9/19 10:21
|
|
|
|
*/
|
|
|
|
public function editProjectRenew(){
|
|
|
|
//获取续费单详情
|
|
|
|
$info = $this->model->read(['id'=>$this->param['renew_id']]);
|
|
|
|
if($info === false){
|
|
|
|
$this->fail('当前续费单不存在');
|
|
|
|
}
|
|
|
|
if($info['project_id'] != 0){
|
|
|
|
$this->fail('当前续费单已关联项目,请重新选择');
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
$this->model->edit(['project_id'=>$this->param['id'],'operator_id'=>$this->manager['id']],['id'=>$this->param['renew_id']]);
|
|
|
|
$project = new Project();
|
|
|
|
$project->edit(['extend_type'=>0],['id'=>$this->param['id']]);
|
|
|
|
$deployBuild = new DeployBuild();
|
|
|
|
$deployBuild->edit(
|
|
|
|
['service_duration'=>DB::raw('service_duration + ' . $info['service_duration']),
|
|
|
|
'plan'=>$info['plan']], ['project_id'=>$this->param['id']]);
|
|
|
|
}catch (\Exception $e){
|
|
|
|
$this->fail('系统错误,请联系管理员');
|
|
|
|
}
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :续费单还原
|
|
|
|
* @name :reductionRenew
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/9/19 10:39
|
|
|
|
*/
|
|
|
|
public function reductionRenew(){
|
|
|
|
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|