My data table is as follows: My goal is to retrieve the answers of comments, answers, and members in the broker_achieve table in the previous week, calculate the value based on the comments number weight 50%, answers number weight 25%, and members weight 25%. Then, place the number in the broker table broker...
My data tables are as follows:
My goal is to retrieve the answers of comments, answers, and members in the broker_achieve table in the previous week, calculate the value based on comments weight 50%, answers number weight 25%, and members weight 25%, and then place the number in broker_sort of the broker table. Broker_sort will be used for sorting in future calls.
I am a little confused about how thinkphp operates the data obtained...
Public function refresh () {$ achieve = M ('broker _ achieve '); // broker achievement $ broker = M ('broker '); // broker Details table broker_sort is the broker's sorting value up to $ thisyear = date ('y'); $ thisweek = date ('W')-1; // obtain the week (last week) $ thisachieve = $ achieve-> where ("year = $ thisyear and week = $ thisweek "); // obtain all data in a time period}
Reply content:
My data tables are as follows:
My goal is to retrieve the answers of comments, answers, and members in the broker_achieve table in the previous week, calculate the value based on comments weight 50%, answers number weight 25%, and members weight 25%, and then place the number in broker_sort of the broker table. Broker_sort will be used for sorting in future calls.
I am a little confused about how thinkphp operates the data obtained...
Public function refresh () {$ achieve = M ('broker _ achieve '); // broker achievement $ broker = M ('broker '); // broker Details table broker_sort is the broker's sorting value up to $ thisyear = date ('y'); $ thisweek = date ('W')-1; // obtain the week (last week) $ thisachieve = $ achieve-> where ("year = $ thisyear and week = $ thisweek "); // obtain all data in a time period}