Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
introducer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sugar
introducer
Commits
0a6d3213
Commit
0a6d3213
authored
Jun 25, 2023
by
sugar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
易购商家后台
parent
d6bf9ad5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
117 additions
and
0 deletions
+117
-0
application/admin/controller/users/Users.php
application/admin/controller/users/Users.php
+79
-0
application/admin/view/users/users/shopping_money.html
application/admin/view/users/users/shopping_money.html
+31
-0
public/assets/js/backend/users/users.js
public/assets/js/backend/users/users.js
+7
-0
No files found.
application/admin/controller/users/Users.php
View file @
0a6d3213
...
@@ -114,6 +114,85 @@ class Users extends Backend
...
@@ -114,6 +114,85 @@ class Users extends Backend
$this
->
view
->
assign
(
"row"
,
$row
);
$this
->
view
->
assign
(
"row"
,
$row
);
return
$this
->
view
->
fetch
();
return
$this
->
view
->
fetch
();
}
}
public
function
editShoppingMoney
(
$ids
=
null
)
{
$row
=
$this
->
model
->
get
([
'id'
=>
$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
)
{
$money
=
$params
[
'shopping_money'
];
// $charge_device_sn = $params['charge_device_sn'];
if
(
$params
[
'shopping_money'
]
==
0
)
{
$this
->
error
(
'请输入正确的购物金数'
);
}
if
((
$row
[
'shopping_money'
]
+
$params
[
'shopping_money'
])
<
0
)
{
$this
->
error
(
'余额不足!'
);
}
if
(
!
$params
[
'intro'
]
||
empty
(
$params
[
'intro'
]))
{
$this
->
error
(
'请填写操作备注!'
);
}
$createtime
=
time
();
//组合订单信息
$data
=
[
'order_sn'
=>
self
::
getOrderSn
(),
'user_id'
=>
$row
[
'id'
],
'nickname'
=>
''
,
'mobile'
=>
''
,
'total_price'
=>
$money
,
'need_pay'
=>
$money
,
'device_sign'
=>
''
,
'order_type'
=>
$params
[
'order_type'
],
'status'
=>
4
,
'createtime'
=>
$createtime
,
'endtime'
=>
$createtime
,
'billingType'
=>
-
1
,
'chargingElec'
=>
0
,
'chargingGroupName'
=>
''
,
'chargingName'
=>
''
,
'chargingPower'
=>
0
,
'chargingTime'
=>
0
,
'consumeCount'
=>
0
,
'consumeTime'
=>
0
,
'socketCode'
=>
0
,
'code'
=>
0
];
$order
=
Order
::
create
(
$data
);
//给对应的代理商分佣
$this
->
model
->
where
([
'id'
=>
$row
[
'id'
]])
->
setInc
(
'shopping_money'
,
$money
);
$data
=
[
'user_id'
=>
$row
[
'id'
],
'money'
=>
$money
,
'before'
=>
$row
[
'shopping_money'
],
'after'
=>
$row
[
'shopping_money'
]
+
$money
,
'memo'
=>
$params
[
'intro'
],
'type'
=>
$params
[
'order_type'
],
'createtime'
=>
$createtime
,
'order_id'
=>
$order
[
'id'
]
];
UserMoneyLog
::
create
(
$data
);
$this
->
success
();
}
else
{
$this
->
error
(
'数据错误,请重新打开窗口!user_id'
,
$row
[
'id'
]);
}
}
$this
->
view
->
assign
(
"row"
,
$row
);
return
$this
->
view
->
fetch
();
}
/**
* @return string
* 订单编号
*/
public
static
function
getOrderSn
()
public
static
function
getOrderSn
()
{
{
$order_sn
=
date
(
'YmdHis'
)
.
rand
(
100000000000000000
,
999999999999999999
);
$order_sn
=
date
(
'YmdHis'
)
.
rand
(
100000000000000000
,
999999999999999999
);
...
...
application/admin/view/users/users/shopping_money.html
0 → 100644
View file @
0a6d3213
<form
id=
"editMoney-form"
class=
"form-horizontal"
role=
"form"
data-toggle=
"validator"
method=
"POST"
action=
""
>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('购物金')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-Shopping_money"
class=
"form-control"
name=
"row[shopping_money]"
type=
"number"
>
{:__('减少请输入负数')}
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('说明')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<textarea
id=
"c-Intro"
class=
"form-control"
name=
"row[intro]"
></textarea>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('类型')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<select
id=
"c-order_type"
class=
"form-control selectpicker"
name=
"row[order_type]"
>
<option
value=
"7"
>
服务奖励
</option>
<option
value=
"8"
>
推广奖励
</option>
</select>
</div>
</div>
<div
class=
"form-group layer-footer"
>
<label
class=
"control-label col-xs-12 col-sm-2"
></label>
<div
class=
"col-xs-12 col-sm-8"
>
<button
type=
"submit"
class=
"btn btn-success btn-embossed"
>
{:__('OK')}
</button>
<button
type=
"reset"
class=
"btn btn-default btn-embossed"
>
{:__('Reset')}
</button>
</div>
</div>
</form>
\ No newline at end of file
public/assets/js/backend/users/users.js
View file @
0a6d3213
...
@@ -59,6 +59,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
...
@@ -59,6 +59,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
classname
:
'
btn btn-xs btn-warning btn-dialog
'
,
classname
:
'
btn btn-xs btn-warning btn-dialog
'
,
url
:
'
users/users/editMoney
'
,
url
:
'
users/users/editMoney
'
,
},
},
{
name
:
'
editmoney
'
,
text
:
__
(
'
购物金
'
),
title
:
__
(
'
购物金
'
),
classname
:
'
btn btn-xs btn-warning btn-dialog
'
,
url
:
'
users/users/editMoney
'
,
},
],
events
:
Table
.
api
.
events
.
operate
,
formatter
:
Table
.
api
.
formatter
.
operate
],
events
:
Table
.
api
.
events
.
operate
,
formatter
:
Table
.
api
.
formatter
.
operate
}
}
]
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment