Blogger Information
Blog 2
fans 0
comment 0
visits 2015
Related recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
mysql遍历与PHP遍历
程的博客
Original
1106 people have browsed it

public function getStore($month, $name) {

        $res = Db::query("SELECT

                                team,

                                indate,

                                store_name,

                                retGuide

                            FROM

                                fs_info

                            LEFT JOIN fs_store ON fs_info.sid = fs_store.id

                            WHERE

                                nid = $name

                            AND `month` = $month");

        return $res;


// 代码优化为下面所示...

        $res = DB::query("SELECT team, indate, retGuide, sid FROM fs_info WHERE `month`=2 AND nid=6");

        foreach ($res as $k => $v) {

            $store = DB::query("SELECT * FROM fs_store WHERE sid=".$v['sid']);

            $res[$k]['store_name'] = $store[0]['store_name'];

        }

        return $res;


    }


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post