CRON工作在午夜12点之后无法正常工作?

时间:2018-04-16 13:32:48

标签: php cron

请查看我的网站locpage。这是一个添加发布网站,我们根据用户需求安排添加,并根据每天或每小时的时间和日期自动重新添加。但如果在24:00之后发布任何添加,那么将不再更新到10:00我不知道将来会出现什么问题为我提供最好的解决方案。

date_default_timezone_set("Asia/kolkata");
 $curtime = date('h:i A');
 $ct =  $curtime = date('H:i' );

 $check_date=date('Y-m-d');


$querymoveother=$this->db->query("Select t1.*,t2.* from tbl_upgrades t1,tbl_listing t2 where  ((t1.autorepost_startdate ='".$check_date."'
OR t1.autorepost_enddate ='".$check_date."') AND t1.autorepost_counter < (t1.no_of_times)
 and (t1.autorepost_time <='".$ct."') AND (t1.autorepost_counterdate < '".$check_date."'
  OR t1.autorepost_counterdate < '0000-00-00' ) and (t1.autorepost_expirydate >='".$check_date."')) and (t1.list_id=t2.list_id) and t2.cat_id = '".$catid."' and (t2.list_city='".$_SESSION['cityid']."' OR FIND_IN_SET( '".$_SESSION['cityid']."', t1.nearbycities ))
  and t2.list_status='Enabled' ".$subcatqry." ".$keywords." and (t1.move_adtop_hr!='' OR t1.autorepost_day != '')    or (('".date("Y-m-d")."' between upgrade_date and expiry_date) AND move_adtop_hr!='' and (expiry_time <='".$ct."'  or   upgrade_time <= '".$ct."'  ) ) and (t1.list_id=t2.list_id) and t2.cat_id = '".$catid."' and (t2.list_city='".$_SESSION['cityid']."' OR FIND_IN_SET( '".$_SESSION['cityid']."', t1.nearbycities ))
  and t2.list_status='Enabled' ".$subcatqry." ".$keywords." and (t1.move_adtop_hr!=t1.countermove)  group by t1.list_id ORDER BY t1.upgrade_time desc,t1.autorepost_counterdate desc,t1.upgrade_id DESC ");

  $resultss = $querymoveother->result();
//echo $this->db->last_query();
$items = array();
        foreach($resultss as $getlist)
        {    echo "Other";


            $items[] = $getlist->list_id;
              $locquery = $this->db->query("select t1.*, t2.*, t3.* from tbl_country t1, tbl_state t2, tbl_city t3 where t1.country_id = '".$getlist->list_country."' AND t2.state_id = '".$getlist->list_state."' AND t3.city_id = '".$getlist->list_city."'")->row();

              $allimg = explode(",",$getlist->list_images);
              $totimgs = count($allimg);
              $firstimg = $allimg[0];
              if($firstimg=='')
              {
                $firstimg = 'noimage.png';
              }
              $subdomain = $newurllink;

              $getdata = $this->db->query("select t1.*, t2.* from tbl_category t1, tbl_subcategory t2 where t1.cat_id = '".$getlist->cat_id."' and t2.subcat_id = '".$getlist->subcat_id."'");

              $catstring1 = preg_replace('/[^\w]/', '-', $getdata->row()->cat_name);
              $newcatlink1 = str_replace("--","",strtolower($catstring1));

              $subcatstring1 = preg_replace('/[^\w]/', '-', $getdata->row()->subcat_name);
              $newsubcatlink1 = str_replace("--","",strtolower($subcatstring1));

              $listtitles1 = preg_replace('/[^\w]/', '-', $getlist->list_title);
              $newlisttitle = str_replace("--","",strtolower($listtitles1));
        ?>

         <?php if($getlist->amount!='' AND($getlist->move_adtop_hr!='' OR $getlist->sponsoramt!='' OR $getlist->autorepost_day!='')){
            $chk_status =$this->db->get_where("tbl_payment",array("itemnumber"=>$getlist->list_id,"paystatus"=>'Completed'));
            //echo $chk_status->num_rows();
            if($chk_status->num_rows()>0){
          ?>
               <div class="item-list">
                  <div class="col-sm-12 add-desc-box">
                    <div class="add-details">
                      <h5 class="add-title" style="overflow-wrap: break-word;"><a class="anchor-color" href="<?php echo $subdomain;?><?php echo $newcatlink1;?>/<?php echo $newsubcatlink1;?>/<?php echo $newlisttitle;?>/<?php echo $getlist->list_id;?>"><?php echo substr($getlist->list_title,0,50) ;?></a><span class="item-location"> (<?php echo $locquery->city_name.', '.$locquery->country_name;?>)</span></h5>
                      <p><?php echo substr($getlist->list_description,0,50).'..........';?></p>
                       <span class="date"><i class="fa fa-clock-o" aria-hidden="true"></i> <?php if($getlist->autorepost_counter>0){ echo  date("D. d M, Y",strtotime($getlist->autorepost_counterdate));}else{ echo  date("D. d M, Y",strtotime($getlist->normal_startdate)); }?> </span>
                    </div>
                </div>
                </div>
              <?php }}

关键字和子类别值

从tbl_upgrades t1,tbl_listing t2中选择t1。,t2。。((t1.autorepost_startdate ='2018-04-23'OR t1.autorepost_enddate ='2018-04-23')AND t1.autorepost_counter&lt;(t1.no_of_times)和(t1.autorepost_time&lt; ='10:53')AND(t1.autorepost_counterdate&lt;'2018-04-23'OR t1.autorepost_counterdate&lt;'0000-00-00 ')和(t1.autorepost_expirydate&gt; ='2018-04-23'))和(t1.list_id = t2.list_id)和t2.cat_id ='2'和(t2.list_city ='742'或FIND_IN_SET(' 742',t1.nearbycities))和t2.list_status ='启用'和t2.subcat_id ='5'和(t1.move_adtop_hr!=''或t1.autorepost_day!='')或((''2018-04- 23'在upgrade_date和expiry_date之间)和move_adtop_hr!=''和(expiry_time&lt; ='10:53'或者upgrade_time&lt; = '10:53'))和(t1.list_id = t2.list_id)和t2.cat_id ='2'和(t2.list_city ='742'或FIND_IN_SET('742',t1.nearbycities))和t2.list_status ='启用'和t2.subcat_id ='5'和(t1.move_adtop_hr!= t1。 countermove)group by t1.list_id ORDER BY t1.upgrade_time desc, t1.autorepost_counterdate desc,t1.upgrade_id DESC

0 个答案:

没有答案