This commit is contained in:
chenbo 2024-02-29 09:44:29 +08:00
parent ed5032ad9e
commit d6633b6b36
3 changed files with 10 additions and 8 deletions

View File

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

View File

@ -51,8 +51,7 @@ class ApplyWithSealLogic extends BaseLogic
'limit' => $params['limit'],
'depar' => $params['depar'],
'stampman' => $params['stampman'],
'project' => $params['project'],
'principal' => $params['principal'],
'project_id' => $params['project_id'],
'content' => $params['content'],
'loan' => $params['loan'],
'borrow' => $params['borrow'],
@ -96,8 +95,7 @@ class ApplyWithSealLogic extends BaseLogic
'limit' => $params['limit'],
'depar' => $params['depar'],
'stampman' => $params['stampman'],
'project' => $params['project'],
'principal' => $params['principal'],
'project_id' => $params['project_id'],
'content' => $params['content'],
'loan' => $params['loan'],
'borrow' => $params['borrow'],
@ -143,8 +141,8 @@ class ApplyWithSealLogic extends BaseLogic
*/
public static function detail($params): array
{
$data = ApplyWithSeal::findOrEmpty($params['id'])->toArray();
$data['annex'] = json_decode($params['annex'], true);
$data = ApplyWithSeal::with(['projectInfo'])->findOrEmpty($params['id'])->toArray();
$data['annex'] = json_decode($data['annex'], true);
return $data;
}
}

View File

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