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;
}