コード例 #1
0
ファイル: LinkController.php プロジェクト: jay4497/j4cms
 public function postBatch($act = 'update')
 {
     $result = false;
     switch ($act) {
         case 'delete':
             $ids = \Request::input('ids');
             $idsArr = explode(',', $ids);
             $result = Link::whereIn('id', $idsArr)->delete();
             break;
     }
     $msg = [];
     if ($result) {
         $msg['status'] = 'success';
     } else {
         $msg['status'] = 'failed';
     }
     return response(json_encode($msg))->header('Content-Type', 'application/json');
 }