diff --git a/Application/Admin/Controller/ToolController.class.php b/Application/Admin/Controller/ToolController.class.php index 5e41ec38a..39598df6e 100644 --- a/Application/Admin/Controller/ToolController.class.php +++ b/Application/Admin/Controller/ToolController.class.php @@ -39,13 +39,11 @@ class ToolController extends ThinkController { $map_['name']=array("in",'wei_xin,wei_xin_app,weixin'); M('tool','tab_')->where($map_)->setField('status','0'); } - if (!is_numeric($config['channel_rate'])) { + if (isset($config['channel_rate']) && ($config['channel_rate'] > 100 || !is_numeric($config['channel_rate']))) { $this->error('请输入正确的渠道费率'); } - if ($config['channel_rate'] > 100) { - $this->error('渠道费率最大值为100%'); - } - $config['channel_rate'] = round($config['channel_rate'], 2); + if (isset($config['channel_rate'])) $config['channel_rate'] = round($config['channel_rate'], 2); + $flag = M('Tool','tab_')->where($map)->setField($data); if($flag !== false){ $config['status']=$_POST['status'];