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
0f0eafe4
Commit
0f0eafe4
authored
Dec 20, 2018
by
christ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
share
parent
ee1555d6
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
57 additions
and
31 deletions
+57
-31
Index.php
application/controllers/Index.php
+9
-1
ApiConst.php
application/library/Our/ApiConst.php
+1
-1
WechatCommon.php
application/library/Our/WechatCommon.php
+1
-1
OrderService.php
application/models/Business/Order/OrderService.php
+6
-3
ShareService.php
application/models/Business/User/ShareService.php
+21
-13
goods.phtml
application/views/index/goods.phtml
+5
-7
saleShare.phtml
application/views/index/saleShare.phtml
+1
-0
store.phtml
application/views/index/store.phtml
+13
-5
No files found.
application/controllers/Index.php
View file @
0f0eafe4
...
...
@@ -21,6 +21,14 @@ class IndexController extends \Our\Controller_Abstract {
return
false
;
}
public
function
getQrcodeFlowAction
(){
$imageKey
=
$_GET
[
'imageKey'
];
$memberDb0Redis
=
\Redis\Db0\MemberRedisModel
::
getInstance
();
$imageFlow
=
$memberDb0Redis
->
tableCacheGet
(
$imageKey
);
header
(
'Content-type: image/jpg'
);
echo
$imageFlow
;
exit
;
}
public
function
getHtmlAction
(){
$this
->
req
=
$this
->
getRequest
()
->
getQuery
();
$postData
=
$this
->
req
;
...
...
@@ -37,7 +45,7 @@ class IndexController extends \Our\Controller_Abstract {
}
$this
->
memberDb0Redis
=
\Redis\Db0\MemberRedisModel
::
getInstance
();
$paramsStr
=
$this
->
memberDb0Redis
->
table
lpop
(
$this
->
key
);
$paramsStr
=
$this
->
memberDb0Redis
->
table
CacheGet
(
$this
->
key
);
if
(
$_GET
[
'debug'
]
==
1
){
$paramsStr
=
'{
"desc": "最优质的产品,最实惠的价格,最好的服务质量,欢迎选购",
...
...
application/library/Our/ApiConst.php
View file @
0f0eafe4
...
...
@@ -430,7 +430,7 @@ class ApiConst
const
xpClientAppVersionOnline
=
'1.0.0'
;
const
winClientAppVersionOnline
=
'1.0.0'
;
//微信小是否发布
const
isWxPublish
=
0
;
const
isWxPublish
=
1
;
//消息模板类型
const
reachRemindMessageType
=
1
;
...
...
application/library/Our/WechatCommon.php
View file @
0f0eafe4
...
...
@@ -73,7 +73,7 @@ class WechatCommon
}
public
function
httpsPostJson
(
$url
,
$data
=
''
,
$array
=
tru
e
)
public
function
httpsPostJson
(
$url
,
$data
=
''
,
$array
=
fals
e
)
{
$curl
=
curl_init
(
$url
);
curl_setopt
(
$curl
,
CURLOPT_SSL_VERIFYPEER
,
FALSE
);
...
...
application/models/Business/Order/OrderService.php
View file @
0f0eafe4
...
...
@@ -670,9 +670,12 @@ class OrderServiceModel extends \Business\AbstractModel
//更新订单信息
$updateData
=
array
(
'order_state'
=>
ApiConst
::
orderStateCancel
,
'is_effective'
=>
ApiConst
::
cancelOrderAuto
);
$update
=
$orderDao
->
update
(
array
(
'order_id'
=>
$order
[
'orderId'
]),
$updateData
);
$updateCommonData
[
'order_message'
]
=
DescribeConst
::
cancelOrderMessage
;
$res
=
$orderCommonDao
->
update
(
array
(
'order_id'
=>
$order
[
'orderId'
]),
$updateCommonData
);
if
(
!
$update
||
!
$res
){
// $updateCommonData['order_message']=DescribeConst::cancelOrderMessage;
// $res=$orderCommonDao->update(array('order_id'=>$order['orderId']),$updateCommonData);
// if(!$update || !$res){
// echo '订单:'.$order['orderId'].'没取消成功!';
// }
if
(
!
$update
){
echo
'订单:'
.
$order
[
'orderId'
]
.
'没取消成功!'
;
}
//$orderGoodsUpdateData['refund_state_name']='退款成功';
...
...
application/models/Business/User/ShareService.php
View file @
0f0eafe4
...
...
@@ -79,7 +79,7 @@ class ShareServiceModel extends \Business\AbstractModel
}
public
function
saveDataToSession
(
$data
){
$this
->
memberDb0Redis
=
\Redis\Db0\MemberRedisModel
::
getInstance
();
$res
=
$this
->
memberDb0Redis
->
table
rpush
(
$data
[
'key'
],
json_encode
(
$data
)
);
$res
=
$this
->
memberDb0Redis
->
table
CacheSet
(
$data
[
'key'
],
json_encode
(
$data
),
ApiConst
::
oneDaySecond
);
return
$res
;
}
//二进制转图片image/png
...
...
@@ -111,6 +111,12 @@ class ShareServiceModel extends \Business\AbstractModel
return
Common
::
format
(
PathConst
::
shareGroups
,
$data
[
'groupId'
],
$data
[
'storeId'
]);
}
if
(
$type
=
'smallPrograme'
){
$host
=
\Bootstrap
::
getUrlIniConfig
(
'resourcesHost'
);
$url
=
Common
::
format
(
$host
.
"/index/getQrcodeFlow?imageKey=
{
0
}
"
,
$data
);
return
$url
;
}
}
public
function
growQrcode
(
$data
){
...
...
@@ -121,12 +127,13 @@ class ShareServiceModel extends \Business\AbstractModel
$scene
=
\Our\Common
::
format
(
\Our\PathConst
::
wxStoreParams
,
$data
[
'id'
]);
$page
=
\Our\PathConst
::
wxStorePath
;
$res
=
$this
->
getQrcode
(
$page
,
$scene
);
$fileName
=
md5
(
$page
.
$res
);
$fileName
=
$fileName
.
NameConst
::
jpgSuffix
;
$base64image
=
$this
->
dataUri
(
$res
,
ImageConst
::
imagePgn
);
$url
=
ImageUtil
::
uploadBase64Image
(
$base64image
,
ImageConst
::
shareImage
,
$fileName
);
$this
->
memberDb0Redis
->
tableCacheSet
(
$fileName
,
$url
,
ApiConst
::
zero
);
return
$url
;
$fileName
=
md5
(
$res
);
//$fileName=$fileName.NameConst::jpgSuffix;
// $base64image=$this->dataUri($res,ImageConst::imagePgn);
// $url= ImageUtil::uploadBase64Image($base64image,ImageConst::shareImage,$fileName);
$this
->
memberDb0Redis
->
tableCacheSet
(
$fileName
,
$res
,
ApiConst
::
oneDaySecond
);
$qrcodeUrl
=
$this
->
getQrUrl
(
$fileName
,
'smallPrograme'
);
return
$qrcodeUrl
;
}
else
{
return
$this
->
getQrUrl
(
$data
);
// return PathConst::wxDefaultPath;
...
...
@@ -143,12 +150,13 @@ class ShareServiceModel extends \Business\AbstractModel
$scene
=
\Our\Common
::
format
(
\Our\PathConst
::
wxGoodsParams
,
$data
[
'id'
]);
$page
=
\Our\PathConst
::
wxGoodsPath
;
$res
=
$this
->
getQrcode
(
$page
,
$scene
);
$fileName
=
md5
(
$page
.
$res
);
$fileName
=
$fileName
.
NameConst
::
jpgSuffix
;
$base64image
=
$this
->
dataUri
(
$res
,
ImageConst
::
imagePgn
);
$url
=
ImageUtil
::
uploadBase64Image
(
$base64image
,
ImageConst
::
shareImage
,
$fileName
);
$this
->
memberDb0Redis
->
tableCacheSet
(
$fileName
,
$url
,
ApiConst
::
zero
);
return
$url
;
$fileName
=
md5
(
$res
);
//$fileName=$fileName.NameConst::jpgSuffix;
// $base64image=$this->dataUri($res,ImageConst::imagePgn);
// $url= ImageUtil::uploadBase64Image($base64image,ImageConst::shareImage,$fileName);
$this
->
memberDb0Redis
->
tableCacheSet
(
$fileName
,
$res
,
ApiConst
::
oneDaySecond
);
$qrcodeUrl
=
$this
->
getQrUrl
(
$fileName
,
'smallPrograme'
);
return
$qrcodeUrl
;
}
else
{
return
$this
->
getQrUrl
(
$data
,
'goods'
);
//return PathConst::wxDefaultPath;
...
...
application/views/index/goods.phtml
View file @
0f0eafe4
...
...
@@ -63,13 +63,11 @@
if
(
pageObj
.
price
!=
pageObj
.
discount
)
document
.
getElementById
(
"price"
).
innerHTML
=
"<span style='font-size:30px;'>¥</span>"
+
(
pageObj
.
price
/
100
).
toFixed
(
2
);
if
(
pageObj
.
type
<=
2
){
document
.
getElementById
(
"qrImg"
).
src
=
pageObj
.
qrImg
;}
else
{
new
QRCode
(
document
.
getElementById
(
'qrcodeImg'
),
pageObj
.
url
);
// if(pageObj.type
<=
2
){
// document.getElementById("qrImg").src = pageObj.qrImg;}
// else{
// new QRCode(document.getElementById('qrcodeImg'), pageObj.url);
// }
}
...
...
application/views/index/saleShare.phtml
View file @
0f0eafe4
...
...
@@ -161,6 +161,7 @@
</div>
</body>
<script>
// new QRCode(document.getElementById('qrcodeImg'), {
// text: '
<?php
//echo $params['qrCode']."?x-oss-process=image/resize,m_fill,h_186,w_186";?>//',
// width: 250,
...
...
application/views/index/store.phtml
View file @
0f0eafe4
...
...
@@ -162,11 +162,19 @@
</div>
</body>
<script>
var
shareType
=
"
<?php
echo
$params
[
'shareType'
];
?>
"
;
var
qrCode
=
'
<?php
echo
$params
[
'qrCode'
];
?>
'
;
var
shareType
=
parseInt
(
shareType
);
if
(
shareType
==
1
||
shareType
==
2
){
document
.
getElementById
(
'qrcodeImg'
).
innerHTML
=
'<img id="qrcodeImg" src="'
+
qrCode
+
'" alt="">'
;
}
else
{
new
QRCode
(
document
.
getElementById
(
'qrcodeImg'
),
{
text
:
'
<?php
echo
$params
[
'qrCode'
];
?>
'
,
width
:
250
,
height
:
250
});
}
</script>
</html>
\ No newline at end of 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