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
914ee049
Commit
914ee049
authored
Sep 25, 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
e351a41d
1c23cdf5
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
135 additions
and
12 deletions
+135
-12
Pinyin.php
application/library/Our/Pinyin.php
+67
-0
EvaluationService.php
application/models/Business/Goods/EvaluationService.php
+3
-4
StoreService.php
application/models/Business/Store/StoreService.php
+8
-0
AddressService.php
application/models/Business/User/AddressService.php
+16
-0
Area.php
application/models/DAO/Area.php
+25
-8
CodeConfig.php
application/models/Error/CodeConfig.php
+2
-0
cityPinyin.php
scripts/crontab/store/cityPinyin.php
+14
-0
No files found.
application/library/Our/Pinyin.php
0 → 100644
View file @
914ee049
This source diff could not be displayed because it is too large. You can
view the blob
instead.
application/models/Business/Goods/EvaluationService.php
View file @
914ee049
...
...
@@ -45,7 +45,6 @@ class EvaluationServiceModel extends \Business\AbstractModel {
*/
public
function
submit
(
$data
,
$memberId
){
list
(
$data
,
$order
,
$orderGoods
)
=
$this
->
_submitValite
(
$data
,
$memberId
);
$log
=
\Our\Log
::
getInstance
();
foreach
(
$orderGoods
as
$v
){
$orderGoods
[
$v
[
'goods_id'
]]
=
$v
;
}
...
...
@@ -218,15 +217,15 @@ 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
);
if
(
!
empty
(
$v
[
'content'
])
&&
(
mb_strlen
(
$v
[
'content'
])
<
6
||
mb_strlen
(
$v
[
'content'
])
>
500
))
{
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
wrongEvaluation
);
}
}
//获取订单商品
$orderGoodsInstance
=
\DAO\Order\OrderGoodsModel
::
getInstance
(
\Our\DbNameConst
::
masterDBConnectName
);
...
...
application/models/Business/Store/StoreService.php
View file @
914ee049
...
...
@@ -48,6 +48,14 @@ class StoreServiceModel extends \Business\AbstractModel{
\Redis\Db4\SaleActivityRedisModel
::
getInstance
()
->
tableDel
(
'storeId:'
.
$storeId
);
}
}
$storeMembers
=
array
();
$storeMember
=
array
();
$storeMember
[
'store_id'
]
=
$storeId
;
$storeMember
[
'member_id'
]
=
$memberId
;
$storeMember
[
'fav_from'
]
=
\Our\ApiConst
::
scanFavor
;
$storeMembers
[]
=
$storeMember
;
$favoritesStoreDao
=
\DAO\FavoritesStoreModel
::
getInstance
();
$result
=
$favoritesStoreDao
->
insertAll
(
$storeMembers
);
}
else
{
$sess
=
\Yaf\Session
::
getInstance
();
$scan_store_ids
=
$sess
->
get
(
'scan_store_ids'
);
...
...
application/models/Business/User/AddressService.php
View file @
914ee049
...
...
@@ -413,6 +413,22 @@ class AddressServiceModel extends \Business\AbstractModel {
return
$result
;
}
public
function
createPinyin
(){
$areaDao
=
\DAO\AreaModel
::
getInstance
();
$pageSize
=
1000
;
$pageIndex
=
0
;
for
(
$i
=
$pageIndex
;
$i
<
4
;
$i
++
){
$pageIndex
=
$i
*
$pageSize
;
$limit
=
array
(
$pageIndex
,
$pageSize
);
$areaList
=
$areaDao
->
getList
(
$limit
);
foreach
(
$areaList
as
$area
){
$updateData
=
array
();
$updateData
[
'pinyin'
]
=
ucfirst
(
\Our\Pinyin
::
pinyin
(
$area
[
'area_name'
]));
$areaDao
->
update
(
array
(
'area_id'
=>
$area
[
'area_id'
]),
$updateData
);
}
}
}
/**
* 获取城市列表
* @return bool
...
...
application/models/DAO/Area.php
View file @
914ee049
...
...
@@ -50,6 +50,22 @@ class AreaModel extends \DAO\AbstractModel {
return
$result
;
}
public
function
update
(
$where
,
$data
){
$this
->
setDb
(
\Our\DbNameConst
::
masterDBConnectName
);
return
$this
->
db
->
update
(
$this
->
_tableName
)
->
where
(
$where
)
->
rows
(
$data
)
->
execute
();
}
public
function
getList
(
$limit
){
$this
->
setDb
(
$this
->
dbName
);
$this
->
db
->
select
(
\Our\NameConst
::
allField
)
->
from
(
$this
->
_tableName
);
if
(
$limit
){
$this
->
db
->
limit
(
$limit
[
0
],
$limit
[
1
]);
}
$areaList
=
$this
->
db
->
fetchAll
();
return
$areaList
;
}
public
function
getCityListWithoutCounty
(){
$addressRedis
=
AddressRedisModel
::
getInstance
();
$cityList
=
$addressRedis
->
find
(
'cityListWithoutCounty'
);
...
...
@@ -60,17 +76,19 @@ class AreaModel extends \DAO\AbstractModel {
$addressRedis
->
update
(
'allCityListWithoutCounty'
,
$areaList
);
$cityListInitial
=
array
();
$cityInitialList
=
array
();
$cityPinyinList
=
array
();
foreach
(
$areaList
as
$area
){
if
(
isset
(
$area
[
'initial'
])
&&
$area
[
'initial'
]
&&!
(
$cityInitialList
&&
in_array
(
$area
[
'initial'
],
$cityInitialList
))){
$cityInitialList
[]
=
$area
[
'initial'
];
}
$city
ListInitial
[
$area
[
'initial'
]][]
=
$area
[
'area_name'
]
;
$cityListInitial
[
$area
[
'initial'
]][]
=
$area
[
'area_name'
]
;
$city
PinyinList
[
$area
[
'initial'
]][]
=
array
(
'name'
=>
$area
[
'area_name'
],
'pinyin'
=>
$area
[
'pinyin'
])
;
}
$list
=
array
();
foreach
(
$cityInitialList
as
$inital
){
$initalCity
[
'initial'
]
=
$inital
;
$initalCity
[
'list'
]
=
$cityListInitial
[
$inital
];
$initalCity
[
'pinyinList'
]
=
$cityPinyinList
[
$inital
];
$list
[]
=
$initalCity
;
}
$addressRedis
->
update
(
'cityListWithoutCounty'
,
$list
);
...
...
@@ -93,11 +111,13 @@ class AreaModel extends \DAO\AbstractModel {
}
$cityListInitial
[
$area
[
'initial'
]][]
=
$area
[
'area_name'
];
$cityPinyinList
[
$area
[
'initial'
]][]
=
array
(
'name'
=>
$area
[
'area_name'
],
'pinyin'
=>
$area
[
'pinyin'
]);
}
$list
=
array
();
foreach
(
$cityInitialList
as
$inital
){
$initalCity
[
'initial'
]
=
$inital
;
$initalCity
[
'list'
]
=
$cityListInitial
[
$inital
];
$initalCity
[
'pinyinList'
]
=
$cityPinyinList
[
$inital
];
$list
[]
=
$initalCity
;
}
$addressRedis
->
update
(
'cityList'
,
$list
);
...
...
@@ -106,16 +126,13 @@ class AreaModel extends \DAO\AbstractModel {
public
function
getAllCityList
(
$withoutCounty
=
false
){
$this
->
setDb
(
$this
->
dbName
);
$sql
=
" SELECT t1.area_name, t2.f_py as initial FROM han_area t1 "
;
$sql
.=
" left join han_coslers t2 "
;
$sql
.=
" on CONV(HEX(LEFT(CONVERT(t1.area_name USING gbk ), 1)), 16, 10) BETWEEN t2.cbegin AND t2.cend
where t1.is_city=1 "
;
$sql
=
" SELECT t1.area_name,t1.pinyin, LEFT(t1.pinyin,1) as initial FROM han_area t1 "
;
$sql
.=
" where t1.is_city=1 "
;
if
(
$withoutCounty
){
$sql
.=
" and t1.area_name not like '%县'"
;
}
$sql
.=
" ORDER BY t1.area_deep,
convert(t1.area_name using gbk)
ASC "
;
$sql
.=
" ORDER BY t1.area_deep,
t1.pinyin
ASC "
;
$area_list
=
$this
->
db
->
query
(
$sql
)
->
rows
;
echo
$this
->
db
->
getLastSql
();
return
$area_list
;
}
...
...
application/models/Error/CodeConfig.php
View file @
914ee049
...
...
@@ -282,6 +282,7 @@ class CodeConfigModel {
const
noEnoughStorageForBundlingGoods
=
30118
;
const
noOrderWaitToPay
=
30119
;
const
wrongEvaluation
=
30120
;
//店铺相关错误码
//商品分类
...
...
@@ -758,6 +759,7 @@ class CodeConfigModel {
self
::
goodsNoStoreForCartOrOrder1
=>
'商品库存紧张,您的购买数量太多啦'
,
self
::
noEnoughStorageForBundlingGoods
=>
'组合销售库存紧张,您购买的数量太多啦'
,
self
::
noOrderWaitToPay
=>
'您的订单已支付,请勿重复支付'
,
self
::
wrongEvaluation
=>
'商品评论应在6-500字之间'
,
//销售员
self
::
emptySaleGoodsId
=>
'商品id不能为空'
,
self
::
emptySaleGoods
=>
'销售商品不存在'
,
...
...
scripts/crontab/store/cityPinyin.php
0 → 100644
View file @
914ee049
<?php
/**
* User: liuyuzhen
* Date: 2018/9/26
* Time: 10:15
* Description:
*/
define
(
"APPLICATION_PATH"
,
realpath
(
dirname
(
__FILE__
)
.
'/../../../'
));
//指向public的上一级
require
APPLICATION_PATH
.
'/scripts/crontab/baseCli.php'
;
require
APPLICATION_PATH
.
'/scripts/crontab/common.php'
;
error_reporting
(
E_ALL
^
E_NOTICE
);
\Business\User\AddressServiceModel
::
getInstance
()
->
createPinyin
();
EXIT
;
?>
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