返回給前端運動日期,年月日不能重復:
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;
}
這個方法不太好使:查詢出來的只有第一條,第二條6月26號的沒有查出來。
- 1 回答
- 0 關注
- 403 瀏覽
添加回答
舉報
0/150
提交
取消
