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
a8b38774
Commit
a8b38774
authored
Oct 30, 2018
by
wwccw0591
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pc
parent
e4f99a5d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
968 additions
and
888 deletions
+968
-888
OrderConfirmUtil.php
application/library/Order/OrderConfirmUtil.php
+1
-1
ShopkeeperService.php
application/models/Business/Store/ShopkeeperService.php
+32
-3
Member.php
application/models/DAO/Member.php
+673
-668
Diliveryman.php
application/models/DAO/Order/Diliveryman.php
+6
-15
Order.php
application/models/DAO/Order/Order.php
+5
-0
CodeConfig.php
application/models/Error/CodeConfig.php
+188
-197
Shopkeeper.php
application/modules/Client/controllers/Shopkeeper.php
+24
-3
User.php
application/modules/Client/controllers/User.php
+1
-1
receivePayment.php
public/client/shopkeeper/receivePayment.php
+20
-0
searchDelivery.php
public/client/shopkeeper/searchDelivery.php
+18
-0
No files found.
application/library/Order/OrderConfirmUtil.php
View file @
a8b38774
...
...
@@ -959,7 +959,7 @@ class OrderConfirmUtil {
$memberId
=
$orderList
[
0
][
'buyer_id'
];
$updateOrder
=
array
();
$updateOrder
[
'order_state'
]
=
\Our\ApiConst
::
orderStateWaitConfirm
;
$updateOrder
[
'is_receive_payment'
]
=
\Our\ApiConst
::
one
;
$updateOrder
[
'is_receive_payment'
]
=
TIMESTAMP
;
$updateOrder
[
'payment_time'
]
=
(
isset
(
$data
[
'payment_time'
])
?
strtotime
(
$data
[
'payment_time'
])
:
TIMESTAMP
);
$updateOrder
[
'payment_type'
]
=
$this
->
getOrderPaymentType
(
$data
[
'pay_type'
]);
$orderUpdateResult
=
$orderModel
->
update
(
$orderCon
,
$updateOrder
);
...
...
application/models/Business/Store/ShopkeeperService.php
View file @
a8b38774
...
...
@@ -268,14 +268,14 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
return
$data
;
}
public
function
getRetrunDatas
(
$storeId
,
$where
,
$pageIndex
,
$pageSize
)
public
function
getRetrunDatas
(
$storeId
,
$where
,
$pageIndex
,
$pageSize
,
$order
=
array
(
'gmt_update'
=>
'desc'
)
)
{
$orderGoodsDao
=
\DAO\Order\OrderGoodsModel
::
getInstance
();
$orderDao
=
\DAO\Order\OrderModel
::
getInstance
();
$goodsDao
=
\DAO\GoodsModel
::
getInstance
();
$orderCommonDao
=
\DAO\Order\OrderCommonModel
::
getInstance
();
$returnData
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db5\OrderRedisModel
::
getInstance
(),
array
(
&
$orderDao
,
'getList'
),
array
(
$where
,
$orderDao
->
getOrderDetailField
(),
$pageIndex
,
$pageSize
,
$order
=
array
(
'gmt_update'
=>
'desc'
)),
\Our\ApiConst
::
oneDaySecond
,
array
(
$storeId
));
$returnData
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db5\OrderRedisModel
::
getInstance
(),
array
(
&
$orderDao
,
'getList'
),
array
(
$where
,
$orderDao
->
getOrderDetailField
(),
$pageIndex
,
$pageSize
,
$order
,
\Our\ApiConst
::
oneDaySecond
,
array
(
$storeId
)
));
//$returnData = $orderDao->getOrders($where, $this->orderListField, $pageIndex, $pageSize);
$orders
=
$returnData
[
'list'
];
if
(
!
empty
(
$orders
))
{
...
...
@@ -363,6 +363,7 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
public
function
getOrders
(
$memberId
,
$pageIndex
,
$pageSize
,
$orderState
,
$keyword
)
{
$order
=
array
(
'gmt_update'
=>
'desc'
);
$storeId
=
$this
->
_getStoreByMemberId
(
$memberId
);
if
(
empty
(
$storeId
))
{
ErrorModel
::
throwException
(
CodeConfigModel
::
paramsError
);
...
...
@@ -383,6 +384,10 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
if
(
$orderState
==
ApiConst
::
oneHandred
)
{
$where
.=
' and han_order.shipping_type='
.
ApiConst
::
bySelf
;
}
else
{
$order
=
array
(
'diliveryman_id'
=>
'asc'
,
'gmt_update'
=>
'asc'
);
$where
.=
' and han_order.shipping_type='
.
ApiConst
::
bySeller
;
}
...
...
@@ -394,7 +399,7 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
}
if
(
!
empty
(
$where
))
{
$returnData
=
$this
->
getRetrunDatas
(
$storeId
,
$where
,
$pageIndex
,
$pageSize
);
$returnData
=
$this
->
getRetrunDatas
(
$storeId
,
$where
,
$pageIndex
,
$pageSize
,
$order
);
}
else
{
$returnData
=
new
\stdClass
();
}
...
...
@@ -417,6 +422,23 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
return
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db5\OrderRedisModel
::
getInstance
(),
array
(
&
$diliveryMan
,
'getDeliveryManByStoreId'
),
array
(
$storeId
),
\Our\ApiConst
::
oneHourCache
,
array
(
$storeId
));
}
public
function
confirmReceivePayment
(
$memberId
,
$orderId
){
$memberDao
=
\DAO\MemberModel
::
getInstance
();
$storeId
=
$memberDao
->
getInfo
(
$memberId
,
'store_id'
);
$orderDao
=
\DAO\Order\OrderModel
::
getInstance
(
DbNameConst
::
masterDBConnectName
);
$where
[
'order_id'
]
=
$orderId
;
$where
[
'store_id'
]
=
$storeId
;
$count
=
$orderDao
->
getCountByWhere
(
$where
);
if
(
$count
){
$data
[
'is_receive_payment'
]
=
TIMESTAMP
;
$updateId
=
$orderDao
->
updateByOrderId
(
$data
,
$orderId
);
return
$updateId
;
}
else
{
ErrorModel
::
throwException
(
CodeConfigModel
::
notExsitOrder
);
}
}
/**
* 订单详情
*/
...
...
@@ -886,6 +908,13 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
return
$res
;
}
public
function
getDiliveryMan
(
$mobile
){
$memberDao
=
\DAO\MemberModel
::
getInstance
();
$member
=
$memberDao
->
getByMemberMobile
(
$mobile
);
return
$member
;
}
/**
* 登录业务
*
...
...
application/models/DAO/Member.php
View file @
a8b38774
This diff is collapsed.
Click to expand it.
application/models/DAO/Order/Diliveryman.php
View file @
a8b38774
...
...
@@ -39,21 +39,6 @@ class DiliverymanModel extends \DAO\AbstractModel
}
public
function
getCount
(
$where
,
$isArray
=
true
)
{
$this
->
setDb
();
if
(
!
$isArray
)
{
$str
=
'$count = $this->db->from($this->_tableName)'
;
foreach
(
$where
as
$v
)
{
$str
.=
"->where('
$v
')"
;
}
$str
.=
"->fetchNum();"
;
eval
(
$str
);
return
$count
;
}
return
$this
->
db
->
from
(
$this
->
_tableName
)
->
where
(
$where
)
->
fetchNum
();
}
/**
* 获取单条数据
* @param $where
...
...
@@ -80,6 +65,12 @@ class DiliverymanModel extends \DAO\AbstractModel
$where
[
$this
->
_primaryKey
]
=
$id
;
return
$this
->
find
(
$where
);
}
public
function
getByMobile
(
$mobile
){
$this
->
setDb
(
$this
->
dbName
);
$where
[
'mobile'
]
=
$mobile
;
$result
=
$this
->
find
(
$where
);
return
$result
;
}
public
function
getDeliveryManFields
()
{
return
array
(
...
...
application/models/DAO/Order/Order.php
View file @
a8b38774
...
...
@@ -233,6 +233,11 @@ class OrderModel extends \DAO\AbstractModel
return
$this
->
db
->
update
(
$this
->
_tableName
)
->
where
(
$where
)
->
rows
(
$data
)
->
execute
();
}
public
function
updateByOrderId
(
$data
,
$orderId
){
$where
[
'order_id'
]
=
$orderId
;
$res
=
$this
->
update
(
$where
,
$data
);
return
$res
;
}
public
function
insert
(
$data
)
{
$this
->
setDb
(
\Our\DbNameConst
::
masterDBConnectName
);
...
...
application/models/Error/CodeConfig.php
View file @
a8b38774
This diff is collapsed.
Click to expand it.
application/modules/Client/controllers/Shopkeeper.php
View file @
a8b38774
...
...
@@ -147,9 +147,9 @@ class ShopkeeperController extends \Our\Controller_AbstractApi {
$keyword
=
isset
(
$this
->
req
[
'data'
][
'keyword'
])
?
$this
->
req
[
'data'
][
'keyword'
]
:
''
;
$result
=
$this
->
shopkeeperService
->
getOrders
(
$this
->
memberId
,
$pageIndex
,
$pageSize
,
$orderState
,
$keyword
);
$this
->
success
(
$result
);
if
(
$result
){
$this
->
success
(
array
(),
\Our\DescribeConst
::
successMessage
,
\Our\DescribeConst
::
successMessage
);
}
//
if($result){
//
$this->success(array(),\Our\DescribeConst::successMessage,\Our\DescribeConst::successMessage);
//
}
}
/**
...
...
@@ -201,5 +201,26 @@ class ShopkeeperController extends \Our\Controller_AbstractApi {
}
public
function
receivePaymentAction
(){
$shopkeeperService
=
\Business\Store\ShopkeeperServiceModel
::
getInstance
();
$res
=
$shopkeeperService
->
confirmReceivePayment
(
$this
->
memberId
,
$this
->
req
[
'data'
][
'orderId'
]);
if
(
$res
){
$this
->
success
(
array
(),
\Our\DescribeConst
::
successMessage
);
}
else
{
ErrorModel
::
throwException
(
CodeConfigModel
::
confirmReceiveError
);
}
}
/**
* 查询配送员
*
*/
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
);
}
}
application/modules/Client/controllers/User.php
View file @
a8b38774
...
...
@@ -68,7 +68,7 @@ class UserController extends \Our\Controller_AbstractIndex {
$member
[
'store_id'
]
=
$seller
[
'storeId'
];
$member
[
'seller_id'
]
=
$seller
[
'sellerId'
];
$this
->
memberService
->
saveMember
(
$member
,
'seller'
);
$this
->
success
(
array
(
'key'
=>
$this
->
key
,
'
memberName'
=>
$member
[
'member_name'
],
'memberAvatar'
=>
$member
[
'memberAvatarUrl'
],
'memberId'
=>
(
int
)
$member
[
'member_i
d'
]));
$this
->
success
(
array
(
'key'
=>
$this
->
key
,
'
trueName'
=>
$seller
[
'trueName'
],
'memberAvatar'
=>
$member
[
'memberAvatarUrl'
],
'memberId'
=>
(
int
)
$member
[
'member_id'
],
'storeId'
=>
(
int
)
$seller
[
'storeI
d'
]));
}
else
{
ErrorModel
::
throwException
(
CodeConfigModel
::
errorUsernameOrPassword
);
}
...
...
public/client/shopkeeper/receivePayment.php
0 → 100644
View file @
a8b38774
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns=
"http://www.w3.org/1999/xhtml"
>
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
<title>
简单的html5 File测试 for pic2base64
</title>
<style>
</style>
</head>
<body>
<form
action=
"/client/shopkeeper/receivePayment"
method=
"post"
>
用户登录状态key:
<input
name=
"data[key]"
value=
"ceb72deab920ac0edb7272b2ed9dfa1e"
/><br
/>
订单id:
<input
name=
"data[orderId]"
value=
""
/><br
/>
<input
type=
"submit"
value=
"提交"
>
</form>
</body>
</html>
\ No newline at end of file
public/client/shopkeeper/searchDelivery.php
0 → 100644
View file @
a8b38774
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns=
"http://www.w3.org/1999/xhtml"
>
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
<title>
简单的html5 File测试 for pic2base64
</title>
<style>
</style>
</head>
<body>
<form
action=
"/client/shopkeeper/searchDelivery"
method=
"post"
>
用户登录状态key:
<input
name=
"data[key]"
value=
"73526b0db474f2a0e5f80c67301be73d"
/><br
/>
配送员电话:
<input
name=
"data[mobile]"
value=
"18305954587"
/><br
/>
<input
type=
"submit"
value=
"提交"
>
</form>
</body>
</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