update
This commit is contained in:
parent
d1c85499ba
commit
fa330ad525
@ -1,77 +1,78 @@
|
|||||||
<?php
|
<?php
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||||
// | 开源版本可自由商用,可去除界面版权logo
|
// | 开源版本可自由商用,可去除界面版权logo
|
||||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||||
// | 访问官网:https://www.likeadmin.cn
|
// | 访问官网:https://www.likeadmin.cn
|
||||||
// | likeadmin团队 版权所有 拥有最终解释权
|
// | likeadmin团队 版权所有 拥有最终解释权
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | author: likeadminTeam
|
// | author: likeadminTeam
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
namespace app\adminapi\lists\project_process_management;
|
namespace app\adminapi\lists\project_process_management;
|
||||||
|
|
||||||
|
|
||||||
use app\adminapi\lists\BaseAdminDataLists;
|
use app\adminapi\lists\BaseAdminDataLists;
|
||||||
use app\common\model\project_process_management\ProjectRectification;
|
use app\common\model\project_process_management\ProjectRectification;
|
||||||
use app\common\lists\ListsSearchInterface;
|
use app\common\lists\ListsSearchInterface;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ProjectRectification列表
|
* ProjectRectification列表
|
||||||
* Class ProjectRectificationLists
|
* Class ProjectRectificationLists
|
||||||
* @package app\adminapi\listsproject_process_management
|
* @package app\adminapi\listsproject_process_management
|
||||||
*/
|
*/
|
||||||
class ProjectRectificationLists extends BaseAdminDataLists implements ListsSearchInterface
|
class ProjectRectificationLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @notes 设置搜索条件
|
* @notes 设置搜索条件
|
||||||
* @return \string[][]
|
* @return \string[][]
|
||||||
* @author likeadmin
|
* @author likeadmin
|
||||||
* @date 2024/02/23 11:22
|
* @date 2024/02/23 11:22
|
||||||
*/
|
*/
|
||||||
public function setSearch(): array
|
public function setSearch(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'=' => ['num', 'project', 'project_num'],
|
'=' => ['num', 'project', 'project_num'],
|
||||||
];
|
|
||||||
}
|
];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @notes 获取列表
|
/**
|
||||||
* @return array
|
* @notes 获取列表
|
||||||
* @throws \think\db\exception\DataNotFoundException
|
* @return array
|
||||||
* @throws \think\db\exception\DbException
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
* @throws \think\db\exception\ModelNotFoundException
|
* @throws \think\db\exception\DbException
|
||||||
* @author likeadmin
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
* @date 2024/02/23 11:22
|
* @author likeadmin
|
||||||
*/
|
* @date 2024/02/23 11:22
|
||||||
public function lists(): array
|
*/
|
||||||
{
|
public function lists(): array
|
||||||
return ProjectRectification::where($this->searchWhere)
|
{
|
||||||
->field(['id', 'dataid', 'num', 'project', 'project_num', 'wt_unit', 'xm_master', 'zx_type', 'zg_master', 'dj_person', 'apptime', 'problem', 'deal_desc'])
|
return ProjectRectification::with(['projectInfo'])
|
||||||
->limit($this->limitOffset, $this->limitLength)
|
->where($this->searchWhere)
|
||||||
->order(['id' => 'desc'])
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
->select()
|
->order(['id' => 'desc'])
|
||||||
->toArray();
|
->select()
|
||||||
}
|
->toArray();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @notes 获取数量
|
/**
|
||||||
* @return int
|
* @notes 获取数量
|
||||||
* @author likeadmin
|
* @return int
|
||||||
* @date 2024/02/23 11:22
|
* @author likeadmin
|
||||||
*/
|
* @date 2024/02/23 11:22
|
||||||
public function count(): int
|
*/
|
||||||
{
|
public function count(): int
|
||||||
return ProjectRectification::where($this->searchWhere)->count();
|
{
|
||||||
}
|
return ProjectRectification::where($this->searchWhere)->count();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -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