| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- <?php
- namespace hd\controllers;
- use GatewayClient\Gateway;
- use bizHd\ad\services\AdService;
- use bizHd\goods\services\CategoryService;
- use bizHd\goods\services\GoodsCategoryService;
- use common\components\util;
- class MainController extends BaseController
- {
- public $guestAccess = ['index'];
-
- public function actionDemo()
- {
- return $this->renderPartial('demo');
- }
- //首页 ssh 2019.12.2
- public function actionIndex()
- {
- $where = ['merchantId' => $this->sjId, 'type' => 0, 'status' => 1, 'delStatus' => 0];
- $adRespond = AdService::getAdList($where);
- $ad = [];
- if (isset($adRespond['list']) && !empty($adRespond['list'])) {
- foreach ($adRespond['list'] as $single) {
- $ad[] = ['adImg' => $single['adImgUrl'], 'url' => ''];
- }
- }
- $category = CategoryService::getTopThreeCategory($this->sjId);
- $categoryList = !empty($category) ? GoodsCategoryService::getAppointCategoryList($category) : [];
- $data = ['ad' => $ad, 'category' => $categoryList, 'columnStyle' => rand(1, 2)];
- util::success($data);
- }
- //新客户 ssh 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 {
- //保存
- }
- }
- //新订单 ssh 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 {
- //保存
- }
- }
- //我的 ssh 2021.4.8
- 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['name'] ?? '';
- $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);
- }
- }
|