shish 5 anni fa
parent
commit
5d10abdc68

+ 15 - 15
app-ghs/controllers/UploadController.php

@@ -73,24 +73,24 @@ class UploadController extends BaseController
 
             oss::uploadImage($img,$fullPathFile);
 			//生成小图 200px
-			$smallWidth = 200;
-			$smallHeight = ceil((200 * $height) / $width);
-			$smallFullPathFile = $path . $preFileName . '_small.' . $type;
-			Image::thumbnail($fullPathFile, $smallWidth, $smallHeight)->save($smallFullPathFile, ['quality' => 100]);
+			//$smallWidth = 200;
+			//$smallHeight = ceil((200 * $height) / $width);
+			//$smallFullPathFile = $path . $preFileName . '_small.' . $type;
+			//Image::thumbnail($fullPathFile, $smallWidth, $smallHeight)->save($smallFullPathFile, ['quality' => 100]);
 
 			$data = business::formatUploadImg($img);
 
-			if (!empty($categoryIds)) {
-				$time = time();
-				$data = ['img' => $img, 'sjId' => $sjId, 'name' => '未命名', 'addTime' => $time];
-				$pic = PicService::add($data);
-				$currentId = $pic['id'];
-				$add = [];
-				foreach ($categoryIds as $cat) {
-					$add[] = ['categoryId' => $cat, 'picId' => $currentId, 'sjId' => $this->sjId];
-				}
-				PicCategoryService::batchAdd($add);
-			}
+//			if (!empty($categoryIds)) {
+//				$time = time();
+//				$data = ['img' => $img, 'sjId' => $sjId, 'name' => '未命名', 'addTime' => $time];
+//				$pic = PicService::add($data);
+//				$currentId = $pic['id'];
+//				$add = [];
+//				foreach ($categoryIds as $cat) {
+//					$add[] = ['categoryId' => $cat, 'picId' => $currentId, 'sjId' => $this->sjId];
+//				}
+//				PicCategoryService::batchAdd($add);
+//			}
 
 			$data['shortUrl'] = $img;
 			util::success($data);

+ 15 - 15
app-hd/controllers/UploadController.php

@@ -76,24 +76,24 @@ class UploadController extends BaseController
 			oss::uploadImage($img,$fullPathFile);
 
 			//生成小图 200px
-			$smallWidth = 200;
-			$smallHeight = ceil((200 * $height) / $width);
-			$smallFullPathFile = $path . $preFileName . '_small.' . $type;
-			Image::thumbnail($fullPathFile, $smallWidth, $smallHeight)->save($smallFullPathFile, ['quality' => 100]);
+			//$smallWidth = 200;
+			//$smallHeight = ceil((200 * $height) / $width);
+			//$smallFullPathFile = $path . $preFileName . '_small.' . $type;
+			//Image::thumbnail($fullPathFile, $smallWidth, $smallHeight)->save($smallFullPathFile, ['quality' => 100]);
 
 			$data = business::formatUploadImg($img);
 
-			if (!empty($categoryIds)) {
-				$time = time();
-				$data = ['img' => $img, 'sjId' => $sjId, 'name' => '未命名', 'addTime' => $time];
-				$pic = PicService::add($data);
-				$currentId = $pic['id'];
-				$add = [];
-				foreach ($categoryIds as $cat) {
-					$add[] = ['categoryId' => $cat, 'picId' => $currentId, 'sjId' => $this->sjId];
-				}
-				PicCategoryService::batchAdd($add);
-			}
+//			if (!empty($categoryIds)) {
+//				$time = time();
+//				$data = ['img' => $img, 'sjId' => $sjId, 'name' => '未命名', 'addTime' => $time];
+//				$pic = PicService::add($data);
+//				$currentId = $pic['id'];
+//				$add = [];
+//				foreach ($categoryIds as $cat) {
+//					$add[] = ['categoryId' => $cat, 'picId' => $currentId, 'sjId' => $this->sjId];
+//				}
+//				PicCategoryService::batchAdd($add);
+//			}
 
 			$data['shortUrl'] = $img;
 			util::success($data);

+ 4 - 4
app-pt/controllers/UploadController.php

@@ -62,10 +62,10 @@ class UploadController extends BaseController
 			oss::uploadImage($img,$fullPathFile);
 
 			//生成小图 200px
-			$smallWidth = 200;
-			$smallHeight = ceil((200 * $height) / $width);
-			$smallFullPathFile = $path . $preFileName . '_small.' . $type;
-			Image::thumbnail($fullPathFile, $smallWidth, $smallHeight)->save($smallFullPathFile, ['quality' => 100]);
+			//$smallWidth = 200;
+			//$smallHeight = ceil((200 * $height) / $width);
+			//$smallFullPathFile = $path . $preFileName . '_small.' . $type;
+			//Image::thumbnail($fullPathFile, $smallWidth, $smallHeight)->save($smallFullPathFile, ['quality' => 100]);
 
 			$data = business::formatUploadImg($img);
 

