...
|
...
|
@@ -75,11 +75,14 @@ class Teacher extends Api |
|
|
if (!$validate->check($param)) {
|
|
|
$this->error($validate->getError());
|
|
|
}
|
|
|
//接收所传入的擅长领域ID
|
|
|
$territory_id = explode(',',$param['territory_id']);
|
|
|
$count = count($territory_id);
|
|
|
if($count>4){
|
|
|
$this->error('最多添加4个擅长领域');
|
|
|
if(!empty($param['territory_id'])){
|
|
|
//接收所传入的擅长领域ID
|
|
|
$territory_id = explode(',',$param['territory_id']);
|
|
|
$count = count($territory_id);
|
|
|
if($count>4){
|
|
|
$this->error('最多添加4个擅长领域');
|
|
|
}
|
|
|
unset($param['territory_id']);
|
|
|
}
|
|
|
$qiniu = get_addon_config('qiniu');
|
|
|
$http = $qiniu['cdnurl'];
|
...
|
...
|
@@ -87,7 +90,6 @@ class Teacher extends Api |
|
|
$param['behind'] = str_replace($http, '', $param['behind']);
|
|
|
$param['thumbnail'] = str_replace($http, '', $param['thumbnail']);
|
|
|
$param['createtime'] = time();
|
|
|
unset($param['territory_id']);
|
|
|
$data = Db::name('teacher')->insertGetId($param);
|
|
|
if (empty($data)) {
|
|
|
$this->error('提交失败');
|
...
|
...
|
|