Commit 79effe5d authored by wwccw0591's avatar wwccw0591

modifyorderAmount

parent 2dd6a3ea
...@@ -446,6 +446,8 @@ class ApiConst ...@@ -446,6 +446,8 @@ class ApiConst
const arriveTimeRadius=1800; const arriveTimeRadius=1800;
const arrBegin=0;
......
...@@ -171,5 +171,9 @@ class DescribeConst ...@@ -171,5 +171,9 @@ class DescribeConst
const anonymity = '匿名用户'; const anonymity = '匿名用户';
const imageMessage='【图片】'; const imageMessage='【图片】';
const updateSuccess='修改成功';
const updateFail='修改失败';
} }
?> ?>
\ No newline at end of file
...@@ -745,9 +745,6 @@ class OrderServiceModel extends \Business\AbstractModel ...@@ -745,9 +745,6 @@ class OrderServiceModel extends \Business\AbstractModel
echo '物流信息更新成功订单号:' . $result['orderId'] . "\r\n"; echo '物流信息更新成功订单号:' . $result['orderId'] . "\r\n";
} }
}; };
} }
/** /**
...@@ -826,6 +823,22 @@ class OrderServiceModel extends \Business\AbstractModel ...@@ -826,6 +823,22 @@ class OrderServiceModel extends \Business\AbstractModel
} }
public function updateOrderAmount($storeId,$orderId,$newOrderAmount)
{
$orderDao = \DAO\Order\OrderModel::getInstance(DbNameConst::masterDBConnectName);
$orderDetail=$orderDao->getByOrderId($orderId,$orderDao->getOrderDetailField());
$orderDetail=$orderDetail[ApiConst::arrBegin];
if($orderDetail['storeId']!=$storeId){
ErrorModel::throwException(CodeConfigModel::orderNotExist);
}
if($orderDetail['isReceivePayment'] != ApiConst::noreceivePayment){
ErrorModel::throwException(CodeConfigModel::notAllowUpdataOrderAmount);
}
$data['order_amount']=$newOrderAmount;
$res=$orderDao->updateByOrderId($data,$orderId);
return $res;
}
/** /**
* 获得配送详情 * 获得配送详情
* *
......
...@@ -307,8 +307,8 @@ class ShopkeeperServiceModel extends \Business\AbstractModel ...@@ -307,8 +307,8 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
} }
if ($this->clientType && $this->clientType == NameConst::pcClient) { if ($this->clientType && $this->clientType == NameConst::pcClient) {
$value['couponAmount'] = ($value['goodsAmount'] + $value['shippingFee']) - $value['orderAmount'];//优惠券金额 $value['couponAmount'] = ($value['goodsAmount'] + $value['shippingFee']) - $value['orderAmount'];//优惠券金额
$value['receiveAmount'] = $value['goodsAmount'] - $value['couponAmount']; $value['receiveAmount'] = $value['goodsAmount']+$value['shippingFee'] - $value['couponAmount'];
$value['orderAmount'] = $value['orderAmount'] + $value['couponAmount']; // $value['orderAmount'] = $value['orderAmount'];
$value['reciverInfo'] = unserialize($value['reciverInfo']); $value['reciverInfo'] = unserialize($value['reciverInfo']);
$value['dlyoPickupCode'] = intval(substr($value['orderSn'], ApiConst::positionPickupCodeBegin)); $value['dlyoPickupCode'] = intval(substr($value['orderSn'], ApiConst::positionPickupCodeBegin));
$value['deliveryTimeEnd'] = $value['deliveryTime'] + ApiConst::arriveTimeRadius; $value['deliveryTimeEnd'] = $value['deliveryTime'] + ApiConst::arriveTimeRadius;
......
...@@ -292,6 +292,7 @@ class CodeConfigModel ...@@ -292,6 +292,7 @@ class CodeConfigModel
const addDeliveryManError = 300124; const addDeliveryManError = 300124;
const updateOrderFail = 300120; const updateOrderFail = 300120;
const selectDeliveryFail = 300121; const selectDeliveryFail = 300121;
const notAllowUpdataOrderAmount = 300125;
const noEnoughStorageForBundlingGoods = 30118; const noEnoughStorageForBundlingGoods = 30118;
const noOrderWaitToPay = 30119; const noOrderWaitToPay = 30119;
const wrongEvaluation = 30120; const wrongEvaluation = 30120;
...@@ -778,6 +779,7 @@ class CodeConfigModel ...@@ -778,6 +779,7 @@ class CodeConfigModel
self::selectDeliveryFail=>'配送员选择失败', self::selectDeliveryFail=>'配送员选择失败',
self::noEnoughStorageForBundlingGoods => '组合销售库存紧张,您购买的数量太多啦', self::noEnoughStorageForBundlingGoods => '组合销售库存紧张,您购买的数量太多啦',
self::noOrderWaitToPay => '您的订单已支付,请勿重复支付', self::noOrderWaitToPay => '您的订单已支付,请勿重复支付',
self::notAllowUpdataOrderAmount=>'当前状态不允许修改订单金额',
self::wrongEvaluation => '商品评论应在6-500字之间', self::wrongEvaluation => '商品评论应在6-500字之间',
self::selfGoodsForStoreOrder => '店主不能购买自己的商品', self::selfGoodsForStoreOrder => '店主不能购买自己的商品',
//销售员 //销售员
......
...@@ -278,9 +278,9 @@ class ShopkeeperController extends \Our\Controller_AbstractClient { ...@@ -278,9 +278,9 @@ class ShopkeeperController extends \Our\Controller_AbstractClient {
} }
/** /**
* 确认收货 * 确认收货
* @throws Exception * @throws Exception
*/ */
public function confirmReceiveAction(){ public function confirmReceiveAction(){
$refundId= intval($this->req['data']['refundId']); $refundId= intval($this->req['data']['refundId']);
if(!$refundId) { if(!$refundId) {
...@@ -293,6 +293,8 @@ class ShopkeeperController extends \Our\Controller_AbstractClient { ...@@ -293,6 +293,8 @@ class ShopkeeperController extends \Our\Controller_AbstractClient {
} }
/** /**
* 获取应用版本 * 获取应用版本
*/ */
...@@ -328,6 +330,27 @@ class ShopkeeperController extends \Our\Controller_AbstractClient { ...@@ -328,6 +330,27 @@ class ShopkeeperController extends \Our\Controller_AbstractClient {
$this->success($res); $this->success($res);
} }
/**
* 修改订单金额
* @throws Exception
*/
public function modifyOrderAmountAction(){
$orderId= intval($this->req['data']['orderId']);
$orderAmount= intval($this->req['data']['orderAmount']);
if(empty($orderId) && empty($orderAmount)) {
ErrorModel::throwException(CodeConfigModel::paramsError);
}
$orderService=\Business\Order\OrderServiceModel::getInstance();
$res = $orderService->updateOrderAmount($this->storeId, $orderId,$orderAmount);
if($res !==false){
$this->success($res,\Our\DescribeConst::updateSuccess);
}
ErrorModel::throwException(CodeConfigModel::commonError);
}
} }
<!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/modifyOrderAmount" method="post">
用户登录状态key:<input name="data[key]" value="bd9b675342850f741b1818aa74aa63a8"/><br />
订单id:<input name="data[orderId]" value="403"/><br />
订单价格:<input name="data[orderAmount]" value="10"/><br />
<p id="img_area"></p>
<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