作者 gpj-dev

预约最大次数拦截修改

... ... @@ -469,7 +469,10 @@ class Api
protected function CountNum($UserId, $Id)
{
$createtime = Db::name('sun')->where(['id' => $Id])->value('createtime');
$map['sun_createtime'] = ['BETWEEN', [$createtime - 2, $createtime + 5]];
//没明白为啥要用between
// $map['sun_createtime'] = ['BETWEEN', [$createtime - 2, $createtime + 5]];
$map['sun_createtime'] = $createtime;
$map['status'] = ['NEQ', 2];
$count = Db::name('yuyue')->where(['user_id' => $UserId])->where($map)->select();
if (count($count) > 1) $this->error('超过最大可预约次数', 0);
... ...