查询一个驾校的相关业务员,入参驾校id。
/**
* 获取驾校相关业务员
*/
public function querySchoolSaleman(){
$request = Request::instance();
if ($request->isGet()) {
$param['schoolId'] = $request->get('schoolId');
$ret = ApiResultUtils::isEmpty($param);
if ($ret) {
return $ret;
}
$schoolId = $request->get('schoolId');
//检测驾校是否存在
$schoolDAO = new schoolInfo();
$schoolInfo = $schoolDAO->querySchoolInfoById($schoolId);
if (empty($schoolInfo)) {
return ApiResultUtils::ofFail('驾校信息不存在');
}
$stuDAO = new StudentInfo();
$saleman = $stuDAO->querySalemanBySchoolId($schoolId);
$sa = array();
foreach ($saleman as $arr) {
//假如salesman_id字段为空,则执行if语体里的语句