update
This commit is contained in:
parent
4d9b87eeab
commit
4e7f893f1d
app
@ -56,6 +56,7 @@ class DataReceptionLists extends BaseAdminDataLists implements ListsSearchInterf
|
|||||||
public function lists(): array
|
public function lists(): array
|
||||||
{
|
{
|
||||||
return DataReception::where($this->searchWhere)
|
return DataReception::where($this->searchWhere)
|
||||||
|
->with(['projectInfo'])
|
||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
->order(['id' => 'desc'])
|
->order(['id' => 'desc'])
|
||||||
->select()
|
->select()
|
||||||
|
@ -49,13 +49,13 @@ class DataReceptionLogic extends BaseLogic
|
|||||||
'number' => $params['number'],
|
'number' => $params['number'],
|
||||||
'position' => $params['position'],
|
'position' => $params['position'],
|
||||||
'tips' => $params['tips'],
|
'tips' => $params['tips'],
|
||||||
'bidding_file' => $params['bidding_file'],
|
'bidding_file' => json_encode($params['bidding_file']),
|
||||||
'zbkzj_file' => $params['zbkzj_file'],
|
'zbkzj_file' => json_encode($params['zbkzj_file']),
|
||||||
'gczjht_file' => $params['gczjht_file'],
|
'gczjht_file' => json_encode($params['gczjht_file']),
|
||||||
'xmbgqzzl_file' => $params['xmbgqzzl_file'],
|
'xmbgqzzl_file' => json_encode($params['xmbgqzzl_file']),
|
||||||
'ssgsysjs_file' => $params['ssgsysjs_file'],
|
'ssgsysjs_file' => json_encode($params['ssgsysjs_file']),
|
||||||
'wlhj_file' => $params['wlhj_file'],
|
'wlhj_file' => json_encode($params['wlhj_file']),
|
||||||
'other_file' => $params['other_file'],
|
'other_file' => json_encode($params['other_file']),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Db::commit();
|
Db::commit();
|
||||||
@ -80,10 +80,7 @@ class DataReceptionLogic extends BaseLogic
|
|||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
try {
|
try {
|
||||||
DataReception::where('id', $params['id'])->update([
|
DataReception::where('id', $params['id'])->update([
|
||||||
'dataid' => $params['dataid'],
|
'project_id' => $params['project_id'],
|
||||||
'num' => $params['num'],
|
|
||||||
'project' => $params['project'],
|
|
||||||
'project_num' => $params['project_num'],
|
|
||||||
'apptime' => $params['apptime'],
|
'apptime' => $params['apptime'],
|
||||||
'person' => $params['person'],
|
'person' => $params['person'],
|
||||||
'number' => $params['number'],
|
'number' => $params['number'],
|
||||||
@ -130,6 +127,14 @@ class DataReceptionLogic extends BaseLogic
|
|||||||
*/
|
*/
|
||||||
public static function detail($params): array
|
public static function detail($params): array
|
||||||
{
|
{
|
||||||
return DataReception::findOrEmpty($params['id'])->toArray();
|
$data = DataReception::with(['projectInfo'])->findOrEmpty($params['id'])->toArray();
|
||||||
|
$data['bidding_file'] = json_decode($data['bidding_file'], true);
|
||||||
|
$data['zbkzj_file'] = json_encode($data['zbkzj_file'], true);
|
||||||
|
$data['gczjht_file'] = json_encode($data['gczjht_file'], true);
|
||||||
|
$data['xmbgqzzl_file'] = json_encode($data['xmbgqzzl_file'], true);
|
||||||
|
$data['ssgsysjs_file'] = json_encode($data['ssgsysjs_file'], true);
|
||||||
|
$data['wlhj_file'] = json_encode($data['wlhj_file'], true);
|
||||||
|
$data['other_file'] = json_encode($data['other_file'], true);
|
||||||
|
return $data;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -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 DataReception extends BaseModel
|
|||||||
protected $name = 'data_reception';
|
protected $name = 'data_reception';
|
||||||
protected $deleteTime = 'delete_time';
|
protected $deleteTime = 'delete_time';
|
||||||
|
|
||||||
|
public function projectInfo()
|
||||||
|
{
|
||||||
|
return $this->hasOne(CostProject::class, 'id', 'project_id');
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user