tp5.1 在where查询SQL语句中用if直接判断查询语句

论坛 期权论坛 脚本     
匿名技术用户   2020-12-30 08:15   977   0
  //待上课表 
         $list2=Db::name('live_course')
         ->field('id,pid,title')
         ->whereIn('id',$allpid_future_ccid_all)
         ->where('deleted',0)
         ->where('state',0);//状态 0=启用 1=直播结束(就算直播服务器没有结束,用户界面都会显示直播结束)
   if($type==1){
//    $where_raw = 1;
   }else{
    $list2->whereRaw('unix_timestamp(endtime) + defer_time * 60 >='.time());
   }
         $list2->order('starttime', 'asc');
         $list2 = $list2->select();

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:7942463
帖子:1588486
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP