作者 郭盛
1 个管道 的构建 通过 耗费 1 秒

修改成为老师

... ... @@ -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('提交失败');
... ...
... ... @@ -9412,7 +9412,7 @@
<div class="row mt0 footer">
<div class="col-md-6" align="left">
Generated on 2020-03-18 14:17:12 </div>
Generated on 2020-03-18 14:22:13 </div>
<div class="col-md-6" align="right">
<a href="https://www.fastadmin.net" target="_blank">FastAdmin</a>
</div>
... ...