ManageAction::doNotify PHP Method

doNotify() public method

修改公告
public doNotify ( )
    public function doNotify()
    {
        $weiba_id = intval($_POST['weiba_id']);
        $notify = t($_POST['notify']);
        /*		if(strlen($notify) == 0){
                $this->error('公告内容不能为空');
            }*/
        preg_match_all('/./us', $notify, $match);
        if (count($match[0]) > 200) {
            //汉字和字母都为一个字
            $this->error('公告内容不能超过200个字');
        }
        $data['notify'] = $notify;
        $res = D('weiba')->where('weiba_id=' . $weiba_id)->save($data);
        if ($res !== false) {
            D('log')->writeLog($weiba_id, $this->mid, '发布了公告', 'notify');
            $this->success('保存成功');
        } else {
            $this->error('保存失败');
        }
    }