ThinkPHP formatting time

Source: Internet
Author: User
ThinkPHP adopts thinkPHP framework and jqueryEasyui technology.
The question about how to format the time field of the retrieved data in the action to "12:00:00. ,
Not much nonsense, texture:
[Front-end Page ]:

There are two tables in the background: the customer table and the account table. The associated model is used. On the front-end page, if you want to display the name field in the customer table, how do you write table column fields in js?
[Page js ]:

How does one display the name field of the customer table?
Why cannot I "{field: 'Customer. name', title: 'customer name', width: 100, resizable: true, sortable: true, align: 'right?
How to use field? cannot It be associated with table data?
[Background action ]:


Also, how to display the time on the front-end page in the format of "12:00:00. The background database stores the UNIX timestamp.
I want to first convert the time format in the action and then display it on the page. How to write?


Reply to discussion (solution)

Date ("Y-m-d H: I: s", timestamp), h lowercase represents 12-hour

Jquery easyui solves the field problem of querying foreign key objects!
The name field of the foreign key object customer is retrieved successfully.
Foreground page effect:

The js code is as follows:

The background action uses join queries. The key is $ model-> relation ("customer"). where ($ map)-> select ();

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.