Exemplo n.º 1
0
 public function batch()
 {
     //检查登录
     $this->_login();
     $goods_ids = isset($_POST['goods_ids']) ? htmlspecialchars(trim($_POST['goods_ids'], ',')) : '';
     $is_sale = isset($_POST['is_sale']) ? htmlspecialchars($_POST['is_sale']) : '';
     if (!$goods_ids || !$is_sale) {
         echo '-1';
         throw new Exception('exit');
     }
     //批量修改
     $rs = AdminGoodsM::batchModifySaleStatus($goods_ids, $is_sale);
     if ($rs) {
         echo '1';
     } else {
         echo '0';
     }
     throw new Exception('exit');
 }