Thinkphp what I want to achieve when one order number corresponds to multiple items:
Thinkphp code:
Public function myorder (){
$ Obj = M ();
$ SQL = "select GROUP_CONCAT (oc. courseList_id order by oc. courseList_id DESC) AS courseList, o. order_id, o. user_id, o. user_name, o. number, o. orderTime, o. status, o. amount, oc. courseList_id from tb_order as o inner join tb_order_courselist as oc on o. order_id = oc. order_id where o. user_id = ". $ _ SESSION ['User _ id']. "group by o. order_id order by o. order_id desc ";
$ OrderData = $ obj-> query ($ SQL );
Foreach ($ orderData as $ value ){
$ SQL _list = "select * from tb_order_courseList where courseList_id in (". $ value ['courselist']. ")";
$ Course_list = $ obj-> query ($ SQL _list );
}
$ This-> assign ("courseList", $ course_list );
$ This-> assign ("orderData", $ orderData );
$ This-> display ();
}
Template code:
My orders
Course Information
Video duration
Unit Price
Order amount
Order Status
Operation
<{$ Order. orderTime}> order No:<{$ Order. number}>
"Alt =" Image description "/><{$ List. course_name}>
-
Instructor:
-
<{$ List. teacher_names | mb_substr = 0, 5, 'utf-8'}>
-
Validity period:
-
<{$ List. valid}>
|
<{$ List. lessonTime}> minutes |
¥ <{$ List. course_price}> |
¥ <{$ Order. amount}> |
Unpaid Paid |
Delete payment now |
Reply to discussion (solution)
Frontend data traversal
Order table associated with order Product Table
Order_info and order_goods
Returns the result set and traverses the loop.
Order table associated with order Product Table
Order_info and order_goods
Returns the result set and traverses the loop.
I have come to the conclusion that the result set is frontend traversal. a problem occurs. how can this problem be solved?
You can calculate the number of order item entries and then merge cells and so on.
I have already made it out. I gave up the table and used DIV to arrange it. now it's okay. I 'd like to share it with you,