sql been without changing the original value statement shows how the view to show the contents of another table

1. This function is a demand in the company of my time, my master, and I say that is when you can not you can add a digital show to customers but to see when is the best digital name because customers do not know if this is What does it mean

2. Then I fell into a long to realize this function in a start just can check out the data in the view does not know today show inspiration came, not stop to realize this function

2.1 Data query passed blade template (id me to query the primary key in the second table where you can compare the value of the query name in the view)

 $res  = \DB::select("SELECT users.id,real_name FROM users,car_apply WHERE users.id=car_apply.user_id;");
   $res1 = \DB::select("SELECT users.id,real_name FROM users,car_apply WHERE users.id=car_apply.two_userid;");
    return view('admin.carmanage.index', compact('data','res','res1'));

2.2 call attempt layer data (core code)

2.2.1 $ num is counted by using foreach in judgment can be understood if (id == query table if the data in this table is the first of several other id then display the corresponding name of the table or else if not this show data in the table)

3. The display is as follows :( note here is that if you modify the table displays the value of your fuzzy queries must be synchronized to modify or will be error)

 

Guess you like

Origin www.cnblogs.com/yaoliuyang/p/12362468.html