订单改价没有更新订单号问题

This commit is contained in:
liaofei 2019-12-16 11:00:29 +08:00
parent bbac300a43
commit 43f4b2928e
2 changed files with 117 additions and 114 deletions

View File

@ -1,4 +1,5 @@
<?php <?php
namespace app\api\controller\admin; namespace app\api\controller\admin;
use app\models\store\StoreOrder; use app\models\store\StoreOrder;
@ -203,7 +204,8 @@ class StoreOrderController
if ($price === '') return app('json')->fail('请填写实际支付金额'); if ($price === '') return app('json')->fail('请填写实际支付金额');
if ($price < 0) return app('json')->fail('实际支付金额不能小于0元'); if ($price < 0) return app('json')->fail('实际支付金额不能小于0元');
if ($order['pay_price'] == $price) return app('json')->successful('修改成功'); if ($order['pay_price'] == $price) return app('json')->successful('修改成功');
if(!StoreOrder::edit(['pay_price'=>$price], $order['id'], 'id')) $order['order_id'] = StoreOrder::changeOrderId($order['order_id']);
if (!StoreOrder::edit(['pay_price' => $price, 'order_id' => $order['order_id']], $order['id'], 'id'))
return app('json')->fail('状态错误'); return app('json')->fail('状态错误');
$order['pay_price'] = $price; $order['pay_price'] = $price;
event('StoreProductOrderEditAfter', [$order, $order['id']]); event('StoreProductOrderEditAfter', [$order, $order['id']]);
@ -300,7 +302,8 @@ class StoreOrderController
* @throws \think\db\exception\ModelNotFoundException * @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException * @throws \think\exception\DbException
*/ */
public function offline(Request $request){ public function offline(Request $request)
{
list($orderId) = UtilService::postMore([['order_id', '']], $request, true); list($orderId) = UtilService::postMore([['order_id', '']], $request, true);
$orderInfo = StoreOrder::getAdminOrderDetail($orderId, 'id'); $orderInfo = StoreOrder::getAdminOrderDetail($orderId, 'id');
if (!$orderInfo) return app('json')->fail('参数错误'); if (!$orderInfo) return app('json')->fail('参数错误');

View File

@ -50,7 +50,7 @@ class SystemStore extends BaseModel
if($storeInfo) { if($storeInfo) {
$storeInfo['latlng'] = self::getLatlngAttr(null, $storeInfo); $storeInfo['latlng'] = self::getLatlngAttr(null, $storeInfo);
$storeInfo['valid_time'] = $storeInfo['valid_time'] ? explode(' - ', $storeInfo['valid_time']) : []; $storeInfo['valid_time'] = $storeInfo['valid_time'] ? explode(' - ', $storeInfo['valid_time']) : [];
$storeInfo['_valid_time'] = str_replace('-','/',$storeInfo['valid_time'][0].' ~ '.$storeInfo['valid_time'][1]); $storeInfo['_valid_time'] = str_replace('-','/',($storeInfo['valid_time'][0] ?? '').' ~ '.($storeInfo['valid_time'][1]) ?? '');
$storeInfo['day_time'] = $storeInfo['day_time'] ? str_replace(' - ',' ~ ',$storeInfo['day_time']) : []; $storeInfo['day_time'] = $storeInfo['day_time'] ? str_replace(' - ',' ~ ',$storeInfo['day_time']) : [];
$storeInfo['_detailed_address'] = $storeInfo['address'].' '.$storeInfo['detailed_address']; $storeInfo['_detailed_address'] = $storeInfo['address'].' '.$storeInfo['detailed_address'];
$storeInfo['address'] = $storeInfo['address'] ? explode(',', $storeInfo['address']) : []; $storeInfo['address'] = $storeInfo['address'] ? explode(',', $storeInfo['address']) : [];