修改类别、教师荣誉筛选、课题数据表
This commit is contained in:
1 parent
9ed1b3ea4b
commit
0c33aa9345
9 files changed
+42
-22
No files matched your search
@@ -275,7 +275,7 @@ class JsRongyuInfo extends Base
|
||||
$data = ryinfo::update($list);
|
||||
|
||||
// 删除原来的获奖人与参与人信息
|
||||
$data->allJsry()->delete(true);
|
||||
$data->allJsry()->where('rongyuid',$list['id'])->delete(true);
|
||||
// 声明教师数组
|
||||
$teacherlist = [];
|
||||
// 循环组成获奖教师信息
|
||||
@@ -286,14 +286,17 @@ class JsRongyuInfo extends Base
|
||||
'category' => 1,
|
||||
];
|
||||
}
|
||||
// 循环组成参与教师信息
|
||||
foreach ($list['cyteachers'] as $key => $value) {
|
||||
$canyulist[] = [
|
||||
'teacherid' => $value,
|
||||
'rongyuid' => $list['id'],
|
||||
'category' => 2,
|
||||
];
|
||||
if(!empty($list['cyteachers'])){
|
||||
// 循环组成参与教师信息
|
||||
foreach ($list['cyteachers'] as $key => $value) {
|
||||
$canyulist[] = [
|
||||
'teacherid' => $value,
|
||||
'rongyuid' => $list['id'],
|
||||
'category' => 2,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 添加新的获奖人与参与人信息
|
||||
$data->allJsry()->saveAll($canyulist);
|
||||
@@ -302,7 +305,7 @@ class JsRongyuInfo extends Base
|
||||
$data ? $data=['msg'=>'更新成功','val'=>1] : $data=['msg'=>'数据处理错误','val'=>0];
|
||||
|
||||
// 返回信息
|
||||
return json($data&1);
|
||||
return json($data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,7 +10,7 @@ class JsRongyuInfo extends Base
|
||||
//搜索单位获奖荣誉
|
||||
public function search($search)
|
||||
{
|
||||
// 获取参数
|
||||
// 获取参数
|
||||
$hjschool = $search['hjschool'];
|
||||
$fzschool = $search['fzschool'];
|
||||
$category = $search['category'];
|
||||
@@ -19,15 +19,21 @@ class JsRongyuInfo extends Base
|
||||
$category = $search['category'];
|
||||
$search = $search['search'];
|
||||
|
||||
|
||||
$data = $this->order([$order_field =>$order])
|
||||
->when(!empty($hjschool),function($query) use($hjschool){
|
||||
$query->where('hjschool','in',$hjschool);
|
||||
})
|
||||
// ->when(!empty($fzschool),function($query) use($fzschool){
|
||||
// $query->where('fzschool','in',$fzschool);
|
||||
// })
|
||||
->when(!empty($fzschool),function($query) use($fzschool){
|
||||
$query->where('rongyuce','in',function($q) use($fzschool){
|
||||
$q->name('JsRongyu')->where('fzschool','in',$fzschool)->field('id');
|
||||
});
|
||||
|
||||
})
|
||||
->when(!empty($category),function($query) use($category){
|
||||
$query->where('category','in',$category);
|
||||
$query->where('rongyuce','in',function($q) use($category){
|
||||
$q->name('JsRongyu')->where('category','in',$category)->field('id');
|
||||
});
|
||||
})
|
||||
->when(!empty($search),function($query) use($search){
|
||||
$query->where('title','like',$search);
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>荣誉类型:</label>
|
||||
<div class="formControls col-xs-8 col-sm-9 f-l">
|
||||
<span class="select-box f-l" style="width:180px;">
|
||||
{php}$category = getCategory(112);{/php}
|
||||
{php}$category = getCategory(114);{/php}
|
||||
<select class="select" id="category" name="category" size="1" required>
|
||||
<option value="">--请选择荣誉类型--</option>
|
||||
{volist name="category" id="vo"}
|
||||
|
||||
Loaded 3 of 9 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user