zeromicro / go-zero

A cloud-native Go microservices framework with cli tool for productivity.
https://go-zero.dev
MIT License
29.41k stars 3.97k forks source link

using datetime field under the model: Unable to query anything #3549

Open daifuyang opened 1 year ago

daifuyang commented 1 year ago

Describe the bug How to use a datetime field under the 'model'? I can't query anything. Can you help me?

To Reproduce select id,name,voice,desc,sample_rate_hertz,voice_type,words_per_minute,gender,status,created_at,updated_at,deleted_at from voice where deleted_at = ?

? = 0

has no data

select id,name,voice,desc,sample_rate_hertz,voice_type,words_per_minute,gender,status,created_at,updated_at,deleted_at from voice where deleted_at = 0 has data list

Expected behavior

Screenshots image

Environments (please complete the following information):

klen-ygs commented 1 year ago

Add “parseTime=True“ in the end of mysql connection string. For example, "user:pass@tcp(127.0.0.1:3306)/dbname?charset=utf8mb4&parseTime=True&loc=Local".

github-actions[bot] commented 2 months ago

This issue is stale because it has been open for 30 days with no activity.