Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录
切换导航
T
taote
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
李达
taote
Commits
2be10d84
提交
2be10d84
authored
8月 31, 2021
作者:
LTSC-20210524KK\Administrator
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
分销和后台开发
上级
d63e9ea2
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
289 行增加
和
25 行删除
+289
-25
TtCode.php
application/admin/controller/TtCode.php
+43
-0
TtLevelReward.php
application/admin/controller/TtLevelReward.php
+90
-1
index.html
application/admin/view/tt_code/index.html
+2
-2
index.html
application/admin/view/tt_distribution/index.html
+2
-2
edit.html
application/admin/view/tt_level_reward/edit.html
+2
-1
index.html
application/admin/view/tt_level_reward/index.html
+2
-2
TtDistribution.php
application/common/model/TtDistribution.php
+20
-0
User.php
application/common/model/User.php
+70
-1
tt_code.js
public/assets/js/backend/tt_code.js
+17
-5
tt_distribution.js
public/assets/js/backend/tt_distribution.js
+22
-7
tt_level_reward.js
public/assets/js/backend/tt_level_reward.js
+19
-4
没有找到文件。
application/admin/controller/TtCode.php
浏览文件 @
2be10d84
...
...
@@ -18,6 +18,8 @@ class TtCode extends Backend
*/
protected
$model
=
null
;
protected
$noNeedRight
=
[
'admin_user'
];
public
function
_initialize
()
{
parent
::
_initialize
();
...
...
@@ -36,5 +38,46 @@ class TtCode extends Backend
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
*/
/**
* 查看
*/
public
function
index
()
{
//设置过滤方法
$this
->
request
->
filter
([
'strip_tags'
,
'trim'
]);
if
(
$this
->
request
->
isAjax
())
{
//如果发送的来源是Selectpage,则转发到Selectpage
if
(
$this
->
request
->
request
(
'keyField'
))
{
return
$this
->
selectpage
();
}
list
(
$where
,
$sort
,
$order
,
$offset
,
$limit
)
=
$this
->
buildparams
();
$list
=
$this
->
model
->
where
(
$where
)
->
order
(
$sort
,
$order
)
->
paginate
(
$limit
);
foreach
(
$list
as
$key
=>
$value
)
{
$list
[
$key
][
'user_id'
]
=
\app\admin\model\User
::
where
(
'id'
,
$value
[
'user_id'
])
->
value
(
'nickname'
);
}
$result
=
array
(
"total"
=>
$list
->
total
(),
"rows"
=>
$list
->
items
());
return
json
(
$result
);
}
return
$this
->
view
->
fetch
();
}
/**
* 搜索下拉框
*/
public
function
admin_user
()
{
$user
=
\app\admin\model\User
::
select
();
$user
=
collection
(
$user
)
->
toArray
();
foreach
(
$user
as
$key
=>
$value
)
{
$user
[
$key
][
'name'
]
=
$value
[
'nickname'
];
}
return
$user
;
}
}
application/admin/controller/TtLevelReward.php
浏览文件 @
2be10d84
...
...
@@ -3,7 +3,15 @@
namespace
app\admin\controller
;
use
app\common\controller\Backend
;
use
app\admin\library\Auth
;
use
Exception
;
use
PhpOffice\PhpSpreadsheet\Cell\Coordinate
;
use
PhpOffice\PhpSpreadsheet\Reader\Xlsx
;
use
PhpOffice\PhpSpreadsheet\Reader\Xls
;
use
PhpOffice\PhpSpreadsheet\Reader\Csv
;
use
think\Db
;
use
think\exception\PDOException
;
use
think\exception\ValidateException
;
/**
* 平级奖励
*
...
...
@@ -36,5 +44,86 @@ class TtLevelReward extends Backend
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
*/
/**
* 查看
*/
public
function
index
()
{
//设置过滤方法
$this
->
request
->
filter
([
'strip_tags'
,
'trim'
]);
if
(
$this
->
request
->
isAjax
())
{
//如果发送的来源是Selectpage,则转发到Selectpage
if
(
$this
->
request
->
request
(
'keyField'
))
{
return
$this
->
selectpage
();
}
list
(
$where
,
$sort
,
$order
,
$offset
,
$limit
)
=
$this
->
buildparams
();
$list
=
$this
->
model
->
where
(
$where
)
->
order
(
$sort
,
$order
)
->
paginate
(
$limit
);
foreach
(
$list
as
$key
=>
$value
)
{
$list
[
$key
][
'group_id'
]
=
\app\admin\model\UserGroup
::
where
(
'id'
,
$value
[
'group_id'
])
->
value
(
'name'
);
}
$result
=
array
(
"total"
=>
$list
->
total
(),
"rows"
=>
$list
->
items
());
return
json
(
$result
);
}
return
$this
->
view
->
fetch
();
}
/**
* 编辑
*/
public
function
edit
(
$ids
=
null
)
{
$row
=
$this
->
model
->
get
(
$ids
);
if
(
!
$row
)
{
$this
->
error
(
__
(
'No Results were found'
));
}
$adminIds
=
$this
->
getDataLimitAdminIds
();
if
(
is_array
(
$adminIds
))
{
if
(
!
in_array
(
$row
[
$this
->
dataLimitField
],
$adminIds
))
{
$this
->
error
(
__
(
'You have no permission'
));
}
}
if
(
$this
->
request
->
isPost
())
{
$params
=
$this
->
request
->
post
(
"row/a"
);
if
(
$params
)
{
$params
=
$this
->
preExcludeFields
(
$params
);
$result
=
false
;
Db
::
startTrans
();
try
{
//是否采用模型验证
if
(
$this
->
modelValidate
)
{
$name
=
str_replace
(
"
\\
model
\\
"
,
"
\\
validate
\\
"
,
get_class
(
$this
->
model
));
$validate
=
is_bool
(
$this
->
modelValidate
)
?
(
$this
->
modelSceneValidate
?
$name
.
'.edit'
:
$name
)
:
$this
->
modelValidate
;
$row
->
validateFailException
(
true
)
->
validate
(
$validate
);
}
$result
=
$row
->
allowField
(
true
)
->
save
(
$params
);
Db
::
commit
();
}
catch
(
ValidateException
$e
)
{
Db
::
rollback
();
$this
->
error
(
$e
->
getMessage
());
}
catch
(
PDOException
$e
)
{
Db
::
rollback
();
$this
->
error
(
$e
->
getMessage
());
}
catch
(
Exception
$e
)
{
Db
::
rollback
();
$this
->
error
(
$e
->
getMessage
());
}
if
(
$result
!==
false
)
{
$this
->
success
();
}
else
{
$this
->
error
(
__
(
'No rows were updated'
));
}
}
$this
->
error
(
__
(
'Parameter %s can not be empty'
,
''
));
}
$this
->
view
->
assign
(
"row"
,
$row
);
$this
->
view
->
assign
(
'group_id'
,
build_select
(
'row[group_id]'
,
\app\admin\model\UserGroup
::
column
(
'id,name'
),
$row
[
'group_id'
],
[
'class'
=>
'form-control selectpicker'
,
'disabled'
]));
return
$this
->
view
->
fetch
();
}
}
application/admin/view/tt_code/index.html
浏览文件 @
2be10d84
...
...
@@ -17,7 +17,7 @@
<div
class=
"widget-body no-padding"
>
<div
id=
"toolbar"
class=
"toolbar"
>
<a
href=
"javascript:;"
class=
"btn btn-primary btn-refresh"
title=
"{:__('Refresh')}"
><i
class=
"fa fa-refresh"
></i>
</a>
<a
href=
"javascript:;"
class=
"btn btn-success btn-add {:$auth->check('tt_code/add')?'':'hide'}"
title=
"{:__('Add')}"
><i
class=
"fa fa-plus"
></i>
{:__('Add')}
</a>
<
!-- <
a href="javascript:;" class="btn btn-success btn-add {:$auth->check('tt_code/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('tt_code/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('tt_code/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('tt_code/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>
...
...
@@ -28,7 +28,7 @@
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
</ul>
</div>
</div>
-->
</div>
...
...
application/admin/view/tt_distribution/index.html
浏览文件 @
2be10d84
...
...
@@ -7,7 +7,7 @@
<div
class=
"widget-body no-padding"
>
<div
id=
"toolbar"
class=
"toolbar"
>
<a
href=
"javascript:;"
class=
"btn btn-primary btn-refresh"
title=
"{:__('Refresh')}"
><i
class=
"fa fa-refresh"
></i>
</a>
<a
href=
"javascript:;"
class=
"btn btn-success btn-add {:$auth->check('tt_distribution/add')?'':'hide'}"
title=
"{:__('Add')}"
><i
class=
"fa fa-plus"
></i>
{:__('Add')}
</a>
<
!-- <
a href="javascript:;" class="btn btn-success btn-add {:$auth->check('tt_distribution/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('tt_distribution/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('tt_distribution/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('tt_distribution/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>
...
...
@@ -18,7 +18,7 @@
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
</ul>
</div>
</div>
-->
</div>
...
...
application/admin/view/tt_level_reward/edit.html
浏览文件 @
2be10d84
...
...
@@ -3,7 +3,8 @@
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Group_id')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-group_id"
data-rule=
"required"
data-source=
"group/index"
class=
"form-control selectpage"
name=
"row[group_id]"
type=
"text"
value=
"{$row.group_id|htmlentities}"
>
{$group_id}
<!-- <input id="c-group_id" data-rule="required" data-source="group/index" class="form-control selectpage" name="row[group_id]" type="text" value="{$row.group_id|htmlentities}"> -->
</div>
</div>
<div
class=
"form-group"
>
...
...
application/admin/view/tt_level_reward/index.html
浏览文件 @
2be10d84
...
...
@@ -7,7 +7,7 @@
<div
class=
"widget-body no-padding"
>
<div
id=
"toolbar"
class=
"toolbar"
>
<a
href=
"javascript:;"
class=
"btn btn-primary btn-refresh"
title=
"{:__('Refresh')}"
><i
class=
"fa fa-refresh"
></i>
</a>
<a
href=
"javascript:;"
class=
"btn btn-success btn-add {:$auth->check('tt_level_reward/add')?'':'hide'}"
title=
"{:__('Add')}"
><i
class=
"fa fa-plus"
></i>
{:__('Add')}
</a>
<
!-- <
a href="javascript:;" class="btn btn-success btn-add {:$auth->check('tt_level_reward/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('tt_level_reward/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('tt_level_reward/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('tt_level_reward/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>
...
...
@@ -18,7 +18,7 @@
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
</ul>
</div>
</div>
-->
</div>
...
...
application/common/model/TtDistribution.php
0 → 100644
浏览文件 @
2be10d84
<?php
namespace
app\common\model
;
use
think\Model
;
/**
* 三级分销
*/
class
TtDistribution
Extends
Model
{
// 开启自动写入时间戳字段
protected
$autoWriteTimestamp
=
'int'
;
// 定义时间戳字段名
protected
$updateTime
=
false
;
// 追加属性
protected
$append
=
[
];
}
application/common/model/User.php
浏览文件 @
2be10d84
...
...
@@ -3,7 +3,6 @@
namespace
app\common\model
;
use
think\Model
;
/**
* 会员模型
*/
...
...
@@ -160,4 +159,74 @@ class User extends Model
}
}
/**
* 三级分销
* @param int $money 金额
* @param int $user_id 用户
*/
public
static
function
distribution
(
$money
,
$user_id
)
{
// 查询用户信息
$user
=
self
::
get
(
$user_id
);
if
(
!
$user
){
return
$this
->
error
(
__
(
'没有此用户'
));
}
// 查询三级分销比例
$distribution
=
TtDistribution
::
where
(
'id'
,
1
)
->
find
();
// 计算分销金额
$distribution_money
=
$money
*
(
$distribution
[
'primary_distribution'
]
/
100
+
$distribution
[
'secondary_distribution'
]
/
100
+
$distribution
[
'third_distribution'
]
/
100
);
// 计算现有余额扣除分销金额
$now_money
=
$user
->
money
+
(
$money
-
$distribution_money
);
// 更新用户的余额
$user_money
=
self
::
where
(
'id'
,
$user_id
)
->
update
([
'money'
=>
$now_money
])
// 一级分销开始
if
(
$user
->
parent_id
!=
0
){
// 查询我的直属上级
$first_level
=
self
::
where
(
'id'
,
$user
->
parent_id
)
->
find
();
// 计算直属上级的余额加上分销的金额
$first_distribution
=
$money
*
(
$distribution
[
'primary_distribution'
]
/
100
)
+
$first_level
[
'money'
];
// 更新直属上级的余额
$first_user_money
=
self
::
where
(
'id'
,
$first_level
[
'id'
])
->
update
([
'money'
=>
$first_distribution
]);
// 写入余额变动日志
if
(
$first_user_money
){
MoneyLog
::
create
([
'user_id'
=>
$first_level
[
'id'
],
'money'
=>
$money
*
(
$distribution
[
'primary_distribution'
]
/
100
),
'before'
=>
$first_level
[
'money'
],
'after'
=>
$first_user_money
,
'memo'
=>
'直属上级获得佣金'
]);
}
//二级分销开始
if
(
$first_level
[
'parent_id'
]
!=
0
){
// 查询我上级的上级
$second_level
=
self
::
where
(
'id'
,
$first_level
[
'parent_id'
])
->
find
();
// 计算二级上级的余额加上分销的金额
$second_distribution
=
$money
*
(
$distribution
[
'secondary_distribution'
]
/
100
)
+
$second_level
[
'money'
];
// 更新二级上级的余额
$second_user_money
=
self
::
where
(
'id'
,
$second_level
[
'id'
])
->
update
([
'money'
=>
$second_distribution
]);
// 写入余额变动日志
if
(
$second_user_money
){
MoneyLog
::
create
([
'user_id'
=>
$second_level
[
'id'
],
'money'
=>
$money
*
(
$distribution
[
'secondary_distribution'
]
/
100
),
'before'
=>
$second_level
[
'money'
],
'after'
=>
$second_user_money
,
'memo'
=>
'二级上级获得佣金'
]);
}
//三级分销开始
if
(
$second_level
[
'parent_id'
]
!=
0
){
// 查询我上级的上级的上级
$third_level
=
self
::
where
(
'id'
,
$second_level
[
'parent_id'
])
->
find
();
// 计算三级上级的余额加上分销的金额
$third_distribution
=
$money
*
(
$distribution
[
'third_distribution'
]
/
100
)
+
$third_level
[
'money'
];
// 更新三级上级的余额
$third_user_money
=
self
::
where
(
'id'
,
$third_level
[
'id'
])
->
update
([
'money'
=>
$third_distribution
]);
// 写入余额变动日志
if
(
$third_user_money
){
MoneyLog
::
create
([
'user_id'
=>
$third_level
[
'id'
],
'money'
=>
$money
*
(
$distribution
[
'third_distribution'
]
/
100
),
'before'
=>
$third_level
[
'money'
],
'after'
=>
$third_user_money
,
'memo'
=>
'三级上级获得佣金'
]);
}
}
//三级分销技术
}
//二级分销结束
}
//一级分销结束
if
(
$user_money
){
// 写入余额变动日志
MoneyLog
::
create
([
'user_id'
=>
$user_id
,
'money'
=>
$money
-
$distribution_money
,
'before'
=>
$user
->
money
,
'after'
=>
$now_money
,
'memo'
=>
'分销获得佣金'
]);
return
true
;
}
else
{
return
false
;
}
}
}
public/assets/js/backend/tt_code.js
浏览文件 @
2be10d84
...
...
@@ -22,15 +22,27 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
url
:
$
.
fn
.
bootstrapTable
.
defaults
.
extend
.
index_url
,
pk
:
'id'
,
sortName
:
'id'
,
// 搜索按钮框展开
searchFormVisible
:
true
,
// 隐藏搜索按钮
showSearch
:
false
,
//隐藏搜索框
search
:
false
,
//隐藏切换按钮
showToggle
:
false
,
//隐藏列按钮
showColumns
:
false
,
//隐藏导出按钮
showExport
:
false
,
columns
:
[
[
{
checkbox
:
true
},
{
field
:
'id'
,
title
:
__
(
'Id'
)},
{
field
:
'code'
,
title
:
__
(
'Code'
)},
{
field
:
'user_id'
,
title
:
__
(
'User_id'
)},
//
{checkbox: true},
{
field
:
'id'
,
title
:
__
(
'Id'
)
,
operate
:
false
},
{
field
:
'code'
,
title
:
__
(
'Code'
)
,
operate
:
'LIKE'
},
{
field
:
'user_id'
,
title
:
__
(
'User_id'
)
,
searchList
:
$
.
getJSON
(
'tt_code/admin_user'
)
},
{
field
:
'update_time'
,
title
:
__
(
'Update_time'
),
operate
:
'RANGE'
,
addclass
:
'datetimerange'
,
autocomplete
:
false
,
formatter
:
Table
.
api
.
formatter
.
datetime
},
{
field
:
'status'
,
title
:
__
(
'Status'
),
searchList
:
{
"0"
:
__
(
'Status 0'
),
"1"
:
__
(
'Status 1'
)},
formatter
:
Table
.
api
.
formatter
.
status
},
{
field
:
'operate'
,
title
:
__
(
'Operate'
),
table
:
table
,
events
:
Table
.
api
.
events
.
operate
,
formatter
:
Table
.
api
.
formatter
.
operate
}
//
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
]
});
...
...
public/assets/js/backend/tt_distribution.js
浏览文件 @
2be10d84
...
...
@@ -6,9 +6,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
Table
.
api
.
init
({
extend
:
{
index_url
:
'tt_distribution/index'
+
location
.
search
,
add_url
:
'tt_distribution/add'
,
//
add_url: 'tt_distribution/add',
edit_url
:
'tt_distribution/edit'
,
del_url
:
'tt_distribution/del'
,
//
del_url: 'tt_distribution/del',
multi_url
:
'tt_distribution/multi'
,
import_url
:
'tt_distribution/import'
,
table
:
'tt_distribution'
,
...
...
@@ -22,13 +22,23 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
url
:
$
.
fn
.
bootstrapTable
.
defaults
.
extend
.
index_url
,
pk
:
'id'
,
sortName
:
'id'
,
// 隐藏搜索按钮
showSearch
:
false
,
//隐藏搜索框
search
:
false
,
//隐藏切换按钮
showToggle
:
false
,
//隐藏列按钮
showColumns
:
false
,
//隐藏导出按钮
showExport
:
false
,
columns
:
[
[
{
checkbox
:
true
},
{
field
:
'id'
,
title
:
__
(
'Id'
)},
{
field
:
'primary_distribution'
,
title
:
__
(
'Primary_distribution'
)},
{
field
:
'secondary_distribution'
,
title
:
__
(
'Secondary_distribution'
)},
{
field
:
'third_distribution'
,
title
:
__
(
'Third_distribution'
)},
//
{checkbox: true},
//
{field: 'id', title: __('Id')},
{
field
:
'primary_distribution'
,
title
:
__
(
'Primary_distribution'
)
,
formatter
:
Controller
.
api
.
formatter
.
percent
},
{
field
:
'secondary_distribution'
,
title
:
__
(
'Secondary_distribution'
)
,
formatter
:
Controller
.
api
.
formatter
.
percent
},
{
field
:
'third_distribution'
,
title
:
__
(
'Third_distribution'
)
,
formatter
:
Controller
.
api
.
formatter
.
percent
},
{
field
:
'operate'
,
title
:
__
(
'Operate'
),
table
:
table
,
events
:
Table
.
api
.
events
.
operate
,
formatter
:
Table
.
api
.
formatter
.
operate
}
]
]
...
...
@@ -46,6 +56,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
api
:
{
bindevent
:
function
()
{
Form
.
api
.
bindevent
(
$
(
"form[role=form]"
));
},
formatter
:
{
percent
:
function
(
value
,
row
)
{
return
'<span>'
+
value
+
'%</span>'
;
}
}
}
};
...
...
public/assets/js/backend/tt_level_reward.js
浏览文件 @
2be10d84
...
...
@@ -8,7 +8,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
index_url
:
'tt_level_reward/index'
+
location
.
search
,
add_url
:
'tt_level_reward/add'
,
edit_url
:
'tt_level_reward/edit'
,
del_url
:
'tt_level_reward/del'
,
//
del_url: 'tt_level_reward/del',
multi_url
:
'tt_level_reward/multi'
,
import_url
:
'tt_level_reward/import'
,
table
:
'tt_level_reward'
,
...
...
@@ -22,12 +22,22 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
url
:
$
.
fn
.
bootstrapTable
.
defaults
.
extend
.
index_url
,
pk
:
'id'
,
sortName
:
'id'
,
// 隐藏搜索按钮
showSearch
:
false
,
//隐藏搜索框
search
:
false
,
//隐藏切换按钮
showToggle
:
false
,
//隐藏列按钮
showColumns
:
false
,
//隐藏导出按钮
showExport
:
false
,
columns
:
[
[
{
checkbox
:
true
},
{
field
:
'id'
,
title
:
__
(
'Id'
)},
//
{checkbox: true},
//
{field: 'id', title: __('Id')},
{
field
:
'group_id'
,
title
:
__
(
'Group_id'
)},
{
field
:
'price'
,
title
:
__
(
'Price'
),
operate
:
'BETWEEN'
},
{
field
:
'price'
,
title
:
__
(
'Price'
),
operate
:
'BETWEEN'
,
formatter
:
Controller
.
api
.
formatter
.
company
},
{
field
:
'operate'
,
title
:
__
(
'Operate'
),
table
:
table
,
events
:
Table
.
api
.
events
.
operate
,
formatter
:
Table
.
api
.
formatter
.
operate
}
]
]
...
...
@@ -45,6 +55,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
api
:
{
bindevent
:
function
()
{
Form
.
api
.
bindevent
(
$
(
"form[role=form]"
));
},
formatter
:
{
company
:
function
(
value
,
row
)
{
return
'<span>'
+
value
+
'元/单</span>'
;
}
}
}
};
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论