update
This commit is contained in:
parent
d1c85499ba
commit
fa330ad525
@ -39,6 +39,7 @@ class ProjectRectificationLists extends BaseAdminDataLists implements ListsSearc
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'=' => ['num', 'project', 'project_num'],
|
'=' => ['num', 'project', 'project_num'],
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,8 +55,8 @@ class ProjectRectificationLists extends BaseAdminDataLists implements ListsSearc
|
|||||||
*/
|
*/
|
||||||
public function lists(): array
|
public function lists(): array
|
||||||
{
|
{
|
||||||
return ProjectRectification::where($this->searchWhere)
|
return ProjectRectification::with(['projectInfo'])
|
||||||
->field(['id', 'dataid', 'num', 'project', 'project_num', 'wt_unit', 'xm_master', 'zx_type', 'zg_master', 'dj_person', 'apptime', 'problem', 'deal_desc'])
|
->where($this->searchWhere)
|
||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
->order(['id' => 'desc'])
|
->order(['id' => 'desc'])
|
||||||
->select()
|
->select()
|
||||||
|
@ -41,10 +41,9 @@ class ProjectRectificationLogic extends BaseLogic
|
|||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
try {
|
try {
|
||||||
ProjectRectification::create([
|
ProjectRectification::create([
|
||||||
'dataid' => $params['dataid'],
|
'dataid' => generate_sn(ProjectRectification::class, 'dataid'),
|
||||||
'num' => $params['num'],
|
'num' => generate_sn(ProjectRectification::class, 'num'),
|
||||||
'project' => $params['project'],
|
'project_id' => $params['project_id'],
|
||||||
'project_num' => $params['project_num'],
|
|
||||||
'wt_unit' => $params['wt_unit'],
|
'wt_unit' => $params['wt_unit'],
|
||||||
'xm_master' => $params['xm_master'],
|
'xm_master' => $params['xm_master'],
|
||||||
'zx_type' => $params['zx_type'],
|
'zx_type' => $params['zx_type'],
|
||||||
@ -79,10 +78,7 @@ class ProjectRectificationLogic extends BaseLogic
|
|||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
try {
|
try {
|
||||||
ProjectRectification::where('id', $params['id'])->update([
|
ProjectRectification::where('id', $params['id'])->update([
|
||||||
'dataid' => $params['dataid'],
|
'project_id' => $params['project_id'],
|
||||||
'num' => $params['num'],
|
|
||||||
'project' => $params['project'],
|
|
||||||
'project_num' => $params['project_num'],
|
|
||||||
'wt_unit' => $params['wt_unit'],
|
'wt_unit' => $params['wt_unit'],
|
||||||
'xm_master' => $params['xm_master'],
|
'xm_master' => $params['xm_master'],
|
||||||
'zx_type' => $params['zx_type'],
|
'zx_type' => $params['zx_type'],
|
||||||
@ -127,6 +123,6 @@ class ProjectRectificationLogic extends BaseLogic
|
|||||||
*/
|
*/
|
||||||
public static function detail($params): array
|
public static function detail($params): array
|
||||||
{
|
{
|
||||||
return ProjectRectification::findOrEmpty($params['id'])->toArray();
|
return ProjectRectification::with(['projectInfo'])->findOrEmpty($params['id'])->toArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -16,6 +16,7 @@ namespace app\common\model\project_process_management;
|
|||||||
|
|
||||||
|
|
||||||
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 ProjectRectification extends BaseModel
|
|||||||
protected $name = 'project_rectification';
|
protected $name = 'project_rectification';
|
||||||
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