Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zhupu
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
zhupu
Commits
5e5b77c6
Commit
5e5b77c6
authored
Nov 21, 2023
by
wuxiaoli
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://rungit.jxdsy.cn:10000/sugar/zhupu
into dev
parents
c0ec43da
1371ad25
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
10 deletions
+35
-10
application/admin/controller/family/Namecard.php
application/admin/controller/family/Namecard.php
+11
-6
application/admin/lang/zh-cn/family/namecard.php
application/admin/lang/zh-cn/family/namecard.php
+1
-0
application/admin/view/family/namecard/advancecode.html
application/admin/view/family/namecard/advancecode.html
+1
-1
application/admin/view/family/namecard/bindcode.html
application/admin/view/family/namecard/bindcode.html
+1
-1
application/api/controller/Index.php
application/api/controller/Index.php
+20
-0
application/common.php
application/common.php
+1
-2
No files found.
application/admin/controller/family/Namecard.php
View file @
5e5b77c6
...
@@ -166,14 +166,17 @@ class Namecard extends Backend
...
@@ -166,14 +166,17 @@ class Namecard extends Backend
$offset
=
1
;
$offset
=
1
;
}
}
$cards
=
[];
$cards
=
[];
$data
[
'type'
]
=
1
;
//二维码类型 1=
邀请锁客
$data
[
'type'
]
=
1
;
//二维码类型 1=
认领
$numLen
=
12
;
//卡号编码位数
$numLen
=
12
;
//卡号编码位数
$pwdLen
=
7
;
//激活码位数
$pwdLen
=
7
;
//激活码位数
$sNumArr
=
range
(
0
,
7
);
$sNumArr
=
range
(
0
,
9
);
$sPwdArr
=
array_merge
(
$sNumArr
,
range
(
'A'
,
'Z'
));
$sPwdArr
=
array_merge
(
$sNumArr
,
range
(
'A'
,
'Z'
));
for
(
$x
=
0
;
$x
<
$c
;
$x
++
)
{
for
(
$x
=
0
;
$x
<
$c
;
$x
++
)
{
$tempPwdStr
=
array
();
$tempPwdStr
=
array
();
for
(
$i
=
0
;
$i
<
$pwdLen
;
$i
++
)
{
for
(
$i
=
0
;
$i
<
$pwdLen
;
$i
++
)
{
if
(
array_rand
(
$sPwdArr
)
==
'I'
){
continue
;
}
$tempPwdStr
[]
=
$sPwdArr
[
array_rand
(
$sPwdArr
)];
$tempPwdStr
[]
=
$sPwdArr
[
array_rand
(
$sPwdArr
)];
}
}
$numbers
=
$offset
++
;
$numbers
=
$offset
++
;
...
@@ -181,7 +184,9 @@ class Namecard extends Backend
...
@@ -181,7 +184,9 @@ class Namecard extends Backend
$cards
[
$x
][
'card_number'
]
=
$card_number
;
//卡号
$cards
[
$x
][
'card_number'
]
=
$card_number
;
//卡号
$cards
[
$x
][
'activation_code'
]
=
implode
(
''
,
$tempPwdStr
);
//激活码
$cards
[
$x
][
'activation_code'
]
=
implode
(
''
,
$tempPwdStr
);
//激活码
$cards
[
$x
][
'createtime'
]
=
time
();
//创建时间
$cards
[
$x
][
'createtime'
]
=
time
();
//创建时间
$cards
[
$x
][
'url'
]
=
createQrcode
(
$data
,
$data
[
'type'
],
''
);
$cards
[
$x
][
'family_id'
]
=
$params
[
'family_id'
]
?
$params
[
'family_id'
]
:
0
;
$cards
[
$x
][
'pid'
]
=
$params
[
'pid'
]
?
$params
[
'pid'
]
:
0
;
$cards
[
$x
][
'url'
]
=
createQrcode
(
$data
,
$data
[
'type'
],
$card_number
);
}
}
array_unique
(
$cards
,
SORT_REGULAR
);
array_unique
(
$cards
,
SORT_REGULAR
);
$result
=
$this
->
model
->
insertAll
(
$cards
);
$result
=
$this
->
model
->
insertAll
(
$cards
);
...
@@ -202,16 +207,16 @@ class Namecard extends Backend
...
@@ -202,16 +207,16 @@ class Namecard extends Backend
if
(
$this
->
request
->
isPost
())
{
if
(
$this
->
request
->
isPost
())
{
$params
=
$this
->
request
->
post
(
'row/a'
);
$params
=
$this
->
request
->
post
(
'row/a'
);
$num
=
$params
[
'card_number'
];
//绑定多少组卡号编码
$num
=
$params
[
'card_number'
];
//绑定多少组卡号编码
$
user_id
=
$params
[
'user_
id'
];
$
pid
=
$params
[
'p
id'
];
$start_number
=
$params
[
'start_number'
];
//起始卡号
$start_number
=
$params
[
'start_number'
];
//起始卡号
$where
[
'id'
]
=
[
'between'
,
[
$start_number
,
$start_number
+
$num
-
1
]];
$where
[
'id'
]
=
[
'between'
,
[
$start_number
,
$start_number
+
$num
-
1
]];
$cards
=
$this
->
model
->
where
(
$where
)
->
select
();
$cards
=
$this
->
model
->
where
(
$where
)
->
select
();
foreach
(
$cards
as
$key
=>
$val
){
foreach
(
$cards
as
$key
=>
$val
){
if
(
$val
[
'
user_
id'
])
{
if
(
$val
[
'
p
id'
])
{
$this
->
error
(
"此卡段存在"
.
$val
[
'card_number'
]
.
"卡券已被绑定,请重新检查"
);
$this
->
error
(
"此卡段存在"
.
$val
[
'card_number'
]
.
"卡券已被绑定,请重新检查"
);
}
}
}
}
$result
=
$this
->
model
->
where
(
$where
)
->
update
([
'
user_id'
=>
$user_
id
,
'level'
=>
$params
[
'level'
]]);
$result
=
$this
->
model
->
where
(
$where
)
->
update
([
'
pid'
=>
$p
id
,
'level'
=>
$params
[
'level'
]]);
// $agent = $this->agentmodel->where(['agent_user_id' => $user_id])->field('card_section,type')->find();
// $agent = $this->agentmodel->where(['agent_user_id' => $user_id])->field('card_section,type')->find();
if
(
$result
){
if
(
$result
){
// if($agent['card_section']){
// if($agent['card_section']){
...
...
application/admin/lang/zh-cn/family/namecard.php
View file @
5e5b77c6
...
@@ -14,5 +14,6 @@ return [
...
@@ -14,5 +14,6 @@ return [
'Createtime'
=>
'创建时间'
,
'Createtime'
=>
'创建时间'
,
'Status'
=>
'状态'
,
'Status'
=>
'状态'
,
'Status 1'
=>
'显示'
,
'Status 1'
=>
'显示'
,
'Family_id'
=>
'族谱'
,
'Status 2'
=>
'隐藏'
'Status 2'
=>
'隐藏'
];
];
application/admin/view/family/namecard/advancecode.html
View file @
5e5b77c6
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('分配人id')}:
</label>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('分配人id')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-
user_id"
data-rule=
""
data-source=
"user/user/index"
data-primary-key=
"id"
data-field=
"id"
data-format-item=
"{id} - {nickname} - {realname}"
class=
"form-control selectpage"
name=
"row[user_
id]"
type=
"text"
value=
""
style=
"display:block;"
>
<input
id=
"c-
pid"
data-rule=
""
data-source=
"user/user/index"
data-primary-key=
"id"
data-field=
"id"
data-format-item=
"{id} - {nickname} - {realname}"
class=
"form-control selectpage"
name=
"row[p
id]"
type=
"text"
value=
""
style=
"display:block;"
>
</div>
</div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
...
...
application/admin/view/family/namecard/bindcode.html
View file @
5e5b77c6
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('分配人id')}:
</label>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('分配人id')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-
user_id"
data-rule=
""
data-source=
"user/user/index"
data-primary-key=
"id"
data-field=
"id"
data-format-item=
"{id} - {nickname} - {realname}"
class=
"form-control selectpage"
name=
"row[user_
id]"
type=
"text"
value=
""
style=
"display:block;"
>
<input
id=
"c-
pid"
data-rule=
""
data-source=
"user/user/index"
data-primary-key=
"id"
data-field=
"id"
data-format-item=
"{id} - {nickname} - {realname}"
class=
"form-control selectpage"
name=
"row[p
id]"
type=
"text"
value=
""
style=
"display:block;"
>
</div>
</div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
...
...
application/api/controller/Index.php
View file @
5e5b77c6
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
namespace
app\api\controller
;
namespace
app\api\controller
;
use
app\admin\model\family\Namecard
;
use
app\common\controller\Api
;
use
app\common\controller\Api
;
/**
/**
...
@@ -38,4 +39,23 @@ class Index extends Api
...
@@ -38,4 +39,23 @@ class Index extends Api
$data
[
'im_msg_text'
]
=
"对方还未认领,请通知对方及时认领"
;
$data
[
'im_msg_text'
]
=
"对方还未认领,请通知对方及时认领"
;
$this
->
success
(
'请求成功'
,
$data
);
$this
->
success
(
'请求成功'
,
$data
);
}
}
/**
* @description: 扫码进入,判断此券有无被绑定
* @param {type}
* @return:
*/
public
function
scanNameCard
()
{
$card_number
=
$this
->
request
->
post
(
'card_number'
,
''
);
//券编号
$namecard
=
Namecard
::
where
([
'card_number'
=>
$card_number
,
'status'
=>
1
])
->
find
();
if
(
!
$namecard
){
$this
->
error
(
'此卡已被冻结'
);
}
if
(
$namecard
[
'user_id'
])
{
$this
->
error
(
'此卡已被激活'
);
}
else
{
$this
->
success
(
'此卡可绑'
,
[
'namecard'
=>
$namecard
]);
}
}
}
}
application/common.php
View file @
5e5b77c6
...
@@ -655,7 +655,7 @@ if (!function_exists('getRecursion')) {
...
@@ -655,7 +655,7 @@ if (!function_exists('getRecursion')) {
$url
=
"https://"
.
$_SERVER
[
'HTTP_HOST'
]
.
"/"
.
$methodname
.
"?"
;
$url
=
"https://"
.
$_SERVER
[
'HTTP_HOST'
]
.
"/"
.
$methodname
.
"?"
;
$qrcodeName
=
null
;
$qrcodeName
=
null
;
//
$data['card_number']=$card_number;
$data
[
'card_number'
]
=
$card_number
;
foreach
(
$data
as
$key
=>
$val
)
{
foreach
(
$data
as
$key
=>
$val
)
{
if
(
!
empty
(
$val
))
{
if
(
!
empty
(
$val
))
{
...
@@ -666,7 +666,6 @@ if (!function_exists('getRecursion')) {
...
@@ -666,7 +666,6 @@ if (!function_exists('getRecursion')) {
$url
=
substr
(
$url
,
0
,
strlen
(
$url
)
-
1
);
$url
=
substr
(
$url
,
0
,
strlen
(
$url
)
-
1
);
$qrcodeName
=
substr
(
$qrcodeName
,
0
,
strlen
(
$qrcodeName
)
-
1
);
$qrcodeName
=
substr
(
$qrcodeName
,
0
,
strlen
(
$qrcodeName
)
-
1
);
// return $qrcodeName.'.png';
$file
=
\app\lib\QrcodeUtil
::
createQrcode
(
$url
,
$data
,
$qrcodeName
);
$file
=
\app\lib\QrcodeUtil
::
createQrcode
(
$url
,
$data
,
$qrcodeName
);
return
$file
;
return
$file
;
}
}
...
...
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