有需求要整合某時間範圍內如:2019-09-21-2019-09-27 範圍內的刷卡記錄、每天只取最早的那天。來做判斷
所以這裏要用到分組了。按照日期分組。
上代碼:record_time爲刷卡時間
$db = Db::table(“表名”)->group("date_format('record_time','%m-%d-%Y')")->select();
這樣就搞定了。
有需求要整合某時間範圍內如:2019-09-21-2019-09-27 範圍內的刷卡記錄、每天只取最早的那天。來做判斷
所以這裏要用到分組了。按照日期分組。
上代碼:record_time爲刷卡時間
$db = Db::table(“表名”)->group("date_format('record_time','%m-%d-%Y')")->select();
這樣就搞定了。
public function importData(){ //先執行文件上傳 $file = $this->request->file('files');//獲取表單上傳文件 if(em
tp5 whereOr $model->where($where)->whereOr($data)->find(); whereOr 或者屬性 這就讓我們實現了多條件查詢
<?php /* *單例模式 *工廠模式 *註冊樹模式 */ //單例模式 class Site { //屬性 public $siteName; //本類的靜態實例 protected stati