作者 王智

2021/03/08 北京固定翼飞机修改

@@ -595,69 +595,69 @@ class Api @@ -595,69 +595,69 @@ class Api
595 $weekarray = array("", "", "", "", "", "", ""); //先定义一个数组 595 $weekarray = array("", "", "", "", "", "", ""); //先定义一个数组
596 $is_week = "" . $weekarray[date("w", strtotime(date('Y-m-d', $createtime)))]; 596 $is_week = "" . $weekarray[date("w", strtotime(date('Y-m-d', $createtime)))];
597 $map['createtime'] = ['BETWEEN', [$createtime - 1, $createtime + 86400 - 1]]; 597 $map['createtime'] = ['BETWEEN', [$createtime - 1, $createtime + 86400 - 1]];
598 - if ($is_week == '周一') {  
599 - $count = Db::name('yuyue')->where(['user_id' => $user_id])->where($map)->select();  
600 - if (!empty($count)) {  
601 - if (count($count) > 2) {  
602 - $this->error('超过最大可预约次数', 0);  
603 - die;  
604 - }  
605 - }  
606 - }  
607 - if ($is_week == '周二') {  
608 - $count = Db::name('yuyue')->where(['user_id' => $user_id])->where($map)->select();  
609 - if (!empty($count)) {  
610 - if (count($count) > 2) {  
611 - $this->error('超过最大可预约次数', 0);  
612 - die;  
613 - }  
614 - }  
615 - }  
616 - if ($is_week == '周三') {  
617 - $count = Db::name('yuyue')->where(['user_id' => $user_id])->where($map)->select();  
618 - if (!empty($count)) {  
619 - if (count($count) > 2) {  
620 - $this->error('超过最大可预约次数', 0);  
621 - die;  
622 - }  
623 - }  
624 - }  
625 - if ($is_week == '周四') {  
626 - $count = Db::name('yuyue')->where(['user_id' => $user_id])->where($map)->select();  
627 - if (!empty($count)) {  
628 - if (count($count) > 2) {  
629 - $this->error('超过最大可预约次数', 0);  
630 - die;  
631 - }  
632 - }  
633 - }  
634 - if ($is_week == '周五') {  
635 - $count = Db::name('yuyue')->where(['user_id' => $user_id])->where($map)->select();  
636 - if (!empty($count)) {  
637 - if (count($count) > 2) {  
638 - $this->error('超过最大可预约次数', 0);  
639 - die;  
640 - }  
641 - }  
642 - }  
643 - if ($is_week == '周六') {  
644 - $count = Db::name('yuyue')->where(['user_id' => $user_id])->where($map)->select();  
645 - if (!empty($count)) {  
646 - if (count($count) > 2) {  
647 - $this->error('超过最大可预约次数', 0);  
648 - die;  
649 - }  
650 - }  
651 - }  
652 - if ($is_week == '周日') {  
653 - $count = Db::name('yuyue')->where(['user_id' => $user_id])->where($map)->select();  
654 - if (!empty($count)) {  
655 - if (count($count) > 2) {  
656 - $this->error('超过最大可预约次数', 0);  
657 - die;  
658 - } 598 +// if ($is_week == '周一') {
  599 + $count = Db::name('yuyue')->where(['user_id' => $user_id])->where($map)->select();
  600 + if (!empty($count)) {
  601 + if (count($count) > 2) {
  602 + $this->error('超过最大可预约次数', 0);
  603 + die;
659 } 604 }
660 } 605 }
  606 +// }
  607 +// if ($is_week == '周二') {
  608 +// $count = Db::name('yuyue')->where(['user_id' => $user_id])->where($map)->select();
  609 +// if (!empty($count)) {
  610 +// if (count($count) > 2) {
  611 +// $this->error('超过最大可预约次数', 0);
  612 +// die;
  613 +// }
  614 +// }
  615 +// }
  616 +// if ($is_week == '周三') {
  617 +// $count = Db::name('yuyue')->where(['user_id' => $user_id])->where($map)->select();
  618 +// if (!empty($count)) {
  619 +// if (count($count) > 2) {
  620 +// $this->error('超过最大可预约次数', 0);
  621 +// die;
  622 +// }
  623 +// }
  624 +// }
  625 +// if ($is_week == '周四') {
  626 +// $count = Db::name('yuyue')->where(['user_id' => $user_id])->where($map)->select();
  627 +// if (!empty($count)) {
  628 +// if (count($count) > 2) {
  629 +// $this->error('超过最大可预约次数', 0);
  630 +// die;
  631 +// }
  632 +// }
  633 +// }
  634 +// if ($is_week == '周五') {
  635 +// $count = Db::name('yuyue')->where(['user_id' => $user_id])->where($map)->select();
  636 +// if (!empty($count)) {
  637 +// if (count($count) > 2) {
  638 +// $this->error('超过最大可预约次数', 0);
  639 +// die;
  640 +// }
  641 +// }
  642 +// }
  643 +// if ($is_week == '周六') {
  644 +// $count = Db::name('yuyue')->where(['user_id' => $user_id])->where($map)->select();
  645 +// if (!empty($count)) {
  646 +// if (count($count) > 2) {
  647 +// $this->error('超过最大可预约次数', 0);
  648 +// die;
  649 +// }
  650 +// }
  651 +// }
  652 +// if ($is_week == '周日') {
  653 +// $count = Db::name('yuyue')->where(['user_id' => $user_id])->where($map)->select();
  654 +// if (!empty($count)) {
  655 +// if (count($count) > 2) {
  656 +// $this->error('超过最大可预约次数', 0);
  657 +// die;
  658 +// }
  659 +// }
  660 +// }
661 } 661 }
662 662
663 663