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
5e6a94ca
Commit
5e6a94ca
authored
Aug 29, 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
9357d0e9
3c41fd88
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
63 additions
and
21 deletions
+63
-21
a.php
a.php
+2
-0
Common.php
application/controllers/Common.php
+11
-0
Store.php
application/controllers/Store.php
+0
-1
ArrayConst.php
application/library/Our/ArrayConst.php
+2
-1
Common.php
application/library/Our/Common.php
+11
-1
DescribeConst.php
application/library/Our/DescribeConst.php
+2
-0
Log.php
application/library/Our/Log.php
+4
-4
NameConst.php
application/library/Our/NameConst.php
+3
-0
OrderConst.php
application/library/Our/OrderConst.php
+1
-1
EvaluationService.php
application/models/Business/Goods/EvaluationService.php
+15
-8
GoodsCommonService.php
application/models/Business/Goods/GoodsCommonService.php
+1
-1
FootprintService.php
application/models/Business/User/FootprintService.php
+1
-1
CodeConfig.php
application/models/Error/CodeConfig.php
+3
-1
goodsdetail.phtml
application/views/index/goodsdetail.phtml
+7
-2
No files found.
a.php
0 → 100644
View file @
5e6a94ca
<?php
echo
3333
;
application/controllers/Common.php
View file @
5e6a94ca
...
...
@@ -68,4 +68,15 @@ class CommonController extends \Our\Controller_AbstractIndex{
$articleList
=
$commonProbleService
->
getProblemList
(
true
);
$this
->
success
(
$articleList
);
}
public
function
logAction
(){
$logContent
=
trim
(
$this
->
req
[
\Our\NameConst
::
data
][
'content'
]);
if
(
!
$logContent
){
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
emptyLog
);
}
$log
=
\Our\Log
::
getInstance
();
// $log->write(print_r($data, true));
$log
->
write
(
$logContent
,
\Our\NameConst
::
frontLogPath
);
$this
->
success
(
new
stdClass
(),
\Our\DescribeConst
::
logWriteSuccess
,
\Our\DescribeConst
::
logWriteSuccess
);
}
}
\ No newline at end of file
application/controllers/Store.php
View file @
5e6a94ca
...
...
@@ -24,7 +24,6 @@ class StoreController extends \Our\Controller_AbstractIndex {
*/
public
function
indexAction
(){
$recommendGoods
=
$this
->
storeService
->
getRecommendGoodsCache
(
$this
->
req
[
\Our\NameConst
::
data
],
$this
->
memberId
);
// $adv = array('href'=>'http://qm.22ca.com/qm/tmpl/goods.html?goods_commonid=101654','imageUrl'=>'http://qmoss-01.oss-cn-hangzhou.aliyuncs.com/data/upload/mall/adv/05715960161498410.jpg');
$adv
=
\Business\Common\AdvServiceModel
::
getInstance
()
->
getStoreAdvs
(
$this
->
req
[
\Our\NameConst
::
data
],
\Our\AdvConst
::
storePageMid
);
$hotSale
=
$this
->
storeService
->
getHotSaleGoods
(
$this
->
req
[
\Our\NameConst
::
data
],
$this
->
memberId
);
$recommendGoodsClasses
=
$this
->
storeService
->
getRecommendClassCache
(
$this
->
req
[
\Our\NameConst
::
data
]);
...
...
application/library/Our/ArrayConst.php
View file @
5e6a94ca
...
...
@@ -58,7 +58,8 @@ class ArrayConst
const
defaultAddress
=
array
(
NameConst
::
cityCode
=>
'0591'
,
NameConst
::
lat
=>
'26.053183'
,
NameConst
::
lng
=>
'119.24174'
NameConst
::
lng
=>
'119.24174'
,
NameConst
::
address
=>
'横一号路特力林科技大厦'
);
//小程序账号
...
...
application/library/Our/Common.php
View file @
5e6a94ca
...
...
@@ -94,13 +94,23 @@ class Common
public
static
function
getBaseUrl
(){
$prefix
=
'http'
;
if
(
isset
(
$_SERVER
[
'HTTPS'
])
&&
$_SERVER
[
'HTTPS'
]
==
'on'
){
if
(
self
::
is_https
()
){
$prefix
=
'https'
;
}
$url
=
$prefix
.
'://'
.
$_SERVER
[
'SERVER_NAME'
];
return
$url
;
}
function
is_https
()
{
if
(
!
empty
(
$_SERVER
[
'HTTPS'
])
&&
strtolower
(
$_SERVER
[
'HTTPS'
])
!==
'off'
)
{
return
true
;
}
elseif
(
isset
(
$_SERVER
[
'HTTP_X_FORWARDED_PROTO'
])
&&
$_SERVER
[
'HTTP_X_FORWARDED_PROTO'
]
===
'https'
)
{
return
true
;
}
elseif
(
!
empty
(
$_SERVER
[
'HTTP_FRONT_END_HTTPS'
])
&&
strtolower
(
$_SERVER
[
'HTTP_FRONT_END_HTTPS'
])
!==
'off'
)
{
return
true
;
}
return
false
;
}
/**
* 获取静态资源文件
...
...
application/library/Our/DescribeConst.php
View file @
5e6a94ca
...
...
@@ -86,6 +86,8 @@ class DescribeConst
const
paySuccessTips
=
'支付成功'
;
const
paySuccessSubTips
=
'感谢您的购买'
;
const
logWriteSuccess
=
'日志写入成功'
;
//支付方式描述
const
offPay
=
'线下支付'
;
const
wxPay
=
'微信支付'
;
...
...
application/library/Our/Log.php
View file @
5e6a94ca
...
...
@@ -14,8 +14,8 @@ class Log {
*
* @param string $message
*/
public
function
write
(
$message
)
{
fwrite
(
$this
->
getHandle
(),
date
(
"Y-m-d H:i:s"
)
public
function
write
(
$message
,
$filePath
=
'/data/log/application'
)
{
fwrite
(
$this
->
getHandle
(
$filePath
),
date
(
"Y-m-d H:i:s"
)
.
"
\t
"
.
$message
.
"
\t
uri:"
.
$_SERVER
[
'REQUEST_URI'
]
.
"
\t
ref:"
.
(
isset
(
$_SERVER
[
'HTTP_REFERER'
])
?
$_SERVER
[
'HTTP_REFERER'
]
:
''
)
...
...
@@ -27,9 +27,9 @@ class Log {
*
* @return
*/
public
function
getHandle
()
{
public
function
getHandle
(
$filePath
=
'/data/log/application'
)
{
if
(
!
$this
->
_handle
)
{
$this
->
_handle
=
fopen
(
APPLICATION_PATH
.
'/data/log/application'
.
date
(
'Ymd'
)
.
'.log'
,
'a'
);
$this
->
_handle
=
fopen
(
APPLICATION_PATH
.
$filePath
.
date
(
'Ymd'
)
.
'.log'
,
'a'
);
}
return
$this
->
_handle
;
...
...
application/library/Our/NameConst.php
View file @
5e6a94ca
...
...
@@ -71,6 +71,7 @@ class NameConst {
const
cityCode
=
'cityCode'
;
const
lat
=
'lat'
;
const
lng
=
'lng'
;
const
address
=
'address'
;
const
wechatAuthUrl
=
'https://api.weixin.qq.com/sns/jscode2session?'
;
...
...
@@ -157,6 +158,8 @@ class NameConst {
const
cancelUnPayedOrderTimePrefix
=
'cancelUnPayedOrderTime'
;
const
cancelUnReceivedOrderTimePrefix
=
'cancelUnReceivedOrderTime'
;
const
frontLogPath
=
'/data/log/front'
;
}
?>
\ No newline at end of file
application/library/Our/OrderConst.php
View file @
5e6a94ca
...
...
@@ -52,7 +52,7 @@ class OrderConst {
const
storeWaiteSend
=
'请尽快发货'
;
const
waitBuyerConfirmRecieve
=
'等待用户确认收货'
;
const
defaultComment
=
'好评!'
;
}
...
...
application/models/Business/Goods/EvaluationService.php
View file @
5e6a94ca
...
...
@@ -44,7 +44,7 @@ class EvaluationServiceModel extends \Business\AbstractModel {
* @throws \Our\Exception
*/
public
function
submit
(
$data
,
$memberId
){
list
(
$
order
,
$orderGoods
)
=
$this
->
_submitValite
(
$data
,
$memberId
);
list
(
$
data
,
$order
,
$orderGoods
)
=
$this
->
_submitValite
(
$data
,
$memberId
);
foreach
(
$orderGoods
as
$v
){
$orderGoods
[
$v
[
'goods_id'
]]
=
$v
;
...
...
@@ -63,7 +63,7 @@ class EvaluationServiceModel extends \Business\AbstractModel {
$evaluation
[
'geval_goodsprice'
]
=
$orderGoods
[
$v
[
'goodsId'
]][
'goods_pay_price'
];
$evaluation
[
'geval_goodsimage'
]
=
$orderGoods
[
$v
[
'goodsId'
]][
'goods_image'
];
$evaluation
[
'geval_scores'
]
=
intval
(
$v
[
'scores'
]);
$evaluation
[
'geval_content'
]
=
trim
(
$v
[
'geval_content'
])
;
$evaluation
[
'geval_content'
]
=
$v
[
'geval_content'
]
?
trim
(
$v
[
'geval_content'
])
:
\Our\OrderConst
::
defaultComment
;
$evaluation
[
'geval_isanonymous'
]
=
intval
(
$data
[
'isanonymous'
]);
$evaluation
[
'geval_addtime'
]
=
time
();
$evaluation
[
'geval_storeid'
]
=
$order
[
'store_id'
];
...
...
@@ -73,6 +73,7 @@ class EvaluationServiceModel extends \Business\AbstractModel {
$evaluation
[
'memberAvatar'
]
=
$memberAvatar
;
//$images = $this->_upload($v['images']);
$images
=
$v
[
'images'
];
if
(
!
is_array
(
$images
))
$images
=
json_decode
(
$images
,
true
);
$images
?
$data
[
'goods'
][
$k
][
'haveImg'
]
=
1
:
$data
[
'goods'
][
$k
][
'haveImg'
]
=
0
;
$evaluation
[
'geval_image'
]
=
serialize
(
$images
);
$goodsInstance
=
\DAO\GoodsModel
::
getInstance
();
...
...
@@ -81,8 +82,10 @@ class EvaluationServiceModel extends \Business\AbstractModel {
$data
[
'goods'
][
$k
][
'goodsCommonId'
]
=
$evaluation
[
'geval_goods_commonid'
];
$evaluations
[]
=
$evaluation
;
}
$log
=
\Our\Log
::
getInstance
();
$log
->
write
(
json_encode
(
$evaluations
));
$result
=
\DAO\EvaluateGoodsModel
::
getInstance
()
->
insertAll
(
$evaluations
);
$log
->
write
(
json_encode
(
$result
));
if
(
!
$result
){
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
commonError
);
}
...
...
@@ -153,12 +156,13 @@ class EvaluationServiceModel extends \Business\AbstractModel {
\DAO\StoreScoreStatisticsModel
::
getInstance
()
->
insertOrUpdate
(
array
(
'store_id'
=>
$order
[
'store_id'
],
'evaluation_score'
=>
$grade
[
'evaluation_score'
],
'evaluation_number'
=>
$grade
[
'evaluation_number'
]));
}
//修改订单状态
\DAO\Order\OrderModel
::
getInstance
()
->
update
(
array
(
'order_id'
=>
$order
[
'order_id'
]),
array
(
'evaluation_state'
=>
1
));
// 删除缓存 首页待评价数量-1
$orderInstance
=
\DAO\Order\OrderModel
::
getInstance
();
//修改订单状态
$orderInstance
->
update
(
array
(
'order_id'
=>
$order
[
'order_id'
]),
array
(
'evaluation_state'
=>
1
));
//删除缓存
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db5\OrderRedisModel
::
getInstance
(),
array
(
&
$orderInstance
,
'find'
),
array
(),
array
(
$order
[
'order_id'
]));
\DAO\MemberModel
::
getInstance
()
->
_changeNum
(
\Our\NameConst
::
waitEvaluate
,
$memberId
,
-
1
);
//\DAO\MemberModel::getInstance()->_changeNum(\Our\NameConst::waitEvaluate,$memberId,-1);
$orderInstance
->
deleteOrderCache
(
$memberId
,
$order
[
'order_id'
]);
}
/**
...
...
@@ -205,9 +209,12 @@ class EvaluationServiceModel extends \Business\AbstractModel {
$param
[
'descCredit'
]
||
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
emptyDescCredit
);
$param
[
'deliveryCredit'
]
||
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
emptyDeliveryCredit
);
$param
[
'deliveryCredit'
]
||
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
emptyServiceCredit
);
$log
=
\Our\Log
::
getInstance
();
$log
->
write
(
json_encode
(
$param
[
'goods'
]));
if
(
!
is_array
(
$param
[
'goods'
]))
{
$param
[
'goods'
]
=
json_decode
(
$param
[
'goods'
],
true
);
}
$log
->
write
(
json_encode
(
$param
[
'goods'
]));
foreach
(
$param
[
'goods'
]
as
$v
){
$v
[
'goodsId'
]
||
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
emptyGoodsId
);
$v
[
'scores'
]
||
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
emptyScores
);
...
...
@@ -228,7 +235,7 @@ class EvaluationServiceModel extends \Business\AbstractModel {
if
(
$goodsIds1
!=
$goodsIds2
){
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
orderError
);
}
return
array
(
$
order
,
$orderGoods
);
return
array
(
$
param
,
$order
,
$orderGoods
);
}
public
function
autoEvaluate
()
{
$list
=
\DAO\Order\OrderModel
::
getInstance
()
->
getList
(
array
(
'finnshed_time'
=>
array
(
'elt'
,
time
()
-
(
\Our\ApiConst
::
sevenDaySecond
)),
'evaluation_state'
=>
\Our\ApiConst
::
waitEvaluation
),
'order_id'
,
0
,
1000
,
''
);
...
...
application/models/Business/Goods/GoodsCommonService.php
View file @
5e6a94ca
...
...
@@ -326,7 +326,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$attrbuteDAO
=
\DAO\GoodsAttributeModel
::
getInstance
();
$productData
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db4\GoodsAttributeRedisModel
::
getInstance
(),
array
(
&
$attrbuteDAO
,
'option'
),
array
(
'attribute,attribute_value'
,
array
(
'goods_commonid'
=>
$goodsCommonId
)),
\Our\ApiConst
::
oneDaySecond
,
array
(
$goodsCommonId
));
$html
=
array
(
'width'
=>
750
,
'height'
=>
$commonInfo
[
'goods_height'
],
'url'
=>
'/index/goodsDetail?goodsCommonId='
.
$goodsCommonId
);
$html
=
array
(
'width'
=>
750
,
'height'
=>
$commonInfo
[
'goods_height'
],
'url'
=>
\Our\Common
::
getBaseUrl
()
.
'/index/goodsDetail?goodsCommonId='
.
$goodsCommonId
);
unset
(
$attrs
[
'commonInfo'
]);
return
array_merge
(
array
(
'storeId'
=>
$commonInfo
[
'store_id'
],
'goodsId'
=>
$commonInfo
[
'goodsId'
],
'goodsName'
=>
$commonInfo
[
'goods_name'
],
'goodsVerify'
=>
$commonInfo
[
'goods_verify'
],
'goodsState'
=>
$commonInfo
[
'goods_state'
],
'saleCount'
=>
$commonInfo
[
'sale_num'
],
'collectionState'
=>
$collectionState
,
'isOwn'
=>
$isOwn
,
'isHot'
=>
$commonInfo
[
'goods_hot'
],
'isRecoment'
=>
$commonInfo
[
'goods_commend'
],
'isFree'
=>
$commonInfo
[
'goods_free'
],
'isVirtual'
=>
$commonInfo
[
'is_virtual'
],
'goodsMostLimit'
=>
$commonInfo
[
'goods_most_limit'
],
'goodsLeastLimit'
=>
$commonInfo
[
'goods_least_limit'
],
'goodsTotalLimit'
=>
$commonInfo
[
'goods_total_limit'
],
'address'
=>
$area
,
'range'
=>
$rangePrice
,
'productData'
=>
$productData
,
'htmlContent'
=>
$html
,
'videoUrl'
=>
$commonInfo
[
'goods_youku_url'
]),
$attrs
);
}
...
...
application/models/Business/User/FootprintService.php
View file @
5e6a94ca
...
...
@@ -41,7 +41,7 @@ class FootprintServiceModel extends \Business\AbstractModel
*/
public
function
getFootprints
(
$param
,
$memberId
){
// $pageSize = (int)($param['pageSize']);
//
$pageIndex
= (int)($param['pageIndex']);
//
k
= (int)($param['pageIndex']);
$viewTime
=
(
int
)(
$param
[
'viewTime'
]);
if
(
$viewTime
===
0
){
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
ViewTimeNotExist
);
...
...
application/models/Error/CodeConfig.php
View file @
5e6a94ca
...
...
@@ -90,6 +90,7 @@ class CodeConfigModel {
const
updateMobileMembmerMappingFailed
=
10077
;
const
currentMobileHasBeenBind
=
10078
;
const
otherDriverLogin
=
10105
;
const
emptyLog
=
10106
;
//访问错误
const
illegalAccess
=
200001
;
...
...
@@ -745,7 +746,8 @@ class CodeConfigModel {
self
::
updateMobileMembmerMappingFailed
=>
'更新手机号码对应会员mapping信息失败'
,
self
::
currentMobileHasBeenBind
=>
'当前手机号码已经绑定其他微信,如需绑定,请先手机号码登录app进行微信解绑'
,
self
::
otherDriverLogin
=>
'当前用户已被其他设备登录,请重新登录'
,
self
::
elasticsError
=>
'全文索引连接出错'
self
::
elasticsError
=>
'全文索引连接出错'
,
self
::
emptyLog
=>
'日志内容不能为空'
);
}
...
...
application/views/index/goodsdetail.phtml
View file @
5e6a94ca
...
...
@@ -3,10 +3,11 @@
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xml:lang=
"en"
>
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html;charset=UTF-8 ?>"
>
<title>
Document
</title>
<title>
商品详情
</title>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0,user-scalable=no"
>
</head>
<body>
<div
style=
"width: 750px"
>
<div>
<?php
echo
$commonInfo
[
'goods_body'
];
?>
</div>
</body>
...
...
@@ -16,5 +17,9 @@
margin
:
0
;
padding
:
0
;
}
img
{
max-width
:
100%
;
height
:
auto
;
}
</style>
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