新增危大工程消除列表模块
This commit is contained in:
parent
d714653d2c
commit
e0824e7594
@ -0,0 +1,108 @@
|
|||||||
|
<?php
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||||
|
// | 开源版本可自由商用,可去除界面版权logo
|
||||||
|
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||||
|
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||||
|
// | 访问官网:https://www.likeadmin.cn
|
||||||
|
// | likeadmin团队 版权所有 拥有最终解释权
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | author: likeadminTeam
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
namespace app\adminapi\controller\supervision_dangerous;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\adminapi\lists\supervision_dangerous\SupervisionDangerousEngineeringEliminateLists;
|
||||||
|
use app\adminapi\logic\supervision_dangerous\SupervisionDangerousEngineeringEliminateLogic;
|
||||||
|
use app\adminapi\validate\supervision_dangerous\SupervisionDangerousEngineeringEliminateValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程监理--危大工程消除列表控制器
|
||||||
|
* Class SupervisionDangerousEngineeringEliminateController
|
||||||
|
* @package app\adminapi\controller\supervision_dangerous
|
||||||
|
*/
|
||||||
|
class SupervisionDangerousEngineeringEliminateController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取工程监理--危大工程消除列表列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/03/04 15:31
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new SupervisionDangerousEngineeringEliminateLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加工程监理--危大工程消除列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/03/04 15:31
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$params = (new SupervisionDangerousEngineeringEliminateValidate())->post()->goCheck('add');
|
||||||
|
$result = SupervisionDangerousEngineeringEliminateLogic::add($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('添加成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(SupervisionDangerousEngineeringEliminateLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑工程监理--危大工程消除列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/03/04 15:31
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$params = (new SupervisionDangerousEngineeringEliminateValidate())->post()->goCheck('edit');
|
||||||
|
$result = SupervisionDangerousEngineeringEliminateLogic::edit($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('编辑成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(SupervisionDangerousEngineeringEliminateLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除工程监理--危大工程消除列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/03/04 15:31
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new SupervisionDangerousEngineeringEliminateValidate())->post()->goCheck('delete');
|
||||||
|
SupervisionDangerousEngineeringEliminateLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取工程监理--危大工程消除列表详情
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/03/04 15:31
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
$params = (new SupervisionDangerousEngineeringEliminateValidate())->goCheck('detail');
|
||||||
|
$result = SupervisionDangerousEngineeringEliminateLogic::detail($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,87 @@
|
|||||||
|
<?php
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||||
|
// | 开源版本可自由商用,可去除界面版权logo
|
||||||
|
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||||
|
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||||
|
// | 访问官网:https://www.likeadmin.cn
|
||||||
|
// | likeadmin团队 版权所有 拥有最终解释权
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | author: likeadminTeam
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace app\adminapi\lists\supervision_dangerous;
|
||||||
|
|
||||||
|
|
||||||
|
use app\adminapi\lists\BaseAdminDataLists;
|
||||||
|
use app\common\model\supervision_dangerous\SupervisionDangerousEngineeringEliminate;
|
||||||
|
use app\common\lists\ListsSearchInterface;
|
||||||
|
use app\common\model\supervision_dangerous\SupervisionDangerousEngineeringMonitoring;
|
||||||
|
use app\common\model\supervision_project\SupervisionProject;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程监理--危大工程消除列表列表
|
||||||
|
* Class SupervisionDangerousEngineeringEliminateLists
|
||||||
|
* @package app\adminapi\listssupervision_dangerous
|
||||||
|
*/
|
||||||
|
class SupervisionDangerousEngineeringEliminateLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 设置搜索条件
|
||||||
|
* @return \string[][]
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/03/04 15:31
|
||||||
|
*/
|
||||||
|
public function setSearch(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'=' => ['dangerous_engineering_monitoring_id'],
|
||||||
|
'%like%' => ['eliminate_user', 'notice_user'],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取工程监理--危大工程消除列表列表
|
||||||
|
* @return array
|
||||||
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/03/04 15:31
|
||||||
|
*/
|
||||||
|
public function lists(): array
|
||||||
|
{
|
||||||
|
return SupervisionDangerousEngineeringEliminate::where($this->searchWhere)
|
||||||
|
->field(['id', 'dangerous_engineering_monitoring_id', 'eliminate_date', 'eliminate_user', 'is_notice'])
|
||||||
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
|
->order(['id' => 'desc'])
|
||||||
|
->select()->each(function($data){
|
||||||
|
$dangerous_engineering_monitoring = SupervisionDangerousEngineeringMonitoring::field('project_id,position')->where('id',$data['dangerous_engineering_monitoring_id'])->findOrEmpty();
|
||||||
|
$project = SupervisionProject::field('project_name')->where('id',$dangerous_engineering_monitoring['project_id'])->findOrEmpty();
|
||||||
|
$data['project_name'] = $project['project_name'];
|
||||||
|
$data['position'] = $dangerous_engineering_monitoring['position'];
|
||||||
|
$data['is_notice_text'] = $data->is_notice_text;
|
||||||
|
$data['dangerous_engineering_monitoring_title'] = $project['project_name'];
|
||||||
|
})
|
||||||
|
->toArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取工程监理--危大工程消除列表数量
|
||||||
|
* @return int
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/03/04 15:31
|
||||||
|
*/
|
||||||
|
public function count(): int
|
||||||
|
{
|
||||||
|
return SupervisionDangerousEngineeringEliminate::where($this->searchWhere)->count();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -41,11 +41,6 @@ class SupervisionDangerousEngineeringCaseLogic extends BaseLogic
|
|||||||
*/
|
*/
|
||||||
public static function add(array $params,$admin_id): bool
|
public static function add(array $params,$admin_id): bool
|
||||||
{
|
{
|
||||||
$dangerous_engineering_monitoring = SupervisionDangerousEngineeringMonitoring::where('id',$params['dangerous_engineering_monitoring_id'])->findOrEmpty();
|
|
||||||
if($dangerous_engineering_monitoring['status'] != 0){
|
|
||||||
self::setError('当前危大工程监控信息已提交方案');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
try {
|
try {
|
||||||
SupervisionDangerousEngineeringCase::create([
|
SupervisionDangerousEngineeringCase::create([
|
||||||
@ -57,10 +52,6 @@ class SupervisionDangerousEngineeringCaseLogic extends BaseLogic
|
|||||||
'annex' => $params['annex'] ? json_encode($params['annex']) : null,
|
'annex' => $params['annex'] ? json_encode($params['annex']) : null,
|
||||||
'create_user' => $admin_id
|
'create_user' => $admin_id
|
||||||
]);
|
]);
|
||||||
SupervisionDangerousEngineeringMonitoring::where('id',$params['dangerous_engineering_monitoring_id'])->update([
|
|
||||||
'status' => 1,
|
|
||||||
'update_time' => time()
|
|
||||||
]);
|
|
||||||
Db::commit();
|
Db::commit();
|
||||||
return true;
|
return true;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
@ -83,6 +74,7 @@ class SupervisionDangerousEngineeringCaseLogic extends BaseLogic
|
|||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
try {
|
try {
|
||||||
SupervisionDangerousEngineeringCase::where('id', $params['id'])->update([
|
SupervisionDangerousEngineeringCase::where('id', $params['id'])->update([
|
||||||
|
'dangerous_engineering_monitoring_id' => $params['dangerous_engineering_monitoring_id'],
|
||||||
'case_name' => $params['case_name'],
|
'case_name' => $params['case_name'],
|
||||||
'assessor' => $params['assessor'],
|
'assessor' => $params['assessor'],
|
||||||
'review_content' => $params['review_content'],
|
'review_content' => $params['review_content'],
|
||||||
|
@ -0,0 +1,127 @@
|
|||||||
|
<?php
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||||
|
// | 开源版本可自由商用,可去除界面版权logo
|
||||||
|
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||||
|
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||||
|
// | 访问官网:https://www.likeadmin.cn
|
||||||
|
// | likeadmin团队 版权所有 拥有最终解释权
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | author: likeadminTeam
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace app\adminapi\logic\supervision_dangerous;
|
||||||
|
|
||||||
|
|
||||||
|
use app\common\model\supervision_dangerous\SupervisionDangerousEngineeringEliminate;
|
||||||
|
use app\common\logic\BaseLogic;
|
||||||
|
use app\common\model\supervision_dangerous\SupervisionDangerousEngineeringMonitoring;
|
||||||
|
use app\common\model\supervision_project\SupervisionProject;
|
||||||
|
use think\facade\Db;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程监理--危大工程消除列表逻辑
|
||||||
|
* Class SupervisionDangerousEngineeringEliminateLogic
|
||||||
|
* @package app\adminapi\logic\supervision_dangerous
|
||||||
|
*/
|
||||||
|
class SupervisionDangerousEngineeringEliminateLogic extends BaseLogic
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加工程监理--危大工程消除列表
|
||||||
|
* @param array $params
|
||||||
|
* @return bool
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/03/04 15:31
|
||||||
|
*/
|
||||||
|
public static function add(array $params): bool
|
||||||
|
{
|
||||||
|
Db::startTrans();
|
||||||
|
try {
|
||||||
|
SupervisionDangerousEngineeringEliminate::create([
|
||||||
|
'dangerous_engineering_monitoring_id' => $params['dangerous_engineering_monitoring_id'],
|
||||||
|
'eliminate_date' => !empty($params['eliminate_date']) ? strtotime($params['eliminate_date']) : 0,
|
||||||
|
'eliminate_user' => $params['eliminate_user'],
|
||||||
|
'is_notice' => $params['is_notice'],
|
||||||
|
'notice_user' => $params['notice_user']
|
||||||
|
]);
|
||||||
|
Db::commit();
|
||||||
|
return true;
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
Db::rollback();
|
||||||
|
self::setError($e->getMessage());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑工程监理--危大工程消除列表
|
||||||
|
* @param array $params
|
||||||
|
* @return bool
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/03/04 15:31
|
||||||
|
*/
|
||||||
|
public static function edit(array $params): bool
|
||||||
|
{
|
||||||
|
Db::startTrans();
|
||||||
|
try {
|
||||||
|
SupervisionDangerousEngineeringEliminate::where('id', $params['id'])->update([
|
||||||
|
'dangerous_engineering_monitoring_id' => $params['dangerous_engineering_monitoring_id'],
|
||||||
|
'eliminate_date' => !empty($params['eliminate_date']) ? strtotime($params['eliminate_date']) : 0,
|
||||||
|
'eliminate_user' => $params['eliminate_user'],
|
||||||
|
'is_notice' => $params['is_notice'],
|
||||||
|
'notice_user' => $params['notice_user'],
|
||||||
|
'update_time' => time()
|
||||||
|
]);
|
||||||
|
Db::commit();
|
||||||
|
return true;
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
Db::rollback();
|
||||||
|
self::setError($e->getMessage());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除工程监理--危大工程消除列表
|
||||||
|
* @param array $params
|
||||||
|
* @return bool
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/03/04 15:31
|
||||||
|
*/
|
||||||
|
public static function delete(array $params): bool
|
||||||
|
{
|
||||||
|
return SupervisionDangerousEngineeringEliminate::destroy($params['id']);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取工程监理--危大工程消除列表详情
|
||||||
|
* @param $params
|
||||||
|
* @return array
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/03/04 15:31
|
||||||
|
*/
|
||||||
|
public static function detail($params): array
|
||||||
|
{
|
||||||
|
$data = SupervisionDangerousEngineeringEliminate::withoutField('create_time,update_time,delete_time')->findOrEmpty($params['id']);
|
||||||
|
$dangerous_engineering_monitoring = SupervisionDangerousEngineeringMonitoring::field('project_id,type,partial_project,planned_construction_time,position,project_characteristics,supervisor,responsible_person')->where('id',$data['dangerous_engineering_monitoring_id'])->findOrEmpty();
|
||||||
|
$project = SupervisionProject::field('project_name')->where('id',$dangerous_engineering_monitoring['project_id'])->findOrEmpty();
|
||||||
|
$data['project_name'] = $project['project_name'];
|
||||||
|
$data['type'] = $dangerous_engineering_monitoring->type_text;
|
||||||
|
$data['partial_project'] = $dangerous_engineering_monitoring->partial_project_text;
|
||||||
|
$data['planned_construction_time'] = $dangerous_engineering_monitoring['planned_construction_time'];
|
||||||
|
$data['position'] = $dangerous_engineering_monitoring['position'];
|
||||||
|
$data['project_characteristics'] = $dangerous_engineering_monitoring['project_characteristics'];
|
||||||
|
$data['supervisor'] = $dangerous_engineering_monitoring['supervisor'];
|
||||||
|
$data['responsible_person'] = $dangerous_engineering_monitoring['responsible_person'];
|
||||||
|
$data['is_notice_text'] = $data->is_notice_text;
|
||||||
|
return $data->toArray();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,121 @@
|
|||||||
|
<?php
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||||
|
// | 开源版本可自由商用,可去除界面版权logo
|
||||||
|
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||||
|
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||||
|
// | 访问官网:https://www.likeadmin.cn
|
||||||
|
// | likeadmin团队 版权所有 拥有最终解释权
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | author: likeadminTeam
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace app\adminapi\validate\supervision_dangerous;
|
||||||
|
|
||||||
|
|
||||||
|
use app\common\model\supervision_dangerous\SupervisionDangerousEngineeringEliminate;
|
||||||
|
use app\common\model\supervision_dangerous\SupervisionDangerousEngineeringMonitoring;
|
||||||
|
use app\common\validate\BaseValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程监理--危大工程消除列表验证器
|
||||||
|
* Class SupervisionDangerousEngineeringEliminateValidate
|
||||||
|
* @package app\adminapi\validate\supervision_dangerous
|
||||||
|
*/
|
||||||
|
class SupervisionDangerousEngineeringEliminateValidate extends BaseValidate
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置校验规则
|
||||||
|
* @var string[]
|
||||||
|
*/
|
||||||
|
protected $rule = [
|
||||||
|
'id' => 'require|checkData',
|
||||||
|
'dangerous_engineering_monitoring_id' => 'require|checkDangerousEngineeringMonitoring',
|
||||||
|
'eliminate_date' => 'require|dateFormat:Y-m-d',
|
||||||
|
'eliminate_user' => 'require',
|
||||||
|
'is_notice' => 'require|in:0,1',
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数描述
|
||||||
|
* @var string[]
|
||||||
|
*/
|
||||||
|
protected $field = [
|
||||||
|
'id' => 'id',
|
||||||
|
'dangerous_engineering_monitoring_id' => '危大工程监控id',
|
||||||
|
'eliminate_date' => '危险消除日期',
|
||||||
|
'eliminate_user' => '消除人',
|
||||||
|
'is_notice' => '是否告知',
|
||||||
|
'notice_user' => '告知人员',
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加场景
|
||||||
|
* @return SupervisionDangerousEngineeringEliminateValidate
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/03/04 15:31
|
||||||
|
*/
|
||||||
|
public function sceneAdd()
|
||||||
|
{
|
||||||
|
return $this->remove('id',true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑场景
|
||||||
|
* @return SupervisionDangerousEngineeringEliminateValidate
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/03/04 15:31
|
||||||
|
*/
|
||||||
|
public function sceneEdit()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除场景
|
||||||
|
* @return SupervisionDangerousEngineeringEliminateValidate
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/03/04 15:31
|
||||||
|
*/
|
||||||
|
public function sceneDelete()
|
||||||
|
{
|
||||||
|
return $this->only(['id']);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 详情场景
|
||||||
|
* @return SupervisionDangerousEngineeringEliminateValidate
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/03/04 15:31
|
||||||
|
*/
|
||||||
|
public function sceneDetail()
|
||||||
|
{
|
||||||
|
return $this->only(['id']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function checkData($value): bool|string
|
||||||
|
{
|
||||||
|
$data = SupervisionDangerousEngineeringEliminate::where('id',$value)->findOrEmpty();
|
||||||
|
if($data->isEmpty()){
|
||||||
|
return '数据不存在';
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function checkDangerousEngineeringMonitoring($value): bool|string
|
||||||
|
{
|
||||||
|
$data = SupervisionDangerousEngineeringMonitoring::where('id',$value)->findOrEmpty();
|
||||||
|
if($data->isEmpty()){
|
||||||
|
return '危大工程监控信息不存在';
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||||
|
// | 开源版本可自由商用,可去除界面版权logo
|
||||||
|
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||||
|
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||||
|
// | 访问官网:https://www.likeadmin.cn
|
||||||
|
// | likeadmin团队 版权所有 拥有最终解释权
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | author: likeadminTeam
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace app\common\model\supervision_dangerous;
|
||||||
|
|
||||||
|
|
||||||
|
use app\common\model\BaseModel;
|
||||||
|
use think\model\concern\SoftDelete;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程监理--危大工程消除列表模型
|
||||||
|
* Class SupervisionDangerousEngineeringEliminate
|
||||||
|
* @package app\common\model\supervision_dangerous
|
||||||
|
*/
|
||||||
|
class SupervisionDangerousEngineeringEliminate extends BaseModel
|
||||||
|
{
|
||||||
|
use SoftDelete;
|
||||||
|
protected $name = 'supervision_dangerous_engineering_eliminate';
|
||||||
|
protected $deleteTime = 'delete_time';
|
||||||
|
|
||||||
|
public function getEliminateDateAttr($value): string
|
||||||
|
{
|
||||||
|
return !empty($value) ? date('Y-m-d',$value) : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getIsNoticeTextAttr($value,$data): string
|
||||||
|
{
|
||||||
|
$arr = [0=>'否', 1=>'是'];
|
||||||
|
return $arr[$data['is_notice']];
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user