public function actionDel()
 {
     $res = array('statusCode' => 200, 'message' => '删除成功!');
     try {
         if (empty($_REQUEST['id'])) {
             throw new Exception("数据错误,id不能为空!", 1);
         }
         $flag = ShopConfig::model()->deleteByPk($_REQUEST['id']);
         if (!$flag) {
             throw new exception('删除失败');
         }
     } catch (Exception $e) {
         $res['statusCode'] = 300;
         $res['message'] = '删除失败【' . $e->getMessage() . '】';
     }
     $res['callbackType'] = 'reloadTab';
     $res['forwardUrl'] = '/manage/shopConfig/index';
     $this->ajaxDwzReturn($res);
 }
Exemple #2
0
 /**
  * 获取免运费金额
  */
 public function getFreeShippingAmount()
 {
     $map = array();
     $map['attribute'] = 'FREE_SHIP_AMOUNT';
     $info = ShopConfig::model()->findByAttributes($map);
     if (empty($info)) {
         return 200;
     }
     return $info->value;
 }