Example #1
0
 public function updateProductDiscount()
 {
     $token = Input::get('token', '');
     $u_id = Input::get('u_id', 0);
     $discount = Input::get('discount', '');
     try {
         $user = User::chkUserByToken($token, $u_id);
         $discountArray = json_decode($discount, true);
         if (!is_array($discountArray)) {
             throw new Exception("请传入正确的排序数据", 1);
         }
         $re = Product::updateDiscount($discountArray);
         $re = Tools::reTrue('更新折扣成功');
     } catch (Exception $e) {
         $re = Tools::reTrue('更新折扣失败:' . $e->getMessage());
     }
     return Response::json($re);
 }