update
This commit is contained in:
parent
60bc509523
commit
5154e38137
@ -55,7 +55,7 @@ class TaskAllocationLists extends BaseAdminDataLists implements ListsSearchInter
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
return TaskAllocation::where($this->searchWhere)
|
||||
return TaskAllocation::where($this->searchWhere)->with(['taskTypeInfo', 'projectInfo'])
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->select()
|
||||
|
@ -94,7 +94,6 @@ class TaskAllocationLogic extends BaseLogic
|
||||
Db::startTrans();
|
||||
try {
|
||||
TaskAllocation::where('id', $params['id'])->update([
|
||||
'num' => generate_sn(self::class, 'num'),
|
||||
'task_type_id' => $taskType['id'], // 任务类别id
|
||||
'cost_project_id' => $taskType['cost_project_id'], // 项目id
|
||||
'apptime' => $params['apptime'],
|
||||
@ -132,6 +131,6 @@ class TaskAllocationLogic extends BaseLogic
|
||||
*/
|
||||
public static function detail($params): array
|
||||
{
|
||||
return TaskAllocation::findOrEmpty($params['id'])->toArray();
|
||||
return TaskAllocation::findOrEmpty($params['id'])->with(['taskTypeInfo', 'projectInfo'])->toArray();
|
||||
}
|
||||
}
|
@ -16,6 +16,7 @@ namespace app\common\model\task;
|
||||
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use app\common\model\cost_project\CostProject;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
|
||||
@ -30,5 +31,13 @@ class TaskAllocation extends BaseModel
|
||||
protected $name = 'task_allocation';
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
|
||||
public function taskTypeInfo()
|
||||
{
|
||||
return $this->hasOne(TaskType::class, 'id', 'task_type_id');
|
||||
}
|
||||
|
||||
public function projectInfo()
|
||||
{
|
||||
return $this->hasOne(CostProject::class, 'id', 'cost_project_id');
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user