+
{:build_heading(null,FALSE)}
-
- {foreach name="statusList" item="vo"}
- - {$vo}
+
diff --git a/application/common/model/user4s/Visit.php b/application/common/model/user4s/Visit.php
index 6c98f54..72daf2a 100644
--- a/application/common/model/user4s/Visit.php
+++ b/application/common/model/user4s/Visit.php
@@ -4,6 +4,7 @@ namespace app\common\model\user4s;
use think\Model;
use traits\model\SoftDelete;
+use app\common\model\user4s\Visittype;
class Visit extends Model
{
@@ -27,10 +28,20 @@ class Visit extends Model
protected $append = [
'visittime_text',
'status_text',
+ 'type_text',
];
-
-
+ public function getTypeList()
+ {
+ $all_type = Visittype::where('id','>',0)->column('id,name');
+ return $all_type;
+ }
+ public function getTypeTextAttr($value, $data)
+ {
+ $value = $value ? $value : (isset($data['type_id']) ? $data['type_id'] : '');
+ $list = $this->getTypeList();
+ return isset($list[$value]) ? $list[$value] : '';
+ }
public function getStatusList()
{
diff --git a/application/extra/site.php b/application/extra/site.php
index 6a59e39..00e4233 100644
--- a/application/extra/site.php
+++ b/application/extra/site.php
@@ -4,7 +4,7 @@ return array (
'name' => '会员管理',
'beian' => '',
'cdnurl' => '',
- 'version' => '1.0.3',
+ 'version' => '1.0.4',
'timezone' => 'Asia/Shanghai',
'forbiddenip' => '',
'languages' =>
diff --git a/public/assets/js/backend/dashboard.js b/public/assets/js/backend/dashboard.js
index e97c176..9e06365 100644
--- a/public/assets/js/backend/dashboard.js
+++ b/public/assets/js/backend/dashboard.js
@@ -71,7 +71,7 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'table', 'echarts', 'echart
//['red', 'green', 'yellow', 'blue', 'teal', 'orange', 'purple']
if (Config.index_data.visit > 0) {
top.window.Backend.api.sidebar({
- 'user4s/visit': [Config.index_data.visit, 'red', 'badge']
+ 'user4s/visit?status=0': [Config.index_data.visit, 'red', 'badge']
});
}
// if (Config.index_data.all_visit > 0) {
diff --git a/public/assets/js/backend/user4s/visit.js b/public/assets/js/backend/user4s/visit.js
index f5e6a70..ef93d6a 100644
--- a/public/assets/js/backend/user4s/visit.js
+++ b/public/assets/js/backend/user4s/visit.js
@@ -130,13 +130,18 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'editable'], function
var filter = JSON.parse(params.filter);
var op = JSON.parse(params.op);
//这里可以动态赋值,比如从URL中获取admin_id的值,filter.admin_id=Fast.api.query('admin_id');
- filter.user4s_id = Fast.api.query('user4s_id');
- op.user4s_id = "=";
- if (filter.user4s_id == null || filter.user4s_id == "") {
- delete filter.user4s_id;
- delete op.user4s_id;
+ filter.status = Fast.api.query('status');
+ op.status = "=";
+ if (filter.status == null || filter.status == "") {
+ delete filter.status;
+ delete op.status;
+ }
+ filter.type_id = Fast.api.query('type_id');
+ op.type_id = "=";
+ if (filter.type_id == null || filter.type_id == "") {
+ delete filter.type_id;
+ delete op.type_id;
}
-
params.filter = JSON.stringify(filter);
params.op = JSON.stringify(op);
console.log(params);
@@ -146,6 +151,51 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'editable'], function
// 为表格绑定事件
Table.api.bindevent(table);
+ // 绑定TAB事件
+ $('.nav-tabs a[data-toggle="tab"]', table.closest(".panel-intro")).on('shown.bs.tab', function (e) {
+ var that = $(this);
+ var options = table.bootstrapTable('getOptions');
+ var queryParams = options.queryParams;
+ options.pageNumber = 1;
+ options.queryParams = function (params) {
+ //这一行必须要存在,否则在点击下一页时会丢失搜索栏数据
+ params = queryParams(params);
+
+ //如果希望追加搜索条件,可使用
+ var filter = params.filter ? JSON.parse(params.filter) : {}; //参数
+ var op = params.op ? JSON.parse(params.op) : {}; //符号
+ //console.log(that.data("value"),'tab');
+ if (that.data("value")) {
+ filter['type_id'] = that.data("value");
+ op['type_id'] = '=';
+ }
+ if (that.data("value") == -99) {
+ delete filter['type_id'];
+ delete op['type_id'];
+ }
+ // 逾期状态
+ // if (that.data("isyuqi") == 1) {
+ // filter['status'] = 10;
+
+ // var mydate = new Date();
+ // var date = "" + mydate.getFullYear() + "-";
+ // date += (mydate.getMonth() + 1) + "-";
+ // date += mydate.getDate();
+
+ // filter['repayment_date'] = date;
+ // op['repayment_date'] = '<';
+ // }
+
+ params.filter = JSON.stringify(filter);
+ params.op = JSON.stringify(op);
+ console.log(params,'tab');
+ return params;
+ };
+ table.trigger("uncheckbox");
+ table.bootstrapTable('refresh', { pageNumber: 1 });
+ return false;
+ });
+
// 添加按钮事件
$(document).on('click', '.btn-add2', function () {
var ids = Table.api.selectedids(table);