代码如下,主要是看SQL的部分:
$where['client_id'] = $data['client_id'];
$where['_string'] = "FROM_UNIXTIME(createAt,'%Y-%m-%d')='".date("Y-m-d", time())."'";
$PostTimesToday = M('feedback')->where($where)->count();
//提交次数超过5次则不准提交
if($PostTimesToday > C('FEEDBACK_DAY_LIMIT'))
{
$this->throwException('PASS_THE_LIMIT', 'OTHER');
}