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 public function lists(): array
{ {
return TaskHandlingThreeLevelReview::where($this->searchWhere) return TaskHandlingThreeLevelReview::where($this->searchWhere)
->with(['projectInfo'])
->limit($this->limitOffset, $this->limitLength) ->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc']) ->order(['id' => 'desc'])
->select() ->select()

View File

@ -38,6 +38,7 @@ class TaskHandlingThreeLevelReviewLogic extends BaseLogic
*/ */
public static function add(array $params): bool public static function add(array $params): bool
{ {
Db::startTrans(); Db::startTrans();
try { try {
TaskHandlingThreeLevelReview::create([ TaskHandlingThreeLevelReview::create([
@ -73,10 +74,10 @@ class TaskHandlingThreeLevelReviewLogic extends BaseLogic
'kaigong' => $params['kaigong'], 'kaigong' => $params['kaigong'],
'jungong' => $params['jungong'], 'jungong' => $params['jungong'],
'bz' => $params['bz'], 'bz' => $params['bz'],
'result_file' => $params['result_file'], 'result_file' => json_encode($params['result_file']),
'master_annex' => $params['master_annex'], 'master_annex' => json_encode($params['master_annex']),
'bm_annex' => $params['bm_annex'], 'bm_annex' => json_encode($params['bm_annex']),
'shb_annex' => $params['shb_annex'], 'shb_annex' => json_encode($params['shb_annex'])
]); ]);
Db::commit(); Db::commit();
@ -131,10 +132,10 @@ class TaskHandlingThreeLevelReviewLogic extends BaseLogic
'kaigong' => $params['kaigong'], 'kaigong' => $params['kaigong'],
'jungong' => $params['jungong'], 'jungong' => $params['jungong'],
'bz' => $params['bz'], 'bz' => $params['bz'],
'result_file' => $params['result_file'], 'result_file' => json_encode($params['result_file']),
'master_annex' => $params['master_annex'], 'master_annex' => json_encode($params['master_annex']),
'bm_annex' => $params['bm_annex'], 'bm_annex' => json_encode($params['bm_annex']),
'shb_annex' => $params['shb_annex'], 'shb_annex' => json_encode($params['shb_annex'])
]); ]);
Db::commit(); Db::commit();
@ -169,6 +170,6 @@ class TaskHandlingThreeLevelReviewLogic extends BaseLogic
*/ */
public static function detail($params): array 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 'task_type_id' => $taskType['id'], // 任务类别id
'cost_project_id' => $taskType['cost_project_id'], // 项目id 'cost_project_id' => $taskType['cost_project_id'], // 项目id
'apptime' => $params['apptime'], 'apptime' => $params['apptime'],
'annex' => $params['annex'], 'annex' => json_encode($params['annex']),
]); ]);
// 任务明细 // 任务明细
$taskDetail = $params['task_detail']; $taskDetail = $params['task_detail'];
@ -98,7 +98,7 @@ class TaskAllocationLogic extends BaseLogic
'task_type_id' => $taskType['id'], // 任务类别id 'task_type_id' => $taskType['id'], // 任务类别id
'cost_project_id' => $taskType['cost_project_id'], // 项目id 'cost_project_id' => $taskType['cost_project_id'], // 项目id
'apptime' => $params['apptime'], 'apptime' => $params['apptime'],
'annex' => $params['annex'], 'annex' => json_encode($params['annex']),
]); ]);
Db::commit(); Db::commit();
return true; return true;

View File

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