request->post(); $main = $this->main; $baseFee = $post['baseFee'] ?? 5.5; $shortDistanceFee = $post['shortDistanceFee'] ?? 2; $longDistanceFee = $post['longDistanceFee'] ?? 2; $smallWeightFee = $post['smallWeightFee'] ?? 6; $bigWeightFee = $post['bigWeightFee'] ?? 10; $onePeriodFee = $post['onePeriodFee'] ?? 4; $twoPeriodFee = $post['twoPeriodFee'] ?? 1; $threePeriodFee = $post['threePeriodFee'] ?? 2; $lsFee = $post['lsFee'] ?? 0; $main->baseFee = $baseFee; $main->shortDistanceFee = $shortDistanceFee; $main->longDistanceFee = $longDistanceFee; $main->smallWeightFee = $smallWeightFee; $main->bigWeightFee = $bigWeightFee; $main->onePeriodFee = $onePeriodFee; $main->twoPeriodFee = $twoPeriodFee; $main->threePeriodFee = $threePeriodFee; $main->lsFee = $lsFee; $main->save(); util::complete(); } //main信息 ssh 20230406 public function actionInfo() { $main = $this->main; util::success(['info' => $main]); } //采购商城海报 ssh 20230217 public function actionGetMallPoster() { $merchant = WxOpenClass::getWxInfo(); $page = 'pagesPurchase/ghsProduct'; $ptStyle = dict::getDict('ptStyle', 'hd'); //scene不能超过32个字条,这些进行缩写:sId = shopId gId = ghsShopAdminId $scene = "sId={$this->shopId}&id=0&gId=" . $this->shopAdminId; $imgUrl = miniUtil::generateUnlimitedMiniCode($merchant, $page, $scene, $ptStyle); $titleBase64 = stringUtil::ossBase64('扫码买花'); $prefix = imgUtil::getPrefix(); $url = $prefix . 'shop/miniCodeBg.jpg?x-oss-process=image'; $goodsMiniCodeBase64 = stringUtil::ossBase64($imgUrl); $url .= '/watermark,image_' . $goodsMiniCodeBase64 . ',g_north,x_0,y_40'; $url .= '/watermark,text_' . $titleBase64 . ',g_north,x_0,y_530,size_50'; $respond = ['imgUrl' => $url]; util::success($respond); } public function actionDemo() { return $this->renderPartial('demo'); } public function actionIndex() { return $this->renderPartial('index'); } //新客户 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.1.27 public function actionProfile() { //余额 $shopInfo = ShopClass::getById($this->shopId); //库存情况 $stockInfo = ProductClass::getProductStockByShopId($this->sjId, $this->shopId); //今日销售金额 $today = StatIncomeClass::getAmountToday($this->shopId); //近七天销售金额 $latestSeven = StatIncomeClass::getAmountWeek($this->shopId); //30天销售金额 $latestThirty = StatIncomeClass::getAmountThirty($this->shopId); $base = [ 'balance' => $shopInfo['balance'], 'mayGathering' => $shopInfo['mayGathering'] ?? 0.00, 'mayPay' => $shopInfo['mayPay'] ?? 0.00, 'stockCost' => $stockInfo['stockCost'], 'stockNum' => 0, 'stockBigNum' => $stockInfo['stockBigNum'], 'stockSmallNum' => $stockInfo['stockSmallNum'], 'stockWarning' => $stockInfo['stockWarning'], 'today' => $today, 'todayCompareYesterday' => 0, 'latestSeven' => $latestSeven, 'latestSevenSameTerm' => 0, 'latestThirty' => $latestThirty, 'latestThirtySameTerm' => 0, ]; //今日订单数 $saleNum = StatOrderClass::getRiseNumToday($this->shopId); //今日销售金额 $saleAmount = $today; //昨日订单数 $ySaleNum = StatOrderClass::getRiseNumYesterday($this->shopId); //昨日销售金额 $ySaleAmount = StatIncomeClass::getAmountYesterday($this->shopId); //7天订单数 $sevenSaleNum = StatOrderClass::getRiseNumWeek($this->shopId); //7天销售金额 $sevenSaleAmount = $latestSeven; //30天订单数 $thirtySaleNum = StatOrderClass::getRiseNumThirty($this->shopId); //30天销售金额 $thirtySaleAmount = $latestThirty; //今日采购 $todayCg = StatCgClass::getTodayCg($this->shop); //昨日采购 $yesCg = StatCgClass::getYesterdayCg($this->shop); //7日采购 $sevenCg = StatCgClass::getSevenCg($this->shop); //30日采购 $thirtyCg = StatCgClass::getThirtyCg($this->shop); $more = [ 'today' => [ 'income' => 0, 'expend' => 0, 'saleNum' => $saleNum, 'saleAmount' => $saleAmount, 'purchaseNum' => $todayCg['num'] ?? 0, 'purchaseAmount' => $todayCg['amount'] ?? 0.00, ], 'yesterday' => [ 'income' => 0, 'expend' => 0, 'saleNum' => $ySaleNum, 'saleAmount' => $ySaleAmount, 'purchaseNum' => $yesCg['num'] ?? 0, 'purchaseAmount' => $yesCg['amount'] ?? 0.00, ], 'latestSeven' => [ 'income' => 0, 'expend' => 0, 'saleNum' => $sevenSaleNum, 'saleAmount' => $sevenSaleAmount, 'purchaseNum' => $sevenCg['num'] ?? 0, 'purchaseAmount' => $sevenCg['amount'] ?? 0.00, ], 'latestThirty' => [ 'income' => 0, 'expend' => 0, 'saleNum' => $thirtySaleNum, 'saleAmount' => $thirtySaleAmount, 'purchaseNum' => $thirtyCg['num'] ?? 0, 'purchaseAmount' => $thirtyCg['amount'] ?? 0.00, ], ]; util::success(['base' => $base, 'more' => $more]); } //我的 ssh 2021.1.30 public function actionMy() { $lookMoney = ShopAdminClass::lookMoneyPower($this->shopAdmin, $this->shop); $shop = $this->shop ?? null; $main = $this->main ?? null; $balance = $main->balance ?? 0.00; $txBalance = $main->txBalance ?? 0.00; $money = $main->money ?? 0; $cashAccount = $main->cashAccount ?? ''; $sj = isset($this->sj) && !empty($this->sj) ? $this->sj->attributes : []; $shopImg = imgUtil::groupImg($shop->avatar); $smallShopImg = imgUtil::groupImg($shop->avatar) . "?x-oss-process=image/resize,m_fill,h_80,w_80"; $deadline = $sj['deadline'] ?? ''; $relation = isset($this->shopAdmin) && !empty($this->shopAdmin) ? $this->shopAdmin->attributes : []; $adminName = $relation['name'] ?? ''; $shopAdminId = $relation['id'] ?? 0; $mobile = $relation['mobile'] ?? ''; $sjName = $sj['name'] ?? ''; $shopName = $shop->shopName ?? ''; $data = [ 'balance' => $balance, 'txBalance' => $txBalance, 'deadline' => $deadline, 'adminName' => $adminName, 'adminMobile' => $mobile, 'sjName' => $sjName, 'shopName' => $shopName, 'shopImg' => $shopImg, 'smallShopImg' => $smallShopImg, 'cashAccount' => $cashAccount, 'shopAdminId' => $shopAdminId, 'shopId' => $this->shopId, 'sjId' => $this->sjId, 'adminId' => $this->adminId, 'money' => $money, 'shopInfo' => $shop, 'lookMoney' => $lookMoney, 'fast1' => '17189513228', 'fast2' => '15280215347', ]; util::success($data); } }