+ 6 - 6
biz-hd/order/classes/OrderClass.php

@@ -158,8 +158,8 @@ class OrderClass extends BaseClass
             Yii::info($msg);
             util::fail($msg);
         }
-        if ($order->actPrice != $totalFee) {
-            $msg = "零售订单金额与回调通知金额不一致 orderSn:{$orderSn} {$order->actPrice} {$totalFee}";
+        if ($order->realPrice != $totalFee) {
+            $msg = "零售订单金额与回调通知金额不一致 orderSn:{$orderSn} {$order->realPrice} {$totalFee}";
             Yii::info($msg);
             util::fail($msg);
         }
@@ -212,7 +212,7 @@ class OrderClass extends BaseClass
         $orderSn = $order->orderSn;
         OrderSendClass::placeOrder(['orderId' => $orderId, 'payTime' => $current, 'orderSn' => $orderSn]);
 
-        $actPrice = $order->actPrice ?? 0;
+        $realPrice = $order->realPrice ?? 0;
         $shopId = $order->shopId;
         $shop = ShopClass::getLockById($shopId);
         if (empty($shop)) {
@@ -221,7 +221,7 @@ class OrderClass extends BaseClass
         }
         $shop->unSendOrder += 1;
         $shop->unPayOrder -= 1;
-        $currentTotalIncome = bcadd($shop->totalIncome, $actPrice, 2);
+        $currentTotalIncome = bcadd($shop->totalIncome, $realPrice, 2);
         $shop->totalIncome = $currentTotalIncome;
         $shop->save();
 
@@ -245,12 +245,12 @@ class OrderClass extends BaseClass
             'shopId' => $shopId,
             'shopAdminId' => $shopAdminId,
             'shopAdminName' => $shopAdminName,
-            'amount' => $actPrice,
+            'amount' => $realPrice,
         ];
         ShopCapitalClass::addCapital($capital);
 
         //每天和每月收入增加
-        StatIncomeClass::updateOrInsert($shop, $actPrice);
+        StatIncomeClass::updateOrInsert($shop, $realPrice);
         //今日订单+1
         StatOrderClass::updateOrInsert($shop);
 

+ 7 - 6
biz-hd/purchase/services/PurchaseService.php

@@ -244,17 +244,18 @@ class PurchaseService extends BaseService
             util::fail('没有找到门店');
         }
         $realPrice = $info->realPrice;
+        $actPrice = $info->actPrice;
         /**余额支付引起余额减少**/
         if ($payWay == dict::getDict('payWay', 'balancePay')) {
             ShopClass::purchaseReduceBalance($shop, $realPrice, $info);
         }
-        $shop->totalPurchase = bcadd($shop->totalPurchase, $realPrice, 2);
-        $currentExpend = bcadd($shop->totalExpend, $realPrice, 2);
+        $shop->totalPurchase = bcadd($shop->totalPurchase, $actPrice, 2);
+        $currentExpend = bcadd($shop->totalExpend, $actPrice, 2);
         $shop->totalExpend = $currentExpend;
         $shop->cgUnPay -= 1;
         $shop->cgUnSend += 1;
         if ($payWay == dict::getDict('payWay', 'debtPay')) {
-            //欠款支付会增加【应付供应商款】
+            //应付供应商款增加
             $currentMayPay = bcadd($shop->mayPay, $realPrice, 2);
             $shop->mayPay = $currentMayPay;
         }
@@ -270,7 +271,7 @@ class PurchaseService extends BaseService
             'io' => 0,
             'totalExpend' => $currentExpend,
             'payWay' => $payWay,
-            'amount' => $realPrice,
+            'amount' => $actPrice,
             'sjId' => $sjId,
             'shopId' => $shopId,
             'event' => $event,
@@ -297,7 +298,7 @@ class PurchaseService extends BaseService
             util::fail('没有找到供应商');
         }
         if ($payWay == dict::getDict('payWay', 'debtPay')) {
-            if($ghs->debtNum == 0){
+            if ($ghs->debtNum == 0) {
                 $shop->mayPayNum += 1;
                 $shop->save();
             }
@@ -306,7 +307,7 @@ class PurchaseService extends BaseService
             $ghs->debtAmount = bcadd($ghs->debtAmount, $realPrice, 2);
             $ghs->debtNum += 1;
         }
-        $ghs->expendAmount = bcadd($ghs->expendAmount, $realPrice, 2);
+        $ghs->expendAmount = bcadd($ghs->expendAmount, $actPrice, 2);
         $ghs->expendNum += 1;
         $ghs->save();