返回給前端運(yùn)動(dòng)日期,年月日不能重復(fù):
public function getMemberPhysicalTestDate()
{
$arr = MemberPhysicalTest::find()
->alias('mpt')
->joinWith(['member m'],FALSE)
->where([
'm.member_account_id' => $this->accountId,
'mpt.type' => $this->type,
'mpt.is_delete' => 0
])
->select('mpt.create_at')
->groupBy(["DATE_FORMAT(from_unixtime(mpt.create_at),'%Y-%m-%d')"])
->orderBy('mpt.create_at desc')
->asArray()
->all();
return $arr;
}
這個(gè)方法不太好使:查詢出來的只有第一條,第二條6月26號(hào)的沒有查出來。
- 1 回答
- 0 關(guān)注
- 398 瀏覽
添加回答
舉報(bào)
0/150
提交
取消