當前位置: 首頁>>代碼示例>>PHP>>正文


PHP global_common::datediff方法代碼示例

本文整理匯總了PHP中global_common::datediff方法的典型用法代碼示例。如果您正苦於以下問題:PHP global_common::datediff方法的具體用法?PHP global_common::datediff怎麽用?PHP global_common::datediff使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在global_common的用法示例。


在下文中一共展示了global_common::datediff方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: refreshArticle

 public function refreshArticle($articleID, $currentUser)
 {
     $currentArticle = $this->getArticleByID($articleID);
     $renewNum = $currentArticle[global_mapping::RenewedNum];
     $renewedDate = $currentArticle[global_mapping::RenewedDate];
     $diffDay = global_common::datediff(global_common::getDate(), date('d-m-Y', strtotime($renewedDate)), d);
     if ($diffDay > 0) {
         $renewNum = 0;
     }
     if ($renewNum < self::NUM_REFRESH) {
         $renewNum += 1;
         $title = $currentArticle[global_mapping::Title];
         $fileName = $currentArticle[global_mapping::FileName];
         $catalogueID = $currentArticle[global_mapping::CatalogueID];
         $content = $currentArticle[global_mapping::Content];
         $tags = $currentArticle[global_mapping::Tags];
         $createdBy = $currentArticle[global_mapping::CreatedBy];
         $createdDate = global_common::formatDateTimeVN($currentArticle[global_mapping::CreatedDate]);
         $modifiedBy = $currentUser[global_mapping::UserID];
         $renewedDate = global_common::nowSQL();
         $companyName = $currentArticle[global_mapping::CompanyName];
         $companyAddress = $currentArticle[global_mapping::CompanyAddress];
         $companyWebsite = $currentArticle[global_mapping::CompanyWebsite];
         $companyPhone = $currentArticle[global_mapping::CompanyPhone];
         $adType = $currentArticle[global_mapping::AdType];
         $startDate = global_common::formatDateTimeVN($currentArticle[global_mapping::StartDate]);
         $endDate = global_common::formatDateTimeVN($currentArticle[global_mapping::EndDate]);
         $happyDays = $currentArticle[global_mapping::HappyDays];
         $startHappyHour = $currentArticle[global_mapping::StartHappyHour];
         $endHappyHour = $currentArticle[global_mapping::EndHappyHour];
         $addresses = $currentArticle[global_mapping::Addresses];
         $dictricts = $currentArticle[global_mapping::Dictricts];
         $cities = $currentArticle[global_mapping::Cities];
         $resultID = $this->update($articleID, null, $title, $fileName, $catalogueID, $content, null, $tags, $numView, $numComment, $createdBy, $createdDate, $modifiedBy, global_common::nowSQL(), null, null, 0, null, null, $renewedDate, $renewNum, $companyName, $companyAddress, $companyWebsite, $companyPhone, $adType, $startDate, $endDate, $happyDays, $startHappyHour, $endHappyHour, $addresses, $dictricts, $cities);
         if (!$resultID) {
             //echo $strSQL;
             global_common::writeLog('Error refreshArticle sl_article:' . $articleID, 1);
             return -1;
         }
         return self::NUM_REFRESH - $renewNum;
     }
     return -1;
 }
開發者ID:vietlethanh,項目名稱:timkm20130929,代碼行數:43,代碼來源:model_article.php


注:本文中的global_common::datediff方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。