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
0828c607
Commit
0828c607
authored
Nov 21, 2023
by
sugar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
姓名卡
parent
b8bce789
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
5 deletions
+25
-5
application/admin/controller/family/Namecard.php
application/admin/controller/family/Namecard.php
+6
-3
application/admin/lang/zh-cn/family/namecard.php
application/admin/lang/zh-cn/family/namecard.php
+1
-0
application/api/controller/Index.php
application/api/controller/Index.php
+17
-0
application/common.php
application/common.php
+1
-2
No files found.
application/admin/controller/family/Namecard.php
View file @
0828c607
...
@@ -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,7 @@ class Namecard extends Backend
...
@@ -181,7 +184,7 @@ 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
][
'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
);
...
...
application/admin/lang/zh-cn/family/namecard.php
View file @
0828c607
...
@@ -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/api/controller/Index.php
View file @
0828c607
...
@@ -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,20 @@ class Index extends Api
...
@@ -38,4 +39,20 @@ 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
])
->
find
();
if
(
$namecard
[
'user_id'
])
{
$this
->
error
(
'此卡已被激活'
);
}
else
{
$this
->
success
(
'此卡可绑'
,
[
'namecard'
=>
$namecard
]);
}
}
}
}
application/common.php
View file @
0828c607
...
@@ -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