作者 gpj-dev

预约管理修改

... ... @@ -219,10 +219,13 @@ class Sun extends Backend
public 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);
$count = Db::name('yuyue')->where(['user_id' => $UserId])->where($map)->count();
if ($count > 1) $this->error('超过最大可预约次数', 0);
}
... ...