This commit is contained in:
chenbo 2024-02-27 15:25:11 +08:00
parent 59239952d1
commit d7652ed93d
3 changed files with 86 additions and 85 deletions

View File

@ -39,6 +39,7 @@ class ApprovalIssuanceAchievementDocumentsLists extends BaseAdminDataLists imple
{
return [
'=' => ['project', 'project_num'],
];
}
@ -55,7 +56,7 @@ class ApprovalIssuanceAchievementDocumentsLists extends BaseAdminDataLists imple
public function lists(): array
{
return ApprovalIssuanceAchievementDocuments::where($this->searchWhere)
->field(['id', 'dataid', 'num', 'project', 'project_num', 'task', 'processes', 'number', 'apptime', 'person', 'tips', 'fd_1', 'fd_2', 'fd_3'])
->with(['projectInfo'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()

View File

@ -41,10 +41,9 @@ class ApprovalIssuanceAchievementDocumentsLogic extends BaseLogic
Db::startTrans();
try {
ApprovalIssuanceAchievementDocuments::create([
'dataid' => $params['dataid'],
'num' => $params['num'],
'project' => $params['project'],
'project_num' => $params['project_num'],
'dataid' => generate_sn(ApprovalIssuanceAchievementDocuments::class, 'dataid'),
'num' => generate_sn(ApprovalIssuanceAchievementDocuments::class, 'num'),
'project_id' => $params['project'],
'task' => $params['task'],
'processes' => $params['processes'],
'number' => $params['number'],
@ -78,10 +77,7 @@ class ApprovalIssuanceAchievementDocumentsLogic extends BaseLogic
Db::startTrans();
try {
ApprovalIssuanceAchievementDocuments::where('id', $params['id'])->update([
'dataid' => $params['dataid'],
'num' => $params['num'],
'project' => $params['project'],
'project_num' => $params['project_num'],
'project_id' => $params['project'],
'task' => $params['task'],
'processes' => $params['processes'],
'number' => $params['number'],

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 ApprovalIssuanceAchievementDocuments extends BaseModel
protected $name = 'approval_issuance_achievement_documents';
protected $deleteTime = 'delete_time';
public function projectInfo()
{
return $this->hasOne(CostProject::class, 'id', 'project_id');
}
}