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
76c700cc
Commit
76c700cc
authored
Oct 30, 2018
by
wwccw0591
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master_dev' of git.shenbd.com:qm-develop/shenbd into linqing
parents
5148057d
65ffeedf
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
169 additions
and
3 deletions
+169
-3
DeliveryService.php
application/models/Business/Store/DeliveryService.php
+78
-0
QmDeliverymanLog.php
application/models/DAO/Order/QmDeliverymanLog.php
+12
-0
CodeConfig.php
application/models/Error/CodeConfig.php
+5
-0
Delivery.php
application/modules/Client/controllers/Delivery.php
+69
-0
Shopkeeper.php
application/modules/Client/controllers/Shopkeeper.php
+3
-1
getDeliveriers.php
public/client/delivery/getDeliveriers.php
+1
-1
searchDelivery.php
public/client/delivery/searchDelivery.php
+1
-1
No files found.
application/models/Business/Store/DeliveryService.php
0 → 100644
View file @
76c700cc
<?php
namespace
Business\Store
;
use
DAO\Order\DiliverymanModel
;
use
DAO\StoreModel
;
use
Error\CodeConfigModel
;
use
Error\ErrorModel
;
use
Our\ApiConst
;
/**
* 店主service
*
* @date 2018-5-11
* @author csw
*/
class
DeliveryServiceModel
extends
\Business\AbstractModel
{
public
$clientType
=
false
;
public
function
init
()
{
$this
->
storeDao
=
StoreModel
::
getInstance
();
}
public
function
selectDeliveryMan
(
$data
){
$orderDao
=
\DAO\Order\OrderModel
::
getInstance
(
DbNameConst
::
masterDBConnectName
);
$qmDeliveryManLog
=
\DAO\Order\QmDeliverymanLogModel
::
getInstance
(
DbNameConst
::
masterDBConnectName
);
$orderDao
->
setDb
(
$orderDao
->
dbName
);
$orderDao
->
db
->
doTransaction
();
$orderData
[
'diliveryman_id'
]
=
$data
[
'id'
];
$orderRes
=
$orderDao
->
updateByOrderId
(
$orderData
,
$data
[
'orderId'
]);
if
(
!
$orderRes
){
$orderDao
->
db
->
doRollback
();
ErrorModel
::
throwException
(
CodeConfigModel
::
updateOrderFail
);
}
$qmDeliveryManLogData
[
'diliveryman_id'
]
=
$data
[
'id'
];
$qmDeliveryManLogData
[
'store_id'
]
=
$data
[
'storeId'
];
$qmDeliveryManLogData
[
'order_id'
]
=
$data
[
'orderId'
];
$qmDeliveryManLogData
[
'delivery_state'
]
=
ApiConst
::
deliveryStateWait
;
$qmDeliveryManLogData
[
'distribution_fee'
]
=
$data
[
'distributionFee'
];
$qmDeliveryManLogData
[
'order_type'
]
=
$data
[
'orderType'
];
$qmDeliveryManLogData
[
'get_time'
]
=
TIMESTAMP
;
$res
=
$qmDeliveryManLog
->
insert
(
$data
);
if
(
!
res
){
$orderDao
->
db
->
doRollback
();
ErrorModel
::
throwException
(
CodeConfigModel
::
selectDeliveryFail
);
}
$orderDao
->
db
->
doCommit
();
return
$res
;
}
/**
* 登录业务
*
* @var \Business\User\LoginV2Model
*/
private
static
$_instance
=
null
;
/**
* 单例模式获取类实例
*
* @return \Business\User\LoginV2Model
*/
public
static
function
getInstance
()
{
if
(
!
(
self
::
$_instance
instanceof
self
))
{
self
::
$_instance
=
new
self
();
}
return
self
::
$_instance
;
}
}
application/models/DAO/Order/QmDeliverymanLog.php
View file @
76c700cc
...
...
@@ -50,6 +50,18 @@ class QmDeliverymanLogModel extends \DAO\AbstractModel
return
$this
->
db
->
update
(
$this
->
_tableName
)
->
where
(
$where
)
->
rows
(
$data
)
->
execute
();
}
/**
* 插入数据
* @param $data
* @param $where
* @return mixed
*/
public
function
insert
(
$data
)
{
$this
->
setDb
(
\Our\DbNameConst
::
masterDBConnectName
);
return
$this
->
db
->
insert
(
$this
->
_tableName
)
->
rows
(
$data
)
->
execute
();
}
public
function
updateStatusById
(
$id
)
{
$where
[
'id'
]
=
$id
;
...
...
application/models/Error/CodeConfig.php
View file @
76c700cc
...
...
@@ -285,6 +285,9 @@ class CodeConfigModel
const
platFormAreadyIn
=
300117
;
const
confirmReceiveError
=
300118
;
const
alreadyExsitDeliveryMan
=
300119
;
const
updateOrderFail
=
300120
;
const
selectDeliveryFail
=
300121
;
const
noEnoughStorageForBundlingGoods
=
30118
;
const
noOrderWaitToPay
=
30119
;
const
wrongEvaluation
=
30120
;
...
...
@@ -756,6 +759,8 @@ class CodeConfigModel
self
::
notExistOrderGoods
=>
'退款商品不存在'
,
self
::
noExpressDeliveryForOrder1
=>
'该店铺未配置快递配送'
,
self
::
goodsNoStoreForCartOrOrder1
=>
'商品库存紧张,您的购买数量太多啦'
,
self
::
updateOrderFail
=>
'更新订单表失败'
,
self
::
selectDeliveryFail
=>
'配送员选择失败'
,
self
::
noEnoughStorageForBundlingGoods
=>
'组合销售库存紧张,您购买的数量太多啦'
,
self
::
noOrderWaitToPay
=>
'您的订单已支付,请勿重复支付'
,
self
::
wrongEvaluation
=>
'商品评论应在6-500字之间'
,
...
...
application/modules/Client/controllers/Delivery.php
0 → 100644
View file @
76c700cc
<?php
use
Error\ErrorModel
;
use
Error\CodeConfigModel
;
use
Our\NameConst
;
use
Our\Common
;
use
Business\User\MemberServiceModel
;
use
Business\Store\ShopkeeperServiceModel
;
/**
* 我是店主
*
* @date 2018-5-10
* @author csw <993768343@qq.com>
*/
class
DeliveryController
extends
\Our\Controller_AbstractClient
{
public
$memberService
;
public
$shopkeeperService
;
public
function
init
(){
parent
::
init
();
}
/**
* 选择配送员
*/
public
function
selectDeliveryAction
(){
$deliveryService
=
\Business\Store\DeliveryServiceModel
::
getInstance
();
$data
=
$this
->
req
[
'data'
];
$data
[
'storeId'
]
=
$this
->
storeId
;
$result
=
$deliveryService
->
selectDeliveryMan
(
$data
);
if
(
$result
!==
false
){
$this
->
success
(
$result
,
\Our\DescribeConst
::
successMessage
,
\Our\DescribeConst
::
successMessage
);
}
ErrorModel
::
throwException
(
CodeConfigModel
::
commonError
);
}
/**
* 获得配送员列表
*/
public
function
getDeliveriersAction
(){
$result
=
$this
->
shopkeeperService
->
getDiliveryManByStoreId
(
$this
->
memberId
);
if
(
$result
!==
false
){
$this
->
success
(
$result
,
\Our\DescribeConst
::
successMessage
,
\Our\DescribeConst
::
successMessage
);
}
ErrorModel
::
throwException
(
CodeConfigModel
::
commonError
);
}
/**
* 查询配送员
*
*/
public
function
searchDeliveryAction
(){
$shopkeeperService
=
\Business\Store\ShopkeeperServiceModel
::
getInstance
();
$res
=
$shopkeeperService
->
getDiliveryMan
(
$this
->
req
[
'data'
][
'mobile'
]);
$res
=
$res
?
$res
:
new
\stdClass
();
$this
->
success
(
$res
,
\Our\DescribeConst
::
successMessage
);
}
/**
* 添加配送员
*/
public
function
addDeliveryAction
(){
}
}
application/modules/Client/controllers/Shopkeeper.php
View file @
76c700cc
<?php
use
Error\ErrorModel
;
use
Error\CodeConfigModel
;
use
Our\NameConst
;
use
Our\Common
;
use
Business\User\MemberServiceModel
;
use
Business\Store\ShopkeeperServiceModel
;
...
...
@@ -248,3 +249,4 @@ class ShopkeeperController extends \Our\Controller_AbstractClient {
}
public/client/
shopkeeper
/getDeliveriers.php
→
public/client/
delivery
/getDeliveriers.php
View file @
76c700cc
...
...
@@ -8,7 +8,7 @@
</head>
<body>
<form
action=
"/client/
shopkeeper
/getDeliveriers"
method=
"post"
>
<form
action=
"/client/
Delivery
/getDeliveriers"
method=
"post"
>
用户登录状态key:
<input
name=
"data[key]"
value=
"681c788e2d5a1a67bb4432aebe67c35b"
/><br
/>
...
...
public/client/
shopkeeper
/searchDelivery.php
→
public/client/
delivery
/searchDelivery.php
View file @
76c700cc
...
...
@@ -8,7 +8,7 @@
</head>
<body>
<form
action=
"/client/
shopkeeper
/searchDelivery"
method=
"post"
>
<form
action=
"/client/
Delivery
/searchDelivery"
method=
"post"
>
用户登录状态key:
<input
name=
"data[key]"
value=
"73526b0db474f2a0e5f80c67301be73d"
/><br
/>
配送员电话:
<input
name=
"data[mobile]"
value=
"18305954587"
/><br
/>
<input
type=
"submit"
value=
"提交"
>
...
...
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