-
-
-
- {php} $category = categoryChildren(114);{/php}
- {volist name="category" id="vo"}
-
- {/volist}
-
+
+
+
-
-
+
+
{/block}
{block name="table"}
@@ -70,7 +61,22 @@
{/block}
diff --git a/app/teach/controller/Subject.php b/app/teach/controller/Subject.php
index dc5033b9..0c9eaaad 100755
--- a/app/teach/controller/Subject.php
+++ b/app/teach/controller/Subject.php
@@ -40,6 +40,8 @@ class Subject extends AdminBase
,'limit' => '10'
,'field' => 'update_time'
,'order' => 'asc'
+ ,'kaoshi' => ''
+ ,'status' => ''
,'xingzhi' => array()
,'searchval' => ''
],'POST');
@@ -229,5 +231,4 @@ class Subject extends AdminBase
// 返回信息
return json($data);
}
-
}
diff --git a/app/teach/model/Subject.php b/app/teach/model/Subject.php
index 8ea31bd6..0018dae4 100755
--- a/app/teach/model/Subject.php
+++ b/app/teach/model/Subject.php
@@ -15,7 +15,7 @@ class Subject extends BaseModel
,'kaoshi' => ''
,'searchval' => ''
];
- $src = array_cover($srcfrom, $src) ;
+ $src = array_cover($srcfrom, $src);
// 查询数据
$data = $this
@@ -40,6 +40,14 @@ class Subject extends BaseModel
// 获取参加考试的学科
public function kaoshi()
{
+ // 整理变量
+ $src = [
+ 'status' => ''
+ ,'kaoshi' => ''
+ ,'searchval' => ''
+ ];
+ $src = array_cover($srcfrom, $src) ;
+
$data = self::where('kaoshi&status', 1)
->field('id, title, jiancheng, lieming')
->order(['paixu'=>'asc'])
@@ -48,6 +56,7 @@ class Subject extends BaseModel
return $data;
}
+
// 大类别关联
public function sbjCategory()
{
diff --git a/app/teach/route/teach.php b/app/teach/route/teach.php
index e5873395..271ab8b4 100755
--- a/app/teach/route/teach.php
+++ b/app/teach/route/teach.php
@@ -58,6 +58,7 @@ Route::group('subject', function () {
Route::rule('delete','subject/delete','delete'); # 删除信息
Route::rule('status','subject/setStatus','post'); # 删除信息
Route::rule('kaoshi','subject/kaoshi','post'); # 删除信息
+ Route::rule('srccy','subject/srcsbj','post'); # 获取数据
});
diff --git a/app/tools/controller/Index.php b/app/tools/controller/Index.php
index 8537f992..ccc56f8a 100755
--- a/app/tools/controller/Index.php
+++ b/app/tools/controller/Index.php
@@ -169,6 +169,7 @@ class Index extends BaseController
: $src['order'] = SORT_ASC; # 数据排序
$arr = $this->sortArrByManyField($arr, $src['field'], $src['order']);
}
+ // halt($arr);
$limit_start = $src['page'] * $src['limit'] - $src['limit']; # 获取当前页数据
$limit_length = $src['limit'];
$arr = array_slice($arr, $limit_start, $limit_length);
diff --git a/public/static/x-admin2.2/js/createInput.js b/public/static/x-admin2.2/js/createInput.js
index 55562e57..f437ecf9 100644
--- a/public/static/x-admin2.2/js/createInput.js
+++ b/public/static/x-admin2.2/js/createInput.js
@@ -269,6 +269,88 @@ layui.extend({
});
},
+
+ // 放大、缩小图片
+ imgMax: function(obj) {
+ var max;
+ max = $(obj).attr('max');
+ if (max == 0) {
+ $(obj).css("max-width", "800px");
+ $(obj).css("max-height", "1000px");
+ $(obj).attr('max', 1);
+ } else {
+ $(obj).css("max-width", "500px");
+ $(obj).css("max-height", "300px");
+ $(obj).attr('max', 0);
+ }
+ },
+
+
+ // 创建类别的Select
+ subjectSelect: function(myid, value = '', kaoshi='', hasNull = true) {
+ $.ajax({
+ url: '/teach/subject/data',
+ type: 'POST',
+ data: {
+ status:1,
+ kaoshi:kaoshi
+ },
+ success: function(result) {
+ if (hasNull == true) {
+ str = '
';
+ } else {
+ str = '';
+ }
+ temp = "";
+ $(result.data).each(function(i, el) {
+ if (value != '' && value == el.id) {
+ temp = '
';
+ } else {
+ temp = '
';
+ }
+ str = str + temp;
+ });
+ $('#' + myid).append(str);
+ form.render('select');
+ },
+ error: function(result) {
+ layer.msg('数据扔半道啦。', function() {});
+ },
+ });
+ },
+
+
+ // 创建班级checkbox
+ banjiCheckbox: function (myid, data, value, hasAll=true) {
+ $.ajax({
+ url: '/teach/banji/mybanji',
+ type: 'POST',
+ data: data,
+ success: function(result) {
+ $('#' + myid).children().remove();
+ if (hasAll == true) {
+ str = '
';
+ } else {
+ str = '';
+ }
+ temp = "";
+ $(result.data).each(function(i, el) {
+ if (value != '' && value == el.id) {
+ temp = '
';
+ } else {
+ temp = '
';
+ }
+ str = str + temp;
+ });
+ $('#' + myid).append(str);
+ form.render('checkbox');
+ },
+ error: function(result) {
+ layer.msg('数据扔半道啦。', function() {});
+ },
+ });
+ }
+
};
//输出test接口
exports('createInput', obj);