shish vor 5 Jahren
Ursprung
Commit
40242be519
1 geänderte Dateien mit 119 neuen und 116 gelöschten Zeilen
  1. 119 116
      app/ghs/controllers/MainController.php

+ 119 - 116
app/ghs/controllers/MainController.php

@@ -2,126 +2,129 @@
 
 namespace ghs\controllers;
 
+use common\components\imgUtil;
 use common\components\util;
 use Yii;
 use GatewayClient\Gateway;
 
 class MainController extends BaseController
 {
-	
-	public function actionDemo()
-	{
-		return $this->renderPartial('demo');
-	}
-	
-	public function actionIndex()
-	{
-		return $this->renderPartial('index');
-	}
-	
-	//新客户 shish 2019.12.29
-	public function actionVisit()
-	{
-		$data = json_encode(array(
-			'type' => 'msg',
-			'msg' => 'aaaa',
-		));
-		
-		$id = 'merchantConsole_' . $this->sjId;
-		$online = Gateway::getClientIdByUid($id);
-		if ($online) {
-			//直接发送
-			Gateway::sendToUid($id, json_encode($data));
-		} else {
-			//保存
-		}
-	}
-	
-	//新订单 shish 2019.12.29
-	public function actionOrder()
-	{
-		$data = json_encode(array(
-			'type' => 'msg',
-			'msg' => 'aaaa',
-		));
-		
-		$id = 'merchantConsole_' . $this->sjId;
-		$online = Gateway::getClientIdByUid($id);
-		if ($online) {
-			//直接发送
-			Gateway::sendToUid($id, json_encode($data));
-		} else {
-			//保存
-		}
-	}
-	
-	//经营概况 shish 2021.1.27
-	public function actionProfile()
-	{
-		$base = [
-			'balance' => 5020.00,
-			'mayGathering' => 10,
-			'mayPay' => 20,
-			'stockCost' => 2000,
-			'stockNum' => 100,
-			'stockWarning' => 5,
-			'today' => 90,
-			'todayCompareYesterday' => -5,
-			'latestSeven' => 9000,
-			'latestSevenSameTerm' => 10,
-			'latestThirty' => 8000,
-			'latestThirtySameTerm' => -9,
-		];
-		$more = [
-			'today' => [
-				'income' => 10,
-				'expend' => 2,
-				'saleNum' => 1,
-				'saleAmount' => 100,
-				'purchaseNum' => 2,
-				'purchaseAmount' => 3,
-			],
-			'yesterday' => [
-				'income' => 10,
-				'expend' => 2,
-				'saleNum' => 1,
-				'saleAmount' => 100,
-				'purchaseNum' => 2,
-				'purchaseAmount' => 3,
-			],
-			'latestSeven' => [
-				'income' => 10,
-				'expend' => 2,
-				'saleNum' => 1,
-				'saleAmount' => 100,
-				'purchaseNum' => 2,
-				'purchaseAmount' => 3,
-			],
-			'latestThirty' => [
-				'income' => 10,
-				'expend' => 2,
-				'saleNum' => 1,
-				'saleAmount' => 100,
-				'purchaseNum' => 2,
-				'purchaseAmount' => 3,
-			],
-		];
-		util::success(['base' => $base, 'more' => $more]);
-	}
-	
-	//我的 shish 2021.1.30
-	public function actionMy()
-	{
-		$data = [
-			'balance' => 20,
-			'totalIncome' => 100,
-			'deadline' => '2021-12-01',
-			'adminName' => '石少华',
-			'adminMobile' => 15280215347,
-			'sjName' => '纯彩花艺',
-			'shopName' => '集美店',
-		];
-		util::success($data);
-	}
-	
+
+    public function actionDemo()
+    {
+        return $this->renderPartial('demo');
+    }
+
+    public function actionIndex()
+    {
+        return $this->renderPartial('index');
+    }
+
+    //新客户 shish 2019.12.29
+    public function actionVisit()
+    {
+        $data = json_encode(array(
+            'type' => 'msg',
+            'msg' => 'aaaa',
+        ));
+
+        $id = 'merchantConsole_' . $this->sjId;
+        $online = Gateway::getClientIdByUid($id);
+        if ($online) {
+            //直接发送
+            Gateway::sendToUid($id, json_encode($data));
+        } else {
+            //保存
+        }
+    }
+
+    //新订单 shish 2019.12.29
+    public function actionOrder()
+    {
+        $data = json_encode(array(
+            'type' => 'msg',
+            'msg' => 'aaaa',
+        ));
+
+        $id = 'merchantConsole_' . $this->sjId;
+        $online = Gateway::getClientIdByUid($id);
+        if ($online) {
+            //直接发送
+            Gateway::sendToUid($id, json_encode($data));
+        } else {
+            //保存
+        }
+    }
+
+    //经营概况 shish 2021.1.27
+    public function actionProfile()
+    {
+        $base = [
+            'balance' => 5020.00,
+            'mayGathering' => 10,
+            'mayPay' => 20,
+            'stockCost' => 2000,
+            'stockNum' => 100,
+            'stockWarning' => 5,
+            'today' => 90,
+            'todayCompareYesterday' => -5,
+            'latestSeven' => 9000,
+            'latestSevenSameTerm' => 10,
+            'latestThirty' => 8000,
+            'latestThirtySameTerm' => -9,
+        ];
+        $more = [
+            'today' => [
+                'income' => 10,
+                'expend' => 2,
+                'saleNum' => 1,
+                'saleAmount' => 100,
+                'purchaseNum' => 2,
+                'purchaseAmount' => 3,
+            ],
+            'yesterday' => [
+                'income' => 10,
+                'expend' => 2,
+                'saleNum' => 1,
+                'saleAmount' => 100,
+                'purchaseNum' => 2,
+                'purchaseAmount' => 3,
+            ],
+            'latestSeven' => [
+                'income' => 10,
+                'expend' => 2,
+                'saleNum' => 1,
+                'saleAmount' => 100,
+                'purchaseNum' => 2,
+                'purchaseAmount' => 3,
+            ],
+            'latestThirty' => [
+                'income' => 10,
+                'expend' => 2,
+                'saleNum' => 1,
+                'saleAmount' => 100,
+                'purchaseNum' => 2,
+                'purchaseAmount' => 3,
+            ],
+        ];
+        util::success(['base' => $base, 'more' => $more]);
+    }
+
+    //我的 shish 2021.1.30
+    public function actionMy()
+    {
+        $shopImg = imgUtil::getPrefix() . '/hhb_small.png';
+        $data = [
+            'balance' => 20,
+            'totalIncome' => 100,
+            'deadline' => '2021-12-01',
+            'adminName' => '石少华',
+            'adminMobile' => 15280215347,
+            'sjName' => '纯彩花艺',
+            'shopName' => '集美店',
+            'shopImg' => $shopImg,
+        ];
+        util::success($data);
+    }
+
 }