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
c4e05a4d
Commit
c4e05a4d
authored
Oct 20, 2023
by
sugar
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://rungit.jxdsy.cn:10000/sugar/introducer
into dev
parents
fb01b094
239faa5a
Changes
22
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
502 additions
and
134 deletions
+502
-134
application/admin/controller/device/Chargegroup.php
application/admin/controller/device/Chargegroup.php
+3
-1
application/admin/controller/device/Site.php
application/admin/controller/device/Site.php
+73
-5
application/admin/controller/shopro/order/Goodsorder.php
application/admin/controller/shopro/order/Goodsorder.php
+2
-0
application/admin/controller/users/Agent.php
application/admin/controller/users/Agent.php
+1
-1
application/admin/controller/users/Withdraw.php
application/admin/controller/users/Withdraw.php
+2
-2
application/admin/lang/zh-cn/users/agent.php
application/admin/lang/zh-cn/users/agent.php
+13
-0
application/admin/lang/zh-cn/users/users.php
application/admin/lang/zh-cn/users/users.php
+12
-1
application/admin/model/users/Agent.php
application/admin/model/users/Agent.php
+21
-1
application/admin/model/users/Users.php
application/admin/model/users/Users.php
+10
-0
application/admin/view/device/site/authorizedevice.html
application/admin/view/device/site/authorizedevice.html
+36
-0
application/admin/view/device/site/index.html
application/admin/view/device/site/index.html
+11
-1
application/admin/view/users/agent/add.html
application/admin/view/users/agent/add.html
+12
-0
application/admin/view/users/agent/edit.html
application/admin/view/users/agent/edit.html
+12
-0
application/admin/view/users/users/edit.html
application/admin/view/users/users/edit.html
+25
-0
application/api/controller/Users.php
application/api/controller/Users.php
+32
-2
application/api/controller/shopro/Commission.php
application/api/controller/shopro/Commission.php
+3
-3
application/api/controller/shopro/Goodsorder.php
application/api/controller/shopro/Goodsorder.php
+105
-86
application/common/library/wechat/certs/xld_apiclient_cert.pem
...cation/common/library/wechat/certs/xld_apiclient_cert.pem
+25
-0
application/common/library/wechat/certs/xld_apiclient_key.pem
...ication/common/library/wechat/certs/xld_apiclient_key.pem
+28
-0
application/config.php
application/config.php
+17
-7
application/extra/site.php
application/extra/site.php
+29
-9
public/assets/js/backend/device/site.js
public/assets/js/backend/device/site.js
+30
-15
No files found.
application/admin/controller/device/Chargegroup.php
View file @
c4e05a4d
...
...
@@ -55,8 +55,10 @@ class Chargegroup extends Backend
}
[
$where
,
$sort
,
$order
,
$offset
,
$limit
]
=
$this
->
buildparams
();
$list
=
$this
->
model
->
alias
(
'cg'
)
->
field
(
'*,(select count(1) from ycz_charge_device as cd where user_id=0 and authorizestatus=1 and cd.group_id=cg.id) as remain_units'
)
->
where
(
$where
)
->
order
(
$sort
,
$order
)
->
order
(
'remain_units desc'
)
->
paginate
(
$limit
);
foreach
(
$list
as
$key
=>
$val
){
$list
[
$key
][
'remain_units'
]
=
$this
->
Chargedevicemodel
->
where
([
'group_id'
=>
$val
[
'id'
],
'authorizestatus'
=>
1
])
->
count
();
...
...
application/admin/controller/device/Site.php
View file @
c4e05a4d
...
...
@@ -26,6 +26,7 @@ class Site extends Backend
parent
::
_initialize
();
$this
->
model
=
new
\app\admin\model\device\Site
;
$this
->
Chargegroupmodel
=
new
\app\admin\model\device\Chargegroup
();
$this
->
Chargedevicemodel
=
new
\app\admin\model\device\Chargedevice
();
$this
->
view
->
assign
(
"statusList"
,
$this
->
model
->
getStatusList
());
}
...
...
@@ -95,11 +96,11 @@ class Site extends Backend
$validate
=
is_bool
(
$this
->
modelValidate
)
?
(
$this
->
modelSceneValidate
?
$name
.
'.add'
:
$name
)
:
$this
->
modelValidate
;
$this
->
model
->
validateFailException
()
->
validate
(
$validate
);
}
$group_name
=
$this
->
Chargegroupmodel
->
where
([
'id'
=>
$params
[
'group_id'
]])
->
value
(
'group_name'
);
$group_name
=
$this
->
Chargegroupmodel
->
where
([
'id'
=>
$params
[
'group_id'
]])
->
value
(
'group_name'
);
$params
[
'area_name'
]
=
$group_name
;
$result
=
$this
->
model
->
allowField
(
true
)
->
save
(
$params
);
Db
::
commit
();
}
catch
(
ValidateException
|
PDOException
|
Exception
$e
)
{
}
catch
(
ValidateException
|
PDOException
|
Exception
$e
)
{
Db
::
rollback
();
$this
->
error
(
$e
->
getMessage
());
}
...
...
@@ -145,11 +146,11 @@ class Site extends Backend
$validate
=
is_bool
(
$this
->
modelValidate
)
?
(
$this
->
modelSceneValidate
?
$name
.
'.edit'
:
$name
)
:
$this
->
modelValidate
;
$row
->
validateFailException
()
->
validate
(
$validate
);
}
$group_name
=
$this
->
Chargegroupmodel
->
where
([
'id'
=>
$params
[
'group_id'
]])
->
value
(
'group_name'
);
$group_name
=
$this
->
Chargegroupmodel
->
where
([
'id'
=>
$params
[
'group_id'
]])
->
value
(
'group_name'
);
$params
[
'area_name'
]
=
$group_name
;
$result
=
$row
->
allowField
(
true
)
->
save
(
$params
);
Db
::
commit
();
}
catch
(
ValidateException
|
PDOException
|
Exception
$e
)
{
}
catch
(
ValidateException
|
PDOException
|
Exception
$e
)
{
Db
::
rollback
();
$this
->
error
(
$e
->
getMessage
());
}
...
...
@@ -158,6 +159,73 @@ class Site extends Backend
}
$this
->
success
();
}
/**
* 授权设备
*
* @return string
* @throws \think\Exception
*/
public
function
authorizedevice
()
{
if
(
false
===
$this
->
request
->
isPost
())
{
return
$this
->
view
->
fetch
();
}
$params
=
$this
->
request
->
post
(
'row/a'
);
if
(
empty
(
$params
))
{
$this
->
error
(
__
(
'Parameter %s can not be empty'
,
''
));
}
$params
=
$this
->
preExcludeFields
(
$params
);
if
(
$this
->
dataLimit
&&
$this
->
dataLimitFieldAutoFill
)
{
$params
[
$this
->
dataLimitField
]
=
$this
->
auth
->
id
;
}
$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
.
'.add'
:
$name
)
:
$this
->
modelValidate
;
$this
->
model
->
validateFailException
()
->
validate
(
$validate
);
}
//判断设备数量够不够
$deviceAmount
=
$this
->
Chargedevicemodel
->
where
([
'user_id'
=>
0
,
'authorizestatus'
=>
1
,
'group_id'
=>
$params
[
'group_id'
]])
->
count
(
'1'
);
if
(
$params
[
'amount'
]
>
$deviceAmount
)
{
Db
::
rollback
();
$this
->
error
(
"当前选择小区可授权设备不足!只剩"
.
$deviceAmount
);
}
$site
=
$this
->
model
->
where
([
'agent_user_id'
=>
$params
[
'agent_user_id'
],
'group_id'
=>
$params
[
'group_id'
]])
->
find
();
if
(
!
$site
)
{
$deviceInfo
=
$this
->
Chargedevicemodel
->
where
([
'user_id'
=>
0
,
'authorizestatus'
=>
1
,
'group_id'
=>
$params
[
'group_id'
]])
->
find
();
$siteData
=
[
'agent_user_id'
=>
$params
[
'agent_user_id'
],
'province_id'
=>
$deviceInfo
[
'province_id'
],
'city_id'
=>
$deviceInfo
[
'city_id'
],
'area_id'
=>
$deviceInfo
[
'area_id'
],
'area_name'
=>
$deviceInfo
[
'area_name'
],
'createtime'
=>
time
(),
'status'
=>
1
,
'group_id'
=>
$deviceInfo
[
'group_id'
]
];
$site
=
$this
->
model
->
create
(
$siteData
);
}
if
(
!
$site
)
{
$this
->
error
(
"当前桩主未开通"
.
$deviceInfo
[
'area_name'
]
.
"站点权限,请手动开通"
);
}
$update_arr
[
'user_id'
]
=
$params
[
'agent_user_id'
];
$update_arr
[
'authorizestatus'
]
=
2
;
$update_arr
[
'authorizetime'
]
=
strtotime
(
date
(
'Y-m-d'
))
+
86400
;
$update_arr
[
'site_id'
]
=
$site
[
'id'
];
$this
->
Chargedevicemodel
->
where
([
'user_id'
=>
0
,
'authorizestatus'
=>
1
,
'group_id'
=>
$params
[
'group_id'
]])
->
limit
(
$params
[
'amount'
])
->
update
(
$update_arr
);
Db
::
commit
();
$this
->
success
(
'操作成功'
);
}
catch
(
ValidateException
|
PDOException
|
Exception
$e
)
{
Db
::
rollback
();
$this
->
error
(
$e
->
getMessage
());
}
if
(
$result
===
false
)
{
$this
->
error
(
__
(
'No rows were inserted'
));
}
$this
->
success
();
}
}
application/admin/controller/shopro/order/Goodsorder.php
View file @
c4e05a4d
...
...
@@ -178,6 +178,8 @@ class Goodsorder extends Backend
'DBL'
=>
'德邦快递'
,
'ZJS'
=>
'宅急送'
,
'TNT'
=>
'TNT快递'
,
'JT'
=>
'极兔快递'
,
'ZT'
=>
'自提订单'
];
$order_id
=
$this
->
request
->
param
(
'ids'
);
$this
->
view
->
assign
(
'groupdata'
,
$groupdata
);
...
...
application/admin/controller/users/Agent.php
View file @
c4e05a4d
...
...
@@ -28,7 +28,7 @@ class Agent extends Backend
$this
->
Usersmodel
=
new
\app\admin\model\users\Users
();
$this
->
view
->
assign
(
"statusList"
,
$this
->
model
->
getStatusList
());
$this
->
view
->
assign
(
"typeList"
,
$this
->
model
->
getTypeList
());
$this
->
view
->
assign
(
"levelList"
,
$this
->
model
->
getLevelList
());
}
...
...
application/admin/controller/users/Withdraw.php
View file @
c4e05a4d
...
...
@@ -210,7 +210,7 @@ class Withdraw extends Backend
$bankcard
=
$this
->
Bankcardmodel
->
where
([
'id'
=>
$val
[
'bankcard_id'
]])
->
find
();
switch
(
$val
[
'withdraw_way'
]){
case
1
://
提现至零钱
$result
=
$wxpayConstants
->
enterprisePayment
(
$usersinfo
[
'wx_openid'
],
$desc
,
$val
[
'cash_sn'
],
$val
[
'money'
],
$val
[
'name'
],
$jsonMap
);
$result
=
$wxpayConstants
->
crteateMchPayV2
(
$usersinfo
[
'wx_openid'
],
$desc
,
$val
[
'cash_sn'
],
$val
[
'money'
],
$val
[
'name'
],
$jsonMap
);
break
;
case
2
://
提现至银行卡
if
(
$withraw_money
<=
1000
*
100
){
...
...
@@ -288,7 +288,7 @@ class Withdraw extends Backend
}
switch
(
$row
[
'withdraw_way'
]){
case
1
://
提现至零钱
$result
=
$wxpayConstants
->
enterprisePayment
(
$usersinfo
[
'wx_openid'
],
$desc
,
$row
[
'cash_sn'
],
$row
[
'money'
],
$row
[
'name'
],
$jsonMap
);
$result
=
$wxpayConstants
->
crteateMchPayV2
(
$usersinfo
[
'wx_openid'
],
$desc
,
$row
[
'cash_sn'
],
$row
[
'money'
],
$row
[
'name'
],
$jsonMap
);
break
;
case
2
://
提现至银行卡
if
(
$withraw_money
<=
1000
*
100
){
...
...
application/admin/lang/zh-cn/users/agent.php
View file @
c4e05a4d
<?php
/*
* @Author: taowj 965042433@qq.com
* @Date: 2022-11-08 16:21:34
* @LastEditors: taowj 965042433@qq.com
* @LastEditTime: 2023-08-30 15:01:36
* @FilePath: \introducer\application\admin\lang\zh-cn\users\agent.php
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
return
[
'Id'
=>
'id'
,
...
...
@@ -29,4 +37,9 @@ return [
'Authorizestatus 1'
=>
'未授权'
,
'Authorizestatus 2'
=>
'已授权'
,
'Authorizetime'
=>
'授权时间'
,
'Level'
=>
'商城代理级别'
,
'Level 0'
=>
'普通人'
,
'Level 1'
=>
'团长'
,
'Level 2'
=>
'区县代理'
,
'Level 3'
=>
'市代理'
,
];
application/admin/lang/zh-cn/users/users.php
View file @
c4e05a4d
<?php
/*
* @Author: taowj 965042433@qq.com
* @Date: 2022-11-08 16:21:34
* @LastEditors: taowj 965042433@qq.com
* @LastEditTime: 2023-08-12 17:15:32
* @FilePath: \introducer\application\admin\lang\zh-cn\users\users.php
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
return
[
'Id'
=>
'id'
,
...
...
@@ -34,5 +42,8 @@ return [
'Signtime'
=>
'股权签发时间'
,
'Status'
=>
'状态'
,
'Status 1'
=>
'正常'
,
'Status 2'
=>
'冻结'
'Status 2'
=>
'冻结'
,
'Equity'
=>
'股权'
,
'Equity_code'
=>
'股权代码'
,
'Signtime'
=>
'签发时间'
];
application/admin/model/users/Agent.php
View file @
c4e05a4d
<?php
/*
* @Author: taowj 965042433@qq.com
* @Date: 2022-11-08 16:21:34
* @LastEditors: taowj 965042433@qq.com
* @LastEditTime: 2023-08-30 15:02:39
* @FilePath: \introducer\application\admin\model\users\Agent.php
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
namespace
app\admin\model\users
;
...
...
@@ -26,7 +34,8 @@ class Agent extends Model
// 追加属性
protected
$append
=
[
'status_text'
,
'type_text'
'type_text'
,
'level_text'
];
...
...
@@ -40,6 +49,10 @@ class Agent extends Model
return
[
'1'
=>
__
(
'Status 1'
),
'2'
=>
__
(
'Status 2'
)];
}
public
function
getLevelList
()
{
return
[
'0'
=>
__
(
'Level 0'
),
'1'
=>
__
(
'Level 1'
),
'2'
=>
__
(
'Level 2'
),
'3'
=>
__
(
'Level 3'
)];
}
public
function
getTypeTextAttr
(
$value
,
$data
)
{
...
...
@@ -55,6 +68,13 @@ class Agent extends Model
return
isset
(
$list
[
$value
])
?
$list
[
$value
]
:
''
;
}
public
function
getLevelTextAttr
(
$value
,
$data
)
{
$value
=
$value
?
$value
:
(
isset
(
$data
[
'level'
])
?
$data
[
'level'
]
:
''
);
$list
=
$this
->
getLevelList
();
return
isset
(
$list
[
$value
])
?
$list
[
$value
]
:
''
;
}
public
function
area
()
{
return
self
::
hasOne
(
"app\admin\model\Addr"
,
'ID'
,
"area_id"
);
...
...
application/admin/model/users/Users.php
View file @
c4e05a4d
...
...
@@ -30,6 +30,7 @@ class Users extends Model
'prevtime_text'
,
'logintime_text'
,
'jointime_text'
,
'signtime_text'
,
'type_text'
,
'user_type_text'
,
'status_text'
...
...
@@ -86,6 +87,11 @@ class Users extends Model
return
is_numeric
(
$value
)
?
date
(
"Y-m-d H:i:s"
,
$value
)
:
$value
;
}
public
function
getSigntimeTextAttr
(
$value
,
$data
)
{
$value
=
$value
?
$value
:
(
isset
(
$data
[
'signtime'
])
?
$data
[
'signtime'
]
:
''
);
return
is_numeric
(
$value
)
?
date
(
"Y-m-d H:i:s"
,
$value
)
:
$value
;
}
public
function
getTypeTextAttr
(
$value
,
$data
)
{
...
...
@@ -124,6 +130,10 @@ class Users extends Model
{
return
$value
===
''
?
null
:
(
$value
&&
!
is_numeric
(
$value
)
?
strtotime
(
$value
)
:
$value
);
}
protected
function
setSigntimeAttr
(
$value
)
{
return
$value
===
''
?
null
:
(
$value
&&
!
is_numeric
(
$value
)
?
strtotime
(
$value
)
:
$value
);
}
/**
* @param $user_id
...
...
application/admin/view/device/site/authorizedevice.html
0 → 100644
View file @
c4e05a4d
<!--
* @Author: taowj 965042433@qq.com
* @Date: 2023-06-27 17:16:00
* @LastEditors: taowj 965042433@qq.com
* @LastEditTime: 2023-06-27 17:20:43
* @FilePath: \introducer\application\admin\view\device\site\authorisedevice.html
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<form
id=
"authorisedevice-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"
>
{:__('Agent_user_id')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-agent_user_id"
data-rule=
"required"
data-source=
"users/users/index"
data-search-field=
"id,realname"
data-primary-key=
"id"
data-field=
"realname"
data-format-item=
"{id} - {realname}"
class=
"form-control selectpage"
name=
"row[agent_user_id]"
type=
"text"
value=
""
>
</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"
>
<input
id=
"c-group_id"
data-rule=
"required"
data-source=
"device/chargegroup/index"
data-field=
"group_name"
data-primary-key=
"id"
class=
"form-control selectpage"
data-format-item=
"{id} - {group_name} - {old_id}"
name=
"row[group_id]"
type=
"text"
value=
""
>
</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"
>
<input
id=
"c-amount"
data-rule=
"required"
class=
"form-control"
name=
"row[amount]"
type=
"number"
>
</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-primary btn-embossed disabled"
>
{:__('OK')}
</button>
<button
type=
"reset"
class=
"btn btn-default btn-embossed"
>
{:__('Reset')}
</button>
</div>
</div>
</form>
application/admin/view/device/site/index.html
View file @
c4e05a4d
<!--
* @Author: taowj 965042433@qq.com
* @Date: 2022-11-08 16:21:34
* @LastEditors: taowj 965042433@qq.com
* @LastEditTime: 2023-06-27 19:58:44
* @FilePath: \introducer\application\admin\view\device\site\index.html
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<div
class=
"panel panel-default panel-intro"
>
<div
class=
"panel-heading"
>
...
...
@@ -20,7 +28,9 @@
<a
href=
"javascript:;"
class=
"btn btn-success btn-add {:$auth->check('device/site/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('device/site/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('device/site/del')?'':'hide'}"
title=
"{:__('Delete')}"
><i
class=
"fa fa-trash"
></i>
{:__('Delete')}
</a>
<a
data-url=
"device/site/authorizedevice"
id=
'authorizedevice'
class=
"btn btn-info"
data-title=
"{:__('批量授权设备')}"
><i
class=
"fa"
></i>
{:__('批量授权设备')}
</a>
<div
class=
"dropdown btn-group {:$auth->check('device/site/multi')?'':'hide'}"
>
<a
class=
"btn btn-primary btn-more dropdown-toggle btn-disabled disabled"
data-toggle=
"dropdown"
><i
class=
"fa fa-cog"
></i>
{:__('More')}
</a>
...
...
application/admin/view/users/agent/add.html
View file @
c4e05a4d
...
...
@@ -56,6 +56,18 @@
</div>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Level')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<select
id=
"c-level"
data-rule=
"required"
min=
"0"
class=
"form-control selectpicker"
name=
"row[level]"
>
{foreach name="levelList" item="vo"}
<option
value=
"{$key}"
{
in
name=
"key"
value=
"1"
}
selected
{/
in
}
>
{$vo}
</option>
{/foreach}
</select>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Status')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
...
...
application/admin/view/users/agent/edit.html
View file @
c4e05a4d
...
...
@@ -63,6 +63,18 @@
</div>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Level')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<select
id=
"c-level"
data-rule=
"required"
min=
"0"
class=
"form-control selectpicker"
name=
"row[level]"
>
{foreach name="levelList" item="vo"}
<option
value=
"{$key}"
{
in
name=
"key"
value=
"$row.level"
}
selected
{/
in
}
>
{$vo}
</option>
{/foreach}
</select>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Status')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
...
...
application/admin/view/users/users/edit.html
View file @
c4e05a4d
...
...
@@ -177,4 +177,29 @@
<button
type=
"reset"
class=
"btn btn-default btn-embossed"
>
{:__('Reset')}
</button>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Equity')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-equity"
class=
"form-control"
name=
"row[equity]"
type=
"number"
value=
"{$row.equity|htmlentities}"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Equity_code')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-equity_code"
class=
"form-control"
name=
"row[equity_code]"
type=
"text"
value=
"{$row.equity_code|htmlentities}"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Signtime')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-signtime"
class=
"form-control datetimepicker"
data-date-format=
"YYYY-MM-DD HH:mm:ss"
data-use-current=
"true"
name=
"row[signtime]"
type=
"text"
value=
"{:$row.signtime?datetime($row.signtime):''}"
>
</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-primary btn-embossed disabled"
>
{:__('OK')}
</button>
<button
type=
"reset"
class=
"btn btn-default btn-embossed"
>
{:__('Reset')}
</button>
</div>
</div>
</form>
application/api/controller/Users.php
View file @
c4e05a4d
...
...
@@ -164,8 +164,12 @@ class Users extends Api
}
$userinfo
[
'invite_device_num'
]
=
\app\admin\model\order\Order
::
where
([
'share_id'
=>
$uid
,
'sale_status'
=>
2
])
->
sum
(
'num'
);
//推广设备数
$userinfo
[
'recharge_amount'
]
=
Config
::
get
(
'site.recharge_gift_pack'
);
$this
->
success
(
'获取用户信息成功'
,
[
'userinfo'
=>
$userinfo
]);
//股东身份判断,有股权或股票时视为股东
$userinfo
[
'shareholder'
]
=
0
;
if
(
$userinfo
[
'equity'
]
>
0
)
{
$userinfo
[
'shareholder'
]
=
1
;
}
$this
->
success
(
'获取用户信息成功'
,
[
'userinfo'
=>
$userinfo
,
'shareholder'
=>
$userinfo
[
'shareholder'
]]);
}
/**
...
...
@@ -799,4 +803,30 @@ class Users extends Api
}
$this
->
success
(
'获取账单明细成功'
,
[
'userdetailmoneys'
=>
$userdetailmoneys
]);
}
/**
* 股权查询接口
*/
public
function
userEquity
()
{
$userInfo
=
UsersModel
::
alias
(
'user'
)
->
join
(
'agent'
,
'user.id=agent.agent_user_id'
,
'left'
)
->
field
(
"user.id,user.realname,agent.identity_number,
user.equity,user.equity_code,
FROM_UNIXTIME(user.signtime,'%Y-%m-%d %T') as signtime"
)
->
where
([
'user.id'
=>
$this
->
auth
->
id
])
->
find
();
if
(
!
$userInfo
)
{
$this
->
error
(
'获取用户信息失败'
);
}
if
(
!
$userInfo
[
'equity'
])
{
$this
->
error
(
'当前用户没有获得股权'
);
}
$companyInfo
[
'address'
]
=
"江西省南昌市南昌县莲塘镇澄湖西路295号"
;
$companyInfo
[
'established_time'
]
=
"2021-07-14"
;
$companyInfo
[
'business_license'
]
=
"91360106MA3AEF9220"
;
$companyInfo
[
'registered_capital'
]
=
"3000万"
;
$companyInfo
[
'description'
]
=
"公司在上市后赠送同等金额原始股;本股权证书经公司正式授权井加盖公章,即可有效。特此为证。"
;
$companyInfo
[
'official_seal'
]
=
""
;
$companyInfo
[
'chairman_seal'
]
=
""
;
$this
->
success
(
'获取股权信息成功'
,
[
'equityInfo'
=>
$userInfo
,
'companyInfo'
=>
$companyInfo
]);
}
}
application/api/controller/shopro/Commission.php
View file @
c4e05a4d
...
...
@@ -3,7 +3,7 @@
* @Author: taowj 965042433@qq.com
* @Date: 2023-06-06 16:07:57
* @LastEditors: taowj 965042433@qq.com
* @LastEditTime: 2023-06-08 1
0:02:59
* @LastEditTime: 2023-06-08 1
5:15:08
* @FilePath: \introducer\application\api\controller\Commission.php
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
...
...
@@ -192,7 +192,7 @@ class Commission extends Api
$pAgentInfo
=
AgentModel
::
where
([
'agent_user_id'
=>
$userInfo
[
'pid'
],
'status'
=>
1
])
->
find
();
if
(
$pAgentInfo
)
{
//获取分佣比例
$commissionRate
=
Config
::
get
(
'recharge_commission_rate'
);
$commissionRate
=
Config
::
get
(
'
site.
recharge_commission_rate'
);
//获取团长资金情况
$puserInfo
=
UsersModel
::
where
([
'id'
=>
$userInfo
[
'pid'
]])
->
find
();
//判断团长身份等级
...
...
@@ -336,7 +336,7 @@ class Commission extends Api
$pAgentInfo
=
AgentModel
::
where
([
'agent_user_id'
=>
$userInfo
[
'pid'
],
'status'
=>
1
])
->
find
();
if
(
$pAgentInfo
)
{
//获取分佣比例
$commissionRate
=
Config
::
get
(
'shop_commission_rate'
);
$commissionRate
=
Config
::
get
(
's
ite.s
hop_commission_rate'
);
//获取团长资金情况
$puserInfo
=
UsersModel
::
where
([
'id'
=>
$userInfo
[
'pid'
]])
->
find
();
//判断团长身份等级
...
...
application/api/controller/shopro/Goodsorder.php
View file @
c4e05a4d
This diff is collapsed.
Click to expand it.
application/common/library/wechat/certs/xld_apiclient_cert.pem
0 → 100644
View file @
c4e05a4d
-----BEGIN CERTIFICATE-----
MIIEJDCCAwygAwIBAgIUJqt4z3VlCruulpxXe7xeUhL5rBwwDQYJKoZIhvcNAQEL
BQAwXjELMAkGA1UEBhMCQ04xEzARBgNVBAoTClRlbnBheS5jb20xHTAbBgNVBAsT
FFRlbnBheS5jb20gQ0EgQ2VudGVyMRswGQYDVQQDExJUZW5wYXkuY29tIFJvb3Qg
Q0EwHhcNMjMwMzAzMDgzOTI2WhcNMjgwMzAxMDgzOTI2WjB+MRMwEQYDVQQDDAox
NjM0NjQ5NzgyMRswGQYDVQQKDBLlvq7kv6HllYbmiLfns7vnu58xKjAoBgNVBAsM
Ieaxn+ilv+WWnOadpeeUteenkeaKgOaciemZkOWFrOWPuDELMAkGA1UEBgwCQ04x
ETAPBgNVBAcMCFNoZW5aaGVuMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
AQEAyLPNlwzkfK3Jznp84qik7Olu/cISPBjG6ojujooV9tfLfZ2o680CT/V1+gKw
2+bx+SVUx/sjndL1OrNa2jRWyum+r6KH1iHyIPOYi5YFUYKW2s2NlZQx2ewPB+5t
qOgHqW+uIiebi1rYAxM9VBR8bnmOJ4cLY1ngIztm4huWtPJjWJJ5Sg6b0i/8Q4sR
0Y0SlaWK53DJR1dmIqfZ08s7iz/SifFTTSgkXdNF3ZsVbOT9hC+H6kwuC+6+5oHS
aVPTHyiGPZaVcxFAsVWO6zrTIFTO209YqqQGZCjzxpII1gOoL9Y/6x7MFaMlpTUL
2eXT8rJHnjsIQrvkxMry5CSLMQIDAQABo4G5MIG2MAkGA1UdEwQCMAAwCwYDVR0P
BAQDAgP4MIGbBgNVHR8EgZMwgZAwgY2ggYqggYeGgYRodHRwOi8vZXZjYS5pdHJ1
cy5jb20uY24vcHVibGljL2l0cnVzY3JsP0NBPTFCRDQyMjBFNTBEQkMwNEIwNkFE
Mzk3NTQ5ODQ2QzAxQzNFOEVCRDImc2c9SEFDQzQ3MUI2NTQyMkUxMkIyN0E5RDMz
QTg3QUQxQ0RGNTkyNkUxNDAzNzEwDQYJKoZIhvcNAQELBQADggEBACGvn5ngcJYU
/uMVDdHahj5JR4tBqPT4lD6o27NiVmOwWLAiEfZ8p+cTNHuG4G7o5LnG7gE+5urv
KtOUaXUTa6eQD8kSMVZ6MgPJeRruaZEeAxyh6llar4nVU5bRrTrzrXcXNU3BGLUN
nZyZv5WmCAKI17zInbCdtyt37NHa2nPFWBKUYKIsETRyX1TxHvMYiynUJm936SA1
K3qdtZn9iTRVgntnBez5U0D5YnZgtE6N+bUBZwj2IXO8qF0qHvINx5TB+xyRmn3k
hgMNdd21Pcjt1OTCLGI3oRk/UkYwfD9ghKWeByxzLRRCgYdcvhKEICc187yNckeK
T+8d3jazfsE=
-----END CERTIFICATE-----
application/common/library/wechat/certs/xld_apiclient_key.pem
0 → 100644
View file @
c4e05a4d
-----BEGIN PRIVATE KEY-----
MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDIs82XDOR8rcnO
enziqKTs6W79whI8GMbqiO6OihX218t9najrzQJP9XX6ArDb5vH5JVTH+yOd0vU6
s1raNFbK6b6voofWIfIg85iLlgVRgpbazY2VlDHZ7A8H7m2o6Aepb64iJ5uLWtgD
Ez1UFHxueY4nhwtjWeAjO2biG5a08mNYknlKDpvSL/xDixHRjRKVpYrncMlHV2Yi
p9nTyzuLP9KJ8VNNKCRd00XdmxVs5P2EL4fqTC4L7r7mgdJpU9MfKIY9lpVzEUCx
VY7rOtMgVM7bT1iqpAZkKPPGkgjWA6gv1j/rHswVoyWlNQvZ5dPyskeeOwhCu+TE
yvLkJIsxAgMBAAECggEAS45k91iDK+zA7FpwaWPTstyuTBmjg7xQJjsmk8KoQiU7
Fi8kSKEFHdTqdRROQHrQ3VqQcDi7T877Qv4CVeMeSYV1o+kr+hENdho+c04m8miX
IggAJS+FFOUpQ3MfFVdEiyTgCTuf8vZgG8hCbkTIE07vlTHht6U+HAVg1f5M3hE2
vrE7fPOQftZfp7jhdN8pwYeCsdFbZnzuj9eAZP8QiEzWibz8XhdiJ7X6AO5hU6DP
RK9/yBJKvUWHnXwZkhn3yXH6zko+l+Y+J1K5q7W75ZMskZEo2Vvrjy4MYNAxai7d
snQK6zokYHp+ZptP2S1t1YBDGeIFQG2dhU07LTD6AQKBgQD3rWmT24Vnn9SqJIdK
aHB4J2/Cd57Z9fvAdexDlcdElowX+jspgItqE5giOHaHix2WkHBYsQEYfvrSP8tk
n0RJTuTSh6cKxGpMK8gp0N1BngZkZbeIjUha7UsQsatlv1FaKDerpOSZVr69Kbo5
CupXsCNrKG+b8L1EHNMEXIChHQKBgQDPckx8B3LRZBdE3AVYCSWVHFmZW1uXvq1x
FJji+p4jX1AhQiUAA4Z6jGNMP3PjMccKQcnDZkNAjce2f35oVFEtzda//kRoytM4
HcgnsUg9OHAYZa3JCGPrbqHVpV9PJE6ctWwjDrmJy4V1FpshSd0yhHytCill/Hct
k0VKj9CqJQKBgQDLW9UeE9Y7OR5x/MAgthPyc97tey4wpCnq4mf1LhuJE1s/rLO6
5dKSbDgzkMyxieXnY/z6tYrCxC/JRZwIqER3NJHo0nyy+IaWuDQHMXkZkViKQoIp
WmeYUNGbiWXDiwyOzAq5ohAYXwMJaiN/BplXGkZai77n+QhNzqTsJc9veQKBgQDD
P03zksMjh3RLMFarRHil/nfqWk075pCyFPPM9psuqb/ufaX7fFXvNAElu7ckSC6R
Xdg73B1CPe+Rui/MnEeHt+v+6p+Sjgv9DjLcAQT/8gW3QMQvqYD6DzessSiigYao
Ai2UVYCVzAOBb9R0oWPa7021RBIw1k2JjMoz4mZALQKBgQDHBByaBsOXXLWS1qpz
gQcCNTkUUwxuBGmHlturCfD2NGI1ujnvs64H9O8qc0XbtWC/40M48AJeBXKBhRD3
nJorrr7gMiUXF8xS6aTuqMtAVNYW+xV/PXPWZi4DHHfTeQZHE4yMEypkylHVx+tY
quoHhvmtF7hePvpqvtdik2eEEw==
-----END PRIVATE KEY-----
application/config.php
View file @
c4e05a4d
...
...
@@ -304,17 +304,27 @@ return [
'switchCash'
=>
'on'
,
//on:开,off:关
//测试小程序配置
// 'testConfig' => [
// 'app_id' => 'wxef8eef2f4237cb92',
// 'appSecret' => '2ad7d19be051ac996feec980efbe8080',
// 'mch_id' => '1325234201',
// 'key' => 'duosiying18542018njsdbshsuihwsba',
// 'cert_path' => APP_PATH . "common/library/wechat/certs/apiclient_cert.pem",
// 'key_path' => APP_PATH . "common/library/wechat/certs/apiclient_key.pem",
// 'public' => APP_PATH . "common/library/wechat/certs/public.pem",
// 'public_pkcs8' => APP_PATH . "common/library/wechat/certs/public_pkcs8.pem",
// ],
//五金店配置
'testConfig'
=>
[
'app_id'
=>
'wx
ef8eef2f4237cb92
'
,
'appSecret'
=>
'
2ad7d19be051ac996feec980efbe8080
'
,
'mch_id'
=>
'1
325234201
'
,
'key'
=>
'
duosiying18542018njsdbshsuihwsba
'
,
'cert_path'
=>
APP_PATH
.
"common/library/wechat/certs/apiclient_cert.pem"
,
'key_path'
=>
APP_PATH
.
"common/library/wechat/certs/apiclient_key.pem"
,
'app_id'
=>
'wx
b280981b7a01c3a9
'
,
'appSecret'
=>
'
bf74ebbc274c1c8b3915c99d8c4c1b84
'
,
'mch_id'
=>
'1
634649782
'
,
'key'
=>
'
F5976WvB0ghgo7TYj5Qnh3amBUvh2Bxf
'
,
'cert_path'
=>
APP_PATH
.
"common/library/wechat/certs/
xld_
apiclient_cert.pem"
,
'key_path'
=>
APP_PATH
.
"common/library/wechat/certs/
xld_
apiclient_key.pem"
,
'public'
=>
APP_PATH
.
"common/library/wechat/certs/public.pem"
,
'public_pkcs8'
=>
APP_PATH
.
"common/library/wechat/certs/public_pkcs8.pem"
,
],
'OSS'
=>
[
'KeyId'
=>
'LTAI4GB9G7jcZLxQuYAJir6g'
,
'KeySecret'
=>
'VE44oUzaaQYgN7xG7TvSsRqjhoZkGF'
,
...
...
application/extra/site.php
View file @
c4e05a4d
<?php
/*
* @Author: taowj 965042433@qq.com
* @Date: 2023-06-08 13:49:07
* @LastEditors: taowj 965042433@qq.com
* @LastEditTime: 2023-06-08 15:14:01
* @FilePath: \introducer\application\extra\site.php
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
return
array
(
return
array
(
'name'
=>
'引充者充电桩'
,
'beian'
=>
''
,
'cdnurl'
=>
''
,
'version'
=>
'1.0.5'
,
'timezone'
=>
'Asia/Shanghai'
,
'forbiddenip'
=>
''
,
'languages'
=>
array
(
'languages'
=>
array
(
'backend'
=>
'zh-cn'
,
'frontend'
=>
'zh-cn'
,
),
'fixedpage'
=>
'dashboard'
,
'categorytype'
=>
array
(
'categorytype'
=>
array
(
'default'
=>
'Default'
,
'page'
=>
'Page'
,
'article'
=>
'Article'
,
'test'
=>
'Test'
,
),
'configgroup'
=>
array
(
'configgroup'
=>
array
(
'basic'
=>
'Basic'
,
'email'
=>
'Email'
,
'dictionary'
=>
'Dictionary'
,
...
...
@@ -35,11 +43,23 @@ return array (
'mail_smtp_pass'
=>
'password'
,
'mail_verify_type'
=>
'2'
,
'mail_from'
=>
'10000@qq.com'
,
'attachmentcategory'
=>
array
(
'attachmentcategory'
=>
array
(
'category1'
=>
'Category1'
,
'category2'
=>
'Category2'
,
'custom'
=>
'Custom'
,
),
'recharge_gift_pack'
=>
'100'
,
//充值分佣比例
'recharge_commission_rate'
=>
[
'city'
=>
0.02
,
'area'
=>
0.03
,
'maker'
=>
0.05
,
],
//商城分佣比例
'shop_commission_rate'
=>
[
'city'
=>
0.02
,
'area'
=>
0.03
,
'maker'
=>
0.05
,
]
);
public/assets/js/backend/device/site.js
View file @
c4e05a4d
...
...
@@ -11,6 +11,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
del_url
:
'
device/site/del
'
,
multi_url
:
'
device/site/multi
'
,
import_url
:
'
device/site/import
'
,
authorizedevice_url
:
'
device/site/authorizedevice
'
,
table
:
'
site
'
,
}
});
...
...
@@ -24,32 +25,43 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
sortName
:
'
id
'
,
columns
:
[
[
{
checkbox
:
true
},
{
field
:
'
id
'
,
title
:
__
(
'
Id
'
)},
{
field
:
'
agent_user_id
'
,
title
:
__
(
'
Agent_user_id
'
),
formatter
:
function
(
value
,
row
,
index
)
{
if
(
row
.
users
){
var
html
=
"
id:
"
+
row
.
agent_user_id
+
"
<br/> 昵称:
"
+
row
.
users
.
nickname
;
html
=
row
.
realname
?
html
+
"
<br/> 姓名:
"
+
row
.
realname
:
html
;
html
=
row
.
users
.
mobile
?
html
+
"
<br/> 电话:
"
+
row
.
users
.
mobile
:
html
;
{
checkbox
:
true
},
{
field
:
'
id
'
,
title
:
__
(
'
Id
'
)
},
{
field
:
'
agent_user_id
'
,
title
:
__
(
'
Agent_user_id
'
),
formatter
:
function
(
value
,
row
,
index
)
{
if
(
row
.
users
)
{
var
html
=
"
id:
"
+
row
.
agent_user_id
+
"
<br/> 昵称:
"
+
row
.
users
.
nickname
;
html
=
row
.
users
.
realname
?
html
+
"
<br/> 姓名:
"
+
row
.
users
.
realname
:
html
;
html
=
row
.
users
.
mobile
?
html
+
"
<br/> 电话:
"
+
row
.
users
.
mobile
:
html
;
return
html
;
}
else
{
return
"
id:
"
+
row
.
agent_user_id
;
}
}},
{
field
:
'
area.MergerName
'
,
title
:
__
(
'
所属区域
'
)},
}
},
{
field
:
'
area.MergerName
'
,
title
:
__
(
'
所属区域
'
)
},
// {field: 'province_id', title: __('Province_id')},
// {field: 'city_id', title: __('City_id')},
// {field: 'area_id', title: __('Area_id')},
{
field
:
'
area_name
'
,
title
:
__
(
'
Area_name
'
),
operate
:
'
LIKE
'
},
{
field
:
'
createtime
'
,
title
:
__
(
'
Createtime
'
),
operate
:
'
RANGE
'
,
addclass
:
'
datetimerange
'
,
autocomplete
:
false
,
formatter
:
Table
.
api
.
formatter
.
datetime
},
{
field
:
'
status
'
,
title
:
__
(
'
Status
'
),
searchList
:
{
"
1
"
:
__
(
'
Status 1
'
),
"
2
"
:
__
(
'
Status 2
'
)},
formatter
:
Table
.
api
.
formatter
.
status
},
{
field
:
'
operate
'
,
title
:
__
(
'
Operate
'
),
table
:
table
,
events
:
Table
.
api
.
events
.
operate
,
formatter
:
Table
.
api
.
formatter
.
operate
}
{
field
:
'
area_name
'
,
title
:
__
(
'
Area_name
'
),
operate
:
'
LIKE
'
},
{
field
:
'
createtime
'
,
title
:
__
(
'
Createtime
'
),
operate
:
'
RANGE
'
,
addclass
:
'
datetimerange
'
,
autocomplete
:
false
,
formatter
:
Table
.
api
.
formatter
.
datetime
},
{
field
:
'
status
'
,
title
:
__
(
'
Status
'
),
searchList
:
{
"
1
"
:
__
(
'
Status 1
'
),
"
2
"
:
__
(
'
Status 2
'
)
},
formatter
:
Table
.
api
.
formatter
.
status
},
{
field
:
'
operate
'
,
title
:
__
(
'
Operate
'
),
table
:
table
,
events
:
Table
.
api
.
events
.
operate
,
formatter
:
Table
.
api
.
formatter
.
operate
}
]
]
});
// 绑定用户
$
(
'
#authorizedevice
'
).
click
(
function
()
{
var
url
=
$
(
this
).
attr
(
'
data-url
'
);
var
title
=
$
(
this
).
attr
(
'
title
'
);
Fast
.
api
.
open
(
"
device/site/authorizedevice
"
,
'
批量设备授权
'
,
{
callback
:
function
(
value
)
{
console
.
log
(
value
);
}
});
})
// 为表格绑定事件
Table
.
api
.
bindevent
(
table
);
},
...
...
@@ -59,6 +71,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
edit
:
function
()
{
Controller
.
api
.
bindevent
();
},
authorizedevice
:
function
()
{
Controller
.
api
.
bindevent
();
},
api
:
{
bindevent
:
function
()
{
Form
.
api
.
bindevent
(
$
(
"
form[role=form]
"
));
...
...
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