TP5 在field中使用mysql函式

給我一瓶冰闊洛發表於2020-11-16
 $info = Db::name('moments')
->field(['switch','json_content',"FROM_UNIXTIME(create_time,'%Y-%m-%d') as time"])
->where(['corpid'=>$this->auth->corpid,'id'=>$id])
->find();

Array
(
    [switch] => 0
    [json_content] => {"msgtype":"image","content":"\u53d1\u4e2a\u670b\u54df\u5168","url":"https:\/\/work.szwlhd.com\/uploads\/wb.jpg"}
    [time] => 2020-11-14
)

 

相關文章