application/manage/controller/Job.php
public function modifyStatus(Request $request)
    {
        $id = $request->param('id');
        if (empty($id)) {
            return $this->error('任务ID为空');
        }
        
        $status = $request->param('value', 0);
        if ($status == 0) {
            $data = [
                'reserved' => 0,
                'reserved_at' => null
            ];
        } elseif ($status == 1) {
            $data = [
                'reserved' => 1,
                'reserved_at' => time()
            ];
        } else {
            $time = $request->param('time', 10);
            $data = [
                'reserved' => 0,
                'reserved_at' => null,
                'available_at' => time() + $time
            ];
        }
        JobLogic::model()->saveById($data, $id);
        
        return $this->success('操作成功', 'javascript:history.go(0);');
    }
public function modifyStatus(Request $request)
    {
        $id = $request->param('id');
        if (empty($id)) {
            return $this->error('任务ID为空');
        }
        
        $status = $request->param('value', 0);
        if ($status == 0) {
            $data = [
                'reserved' => 0,
                'reserved_at' => null
            ];
        } elseif ($status == 1) {
            $data = [
                'reserved' => 1,
                'reserved_at' => time()
            ];
        } else {
            $time = $request->param('time', 10);
            $data = [
                'reserved' => 0,
                'reserved_at' => null,
                'available_at' => time() + $time
            ];
        }
        JobLogic::model()->saveById($data, $id);
        
        return $this->success('操作成功', 'javascript:history.go(0);');
    }
public function modifyStatus ( Request $ request ) { $ id = $ request -> param ( 'id' ) ; if ( empty ( $ id ) ) { return $ this -> error ( '任务ID为空'); } $ status = $ request -> param ( 'value' , 0 ) ; if ( $ status == 0 ) { $ data = [ 'reserved' => 0 , 'reserved_at' => null ] ; } elseif ( $ status == 1 ) { $ data = [ 'reserved' => 1 , 'reserved_at' => time ( ) ] ; } else { $ time = $ request -> param ( 'time' , 10 ) ; $ data = [ 'reserved' => 0 , 'reserved_at' => null , 'available_at' => time ( ) + $ time ] ; } JobLogic :: model ( ) -> saveById ( $ data , $ id ) ; return $ this -> success ( '操作成功', 'javas c ipt:history.go(0);'); }
任务状态

@param Request $request
@return mixed
任务状态