123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- namespace app\api\controller\v1;
- use app\api\controller\Base;
- use app\hander\HelpHander;
- use think\App;
- use think\Db;
- class DeviceTaskDelay extends Base
- {
- public function list(){
- $page = input('page',1);
- $size = input('size',20);
- $map[] = ['org_id','=',$this->orgId];
- $lists = Db::name('device_task_delay')
- ->where($map)
- ->page($page,$size)
- ->order('id desc')
- ->select();
- foreach ($lists as $k=>$v){
- $taskTitle = Db::name('device_task')->where('id',$v['task_id'])->value('title');
- $lists[$k]['task_title'] = $taskTitle?$taskTitle:'';
- $lists[$k]['end_time'] = date('Y-m-d H:i',strtotime($v['end_time']));
- $lists[$k]['uname'] = Db::name('user')->where('id',$v['user_id'])->value('real_name');
- $lists[$k]['deal_user'] = '';
- if($v['deal_user_id'] > 0){
- $lists[$k]['deal_user'] = Db::name('user')->where('id',$v['deal_user_id'])->value('real_name');
- }
- }
- HelpHander::success($lists);
- }
- public function deal(){
- $res = model('DeviceTask')->dealDelay($this->userId,$this->orgId);
- if(!$res){
- HelpHander::error(model('DeviceTask')->getError());
- }
- HelpHander::success('操作成功');
- }
- }
|