Commit a8b38774 authored by wwccw0591's avatar wwccw0591

pc

parent e4f99a5d
......@@ -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);
......
......@@ -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;
}
/**
* 登录业务
*
......
This diff is collapsed.
......@@ -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(
......
......@@ -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);
......
This diff is collapsed.
......@@ -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);
}
}
......@@ -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_id']));
$this->success(array('key'=>$this->key,'trueName'=>$seller['trueName'],'memberAvatar'=>$member['memberAvatarUrl'],'memberId'=>(int)$member['member_id'],'storeId'=>(int)$seller['storeId']));
}else{
ErrorModel::throwException(CodeConfigModel::errorUsernameOrPassword);
}
......
<!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
<!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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment