Procházet zdrojové kódy

修改了时间转换,精确到分

master
suiyi-erff před 2 roky
rodič
revize
f402bd7b32
1 změnil soubory, kde provedl 1 přidání a 4 odebrání
  1. 1
    4
      application/admin/model/Appoint.php

+ 1
- 4
application/admin/model/Appoint.php Zobrazit soubor

@@ -174,10 +174,7 @@ class Appoint extends Model
unset($param[$k]);
}
}
//from_unixtime(appoint_time)
$result = $this->where($param)->field('id,customer_id,hospital_id,status as type,month(from_unixtime(appoint_time)) as months,year(from_unixtime(appoint_time)) as years,from_unixtime(appoint_time,"%d") as days,appoint_time as appoint_time')->with(['getCustomerOneData', 'getUserOneData', 'getCollectioOneData', 'getHospitalOneData'])->select();
//精确到分
$result['appoint_time']=date('Y-m-d H:i', $result['appoint_time']);
$result = $this->where($param)->field('id,customer_id,hospital_id,status as type,month(from_unixtime(appoint_time)) as months,year(from_unixtime(appoint_time)) as years,from_unixtime(appoint_time,"%d") as days,from_unixtime(appoint_time,"%Y-%m-%d %H:%m") as appoint_time')->with(['getCustomerOneData', 'getUserOneData', 'getCollectioOneData', 'getHospitalOneData'])->select();
foreach ($result as $k => $v) {
if (strlen($v['months']) < 2) {
$result[$k]['months'] = ['0' . $v['months']];

Načítá se…
Zrušit
Uložit