thinkphp Formatting Time issues

Source: Internet
Author: User
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 ();

  • Related Article

    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.