| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- <?php
- 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()
- {
- $shop = $this->shop;
- $balance = $shop['balance'] ?? 0.00;
- $txBalance = $shop['txBalance'] ?? 0.00;
- $sj = $this->sj;
- $shopImg = $shop['avatar'] ?? '';
- $deadline = $sj['deadline'] ?? '';
- $relation = $this->shopAdmin;
- $adminName = $relation['adminName'];
- $shopAdminId = $relation['id'];
- $mobile = $relation['mobile'] ?? '';
- $sjName = $sj['merchantName'] ?? '';
- $shopName = $shop['shopName'] ?? '';
- $cashAccount = $shop['cashAccount'] ?? '';
- $data = [
- 'balance' => $balance,
- 'txBalance' => $txBalance,
- 'deadline' => $deadline,
- 'adminName' => $adminName,
- 'adminMobile' => $mobile,
- 'sjName' => $sjName,
- 'shopName' => $shopName,
- 'shopImg' => $shopImg,
- 'cashAccount' => $cashAccount,
- 'shopAdminId' => $shopAdminId,
- 'shopId' => $this->shopId,
- ];
- util::success($data);
- }
- }
|