This commit is contained in:
chenbo 2024-02-27 14:46:42 +08:00
parent 9b3771af8a
commit c4990ab1c1
4 changed files with 18 additions and 12 deletions

View File

@ -55,6 +55,7 @@ class TaskHandlingThreeLevelReviewLists extends BaseAdminDataLists implements Li
public function lists(): array
{
return TaskHandlingThreeLevelReview::where($this->searchWhere)
->with(['projectInfo'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()

View File

@ -38,6 +38,7 @@ class TaskHandlingThreeLevelReviewLogic extends BaseLogic
*/
public static function add(array $params): bool
{
Db::startTrans();
try {
TaskHandlingThreeLevelReview::create([
@ -73,10 +74,10 @@ class TaskHandlingThreeLevelReviewLogic extends BaseLogic
'kaigong' => $params['kaigong'],
'jungong' => $params['jungong'],
'bz' => $params['bz'],
'result_file' => $params['result_file'],
'master_annex' => $params['master_annex'],
'bm_annex' => $params['bm_annex'],
'shb_annex' => $params['shb_annex'],
'result_file' => json_encode($params['result_file']),
'master_annex' => json_encode($params['master_annex']),
'bm_annex' => json_encode($params['bm_annex']),
'shb_annex' => json_encode($params['shb_annex'])
]);
Db::commit();
@ -131,10 +132,10 @@ class TaskHandlingThreeLevelReviewLogic extends BaseLogic
'kaigong' => $params['kaigong'],
'jungong' => $params['jungong'],
'bz' => $params['bz'],
'result_file' => $params['result_file'],
'master_annex' => $params['master_annex'],
'bm_annex' => $params['bm_annex'],
'shb_annex' => $params['shb_annex'],
'result_file' => json_encode($params['result_file']),
'master_annex' => json_encode($params['master_annex']),
'bm_annex' => json_encode($params['bm_annex']),
'shb_annex' => json_encode($params['shb_annex'])
]);
Db::commit();
@ -169,6 +170,6 @@ class TaskHandlingThreeLevelReviewLogic extends BaseLogic
*/
public static function detail($params): array
{
return TaskHandlingThreeLevelReview::findOrEmpty($params['id'])->toArray();
return TaskHandlingThreeLevelReview::with(['projectInfo'])->findOrEmpty($params['id'])->toArray();
}
}

View File

@ -57,7 +57,7 @@ class TaskAllocationLogic extends BaseLogic
'task_type_id' => $taskType['id'], // 任务类别id
'cost_project_id' => $taskType['cost_project_id'], // 项目id
'apptime' => $params['apptime'],
'annex' => $params['annex'],
'annex' => json_encode($params['annex']),
]);
// 任务明细
$taskDetail = $params['task_detail'];
@ -98,7 +98,7 @@ class TaskAllocationLogic extends BaseLogic
'task_type_id' => $taskType['id'], // 任务类别id
'cost_project_id' => $taskType['cost_project_id'], // 项目id
'apptime' => $params['apptime'],
'annex' => $params['annex'],
'annex' => json_encode($params['annex']),
]);
Db::commit();
return true;

View File

@ -16,6 +16,7 @@ namespace app\common\model;
use app\common\model\BaseModel;
use app\common\model\cost_project\CostProject;
use think\model\concern\SoftDelete;
@ -30,5 +31,8 @@ class TaskHandlingThreeLevelReview extends BaseModel
protected $name = 'task_handling_three_level_review';
protected $deleteTime = 'delete_time';
public function projectInfo()
{
return $this->hasOne(CostProject::class, 'id', 'project_id');
}
}