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