Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
my-yaf-project
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenchuanwen
my-yaf-project
Commits
55446b7b
Commit
55446b7b
authored
Sep 19, 2018
by
wwccw0591
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master_dev' of git.shenbd.com:qm-develop/shenbd into ccw
parents
bdd4f776
11bbceec
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
52 additions
and
3 deletions
+52
-3
User.php
application/controllers/User.php
+5
-0
ApiConst.php
application/library/Our/ApiConst.php
+2
-0
CartService.php
application/models/Business/Cart/CartService.php
+1
-1
FootprintService.php
application/models/Business/User/FootprintService.php
+1
-1
MemberService.php
application/models/Business/User/MemberService.php
+12
-0
Member.php
application/models/DAO/Member.php
+15
-0
goodsdetail.phtml
application/views/index/goodsdetail.phtml
+16
-1
No files found.
application/controllers/User.php
View file @
55446b7b
...
...
@@ -88,8 +88,13 @@ class UserController extends \Our\Controller_AbstractIndex {
if
(
$member
){
/*$userToken=$this->memberService->findMbUserTokenByMemberId($member['member_id']);
$this->memberService->clearKey($userToken['token']);*/
$userToken
=
$this
->
memberService
->
getWxUserToken
(
$member
[
'member_id'
]);
if
(
!
empty
(
$userToken
)){
$this
->
updateOldLoginKey
(
$userToken
);
}
$this
->
memberService
->
clearKey
(
$this
->
key
);
$this
->
key
=
Common
::
bulidToken
(
''
,
''
,
''
,
\Our\ApiConst
::
wechatDeviceType
);
$this
->
memberService
->
saveWxUserToken
(
$this
->
key
,
$member
[
'member_id'
]);
session_id
(
$this
->
key
);
$this
->
sess
[
'member_id'
]
=
$member
[
'member_id'
];
$this
->
sess
[
'user_type'
]
=
\Our\ApiConst
::
wechatUserType
;
...
...
application/library/Our/ApiConst.php
View file @
55446b7b
...
...
@@ -20,6 +20,8 @@ class ApiConst
//一个小时
const
oneHour
=
3600
;
const
twoMinSecond
=
120
;
const
fiveMinutes
=
180
;
//10分钟秒数
const
tenMinSecond
=
600
;
...
...
application/models/Business/Cart/CartService.php
View file @
55446b7b
...
...
@@ -391,7 +391,7 @@ class CartServiceModel extends \Business\AbstractModel{
return
array
(
'existCartFlag'
=>
\Our\ApiConst
::
one
);
}
$goodsDao
=
\DAO\GoodsModel
::
getInstance
(
\Our\DbNameConst
::
masterDBConnectName
);
$goodsValidStatus
=
$goodsDao
->
validEditCartGoods
(
$data
,
$cart
);
$goodsValidStatus
=
$goodsDao
->
validEditCartGoods
(
$data
,
$cart
,
false
);
if
(
!
$goodsValidStatus
){
\Error\ErrorModel
::
throwException
(
$goodsDao
->
errorCode
);
}
...
...
application/models/Business/User/FootprintService.php
100755 → 100644
View file @
55446b7b
...
...
@@ -26,7 +26,7 @@ class FootprintServiceModel extends \Business\AbstractModel
$startTime
=
mktime
(
0
,
0
,
0
,
$month
-
2
,
1
,
$year
);
$endTime
=
mktime
(
0
,
0
,
-
1
,
$month
+
1
,
1
,
$year
);
$browseDAO
=
\DAO\GoodsBrowseModel
::
getInstance
();
$list
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db4\GoodsBrowserRedisModel
::
getInstance
(),
array
(
&
$browseDAO
,
'getDistinctDate'
),
array
(
$memberId
,
$startTime
,
$endTime
,
$order
),
\Our\ApiConst
::
t
en
MinSecond
,
array
(
$memberId
));
$list
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db4\GoodsBrowserRedisModel
::
getInstance
(),
array
(
&
$browseDAO
,
'getDistinctDate'
),
array
(
$memberId
,
$startTime
,
$endTime
,
$order
),
\Our\ApiConst
::
t
wo
MinSecond
,
array
(
$memberId
));
$date
=
[];
if
(
$list
){
$date
=
array_column
(
$list
,
'browsedate'
);
...
...
application/models/Business/User/MemberService.php
View file @
55446b7b
...
...
@@ -128,6 +128,8 @@ class MemberServiceModel extends \Business\AbstractModel
return
$mbUserTokenModel
->
findByMemberId
(
$memberId
);
}
public
function
getMemberInfo
(
$memberId
)
{
$memberDao
=
\DAO\MemberModel
::
getInstance
(
\Our\DbNameConst
::
masterDBConnectName
);
...
...
@@ -182,6 +184,16 @@ class MemberServiceModel extends \Business\AbstractModel
return
$result
;
}
public
function
getWxUserToken
(
$memberId
){
$memberDao
=
\DAO\MemberModel
::
getInstance
();
$userToken
=
$memberDao
->
getWxUserToken
(
$memberId
);
return
$userToken
;
}
public
function
saveWxUserToken
(
$key
,
$memberId
){
$memberDao
=
\DAO\MemberModel
::
getInstance
();
$memberDao
->
saveWxUserToken
(
$key
,
$memberId
);
}
/**
* 保存会员头像
...
...
application/models/DAO/Member.php
View file @
55446b7b
...
...
@@ -97,6 +97,21 @@ class MemberModel extends \DAO\AbstractModel
}
public
function
getWxUserToken
(
$memberId
){
$memberDb0Redis
=
\Redis\Db0\MemberRedisModel
::
getInstance
();
$member
=
$memberDb0Redis
->
tableHGAll
(
$memberId
);
$memberDb0Redis
->
tableExpire
(
$memberId
,
ApiConst
::
tenDaySecond
);
if
(
isset
(
$member
[
'wxUserToken'
])
&&
$member
[
'wxUserToken'
]){
return
$member
[
'wxUserToken'
];
}
return
\Our\NameConst
::
emptyString
;
}
public
function
saveWxUserToken
(
$key
,
$memberId
){
$memberDb0Redis
=
\Redis\Db0\MemberRedisModel
::
getInstance
();
$memberDb0Redis
->
tableHMSet
(
$memberId
,
array
(
'wxUserToken'
=>
$key
));
}
/**
* 保存用户信息
*/
...
...
application/views/index/goodsdetail.phtml
100755 → 100644
View file @
55446b7b
...
...
@@ -8,6 +8,16 @@
</head>
<body>
<div>
<?php
$str
=
\Our\Common
::
is_https
()
?
str_replace
(
'http://'
,
'https://'
,
$commonInfo
[
'goods_youku_url'
])
:
$commonInfo
[
'goods_youku_url'
];
if
(
$str
)
{
// preg_match('/iframe((?!src).)*src[\s]*=[\s]*[\'"](?<src>[^\'"]*)[\'"]/i',$str,$match);
// if($match) {
// echo "<iframe height=auto width=100% src='{$match['src']}' frameborder=0 'allowfullscreen'></iframe>";
// }
echo
htmlspecialchars_decode
(
$str
);
}
?>
<?php
echo
$commonInfo
[
'goods_body'
];
?>
</div>
</body>
...
...
@@ -22,4 +32,9 @@
height
:
auto
;
}
</style>
<script>
window
.
onload
=
function
(){
document
.
getElementsByTagName
(
"iframe"
)[
0
].
style
.
width
=
document
.
body
.
clientWidth
+
'px'
;
document
.
getElementsByTagName
(
"iframe"
)[
0
].
style
.
height
=
(
document
.
body
.
clientWidth
*
480
/
510
)
+
'px'
;
}
</script>
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