Backstage uses the thinkphp frame, the foreground uses the Jqueryeasyui technology.
Question about how the time field is formatted as the "2014-01-01 12:00:00" format for the data that is fetched in the action. 、
Don't say much nonsense, stickers:
"Front page":
There are two tables in the background: the Customer table and the Account table. The correlation model is used. Front page, customer name, want to display the Name field in the Customer table, then JS, the table column field how to write?
"Page js":
Customer name, how to display the Customer table name field AH?
Why can't "{field: ' Customer.name ', title: ' Customer Name ', Width:100,resizable:true,sortable:true,align: ' Right '}" ah?
How is field specific and cannot be the data of the associated table?
"Background action":
Also, the foreground page shows the time, how to render "2014-01-01-12:00:00" format. The background database holds the UNIX timestamp.
I want to convert the time format in action and then show it in the page. How to write?
Reply to discussion (solution)
Date ("Y-m-d h:i:s", timestamp), H lowercase indicates 12-hour system
jquery Easyui Query The field of the foreign key object solve the problem!
Successfully removed the name field of the foreign Key object customer.
Foreground page Effect:
The JS code is as follows:
The key to the background action is $model->relation ("customer"). where ($map)->select ();