| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694 |
- <?php
- namespace hd\controllers;
- use bizHd\admin\services\AdminService;
- use bizHd\custom\classes\CustomClass;
- use bizHd\custom\classes\HdClass;
- use bizHd\custom\services\CustomService;
- use biz\sj\services\MerchantAssetService;
- use biz\sj\services\MerchantRemarkService;
- use bizHd\member\classes\MemberWealClass;
- use bizHd\order\classes\OrderClass;
- use bizHd\stat\classes\StatVisitClass;
- use bizHd\user\services\UserAssetService;
- use bizHd\user\services\UserGrowthService;
- use bizHd\user\services\UserService;
- use bizHd\user\services\UserUpgradeService;
- use common\components\wxUtil;
- use common\services\xhMerchantExtendService;
- use common\services\xhRechargeService;
- use common\services\xhTMessageService;
- use Yii;
- use common\components\stringUtil;
- use common\components\util;
- use biz\sj\services\MerchantExtendService;
- use bizHd\message\services\SmsService;
- use bizHd\user\classes\UserClass;
- use yii\helpers\Json;
- use Overtrue\ChineseCalendar\Calendar;
- class CustomController extends BaseController
- {
- public $guestAccess = ['list'];
- //修改生日 ssh 20250814
- public function actionModifyBirthday()
- {
- date_default_timezone_set('PRC');
- $get = Yii::$app->request->get();
- $customId = $get['customId'];
- $custom = CustomClass::getById($customId, true);
- if (empty($custom)) {
- util::fail('没有找到客户');
- }
- $shopId = $this->shopId;
- if ($custom->shopId != $shopId) {
- util::fail('不是你的客户');
- }
- $lunar = $get['lunar'] ?? 0;
- $birthdayMonth = $get['birthdayMonth'] ?? 1;
- if ($birthdayMonth > 12 || $birthdayMonth < 1) {
- util::fail('月份必须1到12月');
- }
- $birthdayDate = $get['birthdayDate'] ?? 1;
- if ($birthdayDate > 31 || $birthdayDate < 1) {
- util::fail('日期必须1到31号');
- }
- $userId = $custom->userId;
- $user = UserClass::getById($userId, true);
- if (empty($user)) {
- util::fail('客户信息缺失');
- }
- if ($lunar == 1 && $custom->birthdayDate == 31) {
- util::fail('农历没有31号');
- }
- $calendar = new Calendar();
- if ($lunar == 1) {
- try {
- $result = $calendar->lunar(date("Y"), $birthdayMonth, $birthdayDate);
- } catch (\InvalidArgumentException $e) {
- $msg = $e->getMessage();
- util::fail($msg);
- }
- $month = $result['gregorian_month'] ?? 1;
- $date = $result['gregorian_day'] ?? 1;
- $birthday = date("Y") . '-' . $month . '-' . $date;
- } else {
- $birthday = date("Y") . '-' . $birthdayMonth . '-' . $birthdayDate;
- }
- $birthdayTime = strtotime($birthday);
- if ($user->birthdaySet == 0) {
- //用户自己没有设置过生日,直接改
- $custom->lunar = $lunar;
- $custom->birthdayDate = $birthdayDate;
- $custom->birthdayMonth = $birthdayMonth;
- $custom->birthday = $birthday;
- $custom->birthdayTime = $birthdayTime;
- $custom->save();
- $user->lunar = $lunar;
- $user->birthdayDate = $birthdayDate;
- $user->birthdayMonth = $birthdayMonth;
- $user->birthday = $birthday;
- $user->birthdayTime = $birthdayTime;
- $user->save();
- } else {
- //用户设置过,按用户设置的生日来走
- $lunar = $user->lunar;
- $birthdayDate = $user->birthdayDate;
- $birthdayMonth = $user->birthdayMonth;
- $birthday = $user->birthday;
- $birthdayTime = $user->birthdayTime;
- $custom->lunar = $lunar;
- $custom->birthdayDate = $birthdayDate;
- $custom->birthdayMonth = $birthdayMonth;
- $custom->birthday = $birthday;
- $custom->birthdayTime = $birthdayTime;
- $custom->save();
- }
- util::complete('修改成功');
- }
- public function actionChangeLevel()
- {
- $get = Yii::$app->request->get();
- $customId = $get['customId'];
- $level = $get['level'] ?? 0;
- if ($level < 0) {
- util::fail('等级选择错误');
- }
- $custom = CustomClass::getById($customId, true);
- if (empty($custom)) {
- util::fail('没有找到客户');
- }
- $shopId = $this->shopId;
- if ($custom->shopId != $shopId) {
- util::fail('不是你的客户');
- }
- $hdId = $custom->hdId;
- $hd = HdClass::getById($hdId, true);
- if (empty($hd)) {
- util::fail('客户信息缺失,编号3445');
- }
- $staff = $this->shopAdmin;
- $staffId = $staff->id;
- $staffName = $staff->name;
- $params = [
- 'style' => 1,//手动修改
- 'staffId' => $staffId,
- 'staffName' => $staffName,
- ];
- $shop = $this->shop;
- $connection = Yii::$app->db;
- $transaction = $connection->beginTransaction();
- try {
- $beforeLevel = $custom->member ?? 0;
- CustomClass::levelChange($beforeLevel, $level, $shop, $custom, $hd, $params);
- $transaction->commit();
- util::complete('修改成功');
- } catch (\Exception $exception) {
- $transaction->rollBack();
- Yii::info("修改失败:" . $exception->getMessage());
- util::fail('修改失败');
- }
- }
- //修改客户地址 ssh 20231109
- public function actionModifyAddress()
- {
- $post = Yii::$app->request->post();
- $id = $post['id'] ?? 0;
- unset($post['id']);
- $custom = CustomClass::getById($id, true);
- if (empty($custom)) {
- util::fail('没有找到客户信息');
- }
- $userId = $custom->userId ?? 0;
- $city = $post['city'] ?? '';
- $dist = $post['dist'] ?? '';
- $address = $post['address'] ?? '';
- $floor = $post['floor'] ?? '';
- $post['fullAddress'] = $city . $dist . $address . $floor;
- UserClass::updateByCondition(['id' => $userId], $post);
- CustomClass::updateByCondition(['id' => $id], $post);
- util::complete('修改成功');
- }
- //修改名称 ssh 2022096
- public function actionChangeName()
- {
- $get = Yii::$app->request->get();
- $name = $get['name'] ?? '';
- $id = $get['id'] ?? 0;
- if (empty($name)) {
- util::fail('请填写名称');
- }
- $py = stringUtil::py($name);
- $custom = CustomClass::getById($id, true);
- CustomClass::valid($custom, $this->shopId);
- $custom->name = $name;
- $custom->py = $py;
- $custom->save();
- OrderClass::updateByCondition(['customId' => $id], ['customName' => $name, 'customNamePy' => $py]);
- util::complete();
- }
- //批量添加客户 ssh 20220919
- public function actionBatchAddCustom()
- {
- $post = Yii::$app->request->post();
- $connection = Yii::$app->db;
- $transaction = $connection->beginTransaction();
- try {
- for ($i = 1; $i <= 5; $i++) {
- $name = $post['name' . $i] ?? '';
- $mobile = $post['mobile' . $i] ?? '';
- $confirmMobile = $post['confirmMobile' . $i] ?? '';
- if (empty($name) && empty($mobile) && empty($confirmMobile)) {
- continue;
- }
- if (empty($name)) {
- util::fail('客户名称不能为空');
- }
- if (stringUtil::getWordNum($name) > 15) {
- util::fail('名称不能超过15个汉字');
- }
- if (empty($mobile)) {
- util::fail($name . " 手机号不能为空");
- }
- if (stringUtil::isMobile($mobile) == false) {
- util::fail($name . " 手机号格式不正确");
- }
- if ($mobile != $confirmMobile) {
- util::fail($name . " 二次手机号不一致");
- }
- $user = \bizMall\user\classes\UserClass::replaceUser(['name' => $name, 'mobile' => $mobile]);
- if (isset($this->shop) && !empty($this->shop)) {
- //花店增加客户,散客增加门店
- CustomClass::buildRelation($this->shop, $user);
- }
- }
- $transaction->commit();
- util::complete();
- } catch (\Exception $e) {
- $transaction->rollBack();
- util::fail('添加失败');
- }
- }
- //客户列表 ssh 2019.11.30
- public function actionList()
- {
- $get = Yii::$app->request->get();
- $type = $get['type'] ?? 0;
- $searchStyle = $get['searchStyle'] ?? 0;
- $where = ['shopId' => $this->shopId];
- if ($type == 1) {
- //消费排行
- $sort = 'buyAmount DESC';
- } else if ($type == 2) {
- //余额客户
- $sort = 'balance DESC';
- } else if ($type == 3) {
- //生日
- $sort = 'birthdayTime ASC';
- $where['birthdayTime>'] = 0;
- } else {
- $sort = 'visitTime DESC';
- }
- $name = $get['name'] ?? '';
- if (empty($name)) {
- $name = $get['keyword'] ?? '';
- }
- if (empty($name)) {
- $name = $get['searchText'] ?? '';
- }
- if (!empty($name)) {
- if ($searchStyle == 0) {
- $where['mobile'] = ['like', $name];
- } else {
- if (stringUtil::isLetter($name)) {
- $where['py'] = ['like', $name];
- } else {
- $where['name'] = ['like', $name];
- }
- }
- }
- $list = CustomService::getCustomList($where, $sort);
- util::success($list);
- }
- //获取客户信息 ssh 20250510
- public function actionInfo()
- {
- $get = Yii::$app->request->get();
- $id = $get['id'] ?? 0;
- $custom = CustomClass::getById($id, true);
- if (empty($custom)) {
- util::fail('没有找到客户信息');
- }
- if ($custom->shopId != $this->shopId) {
- util::fail('不是你的客户');
- }
- util::success(['custom' => $custom]);
- }
- //获取客户基本和资产信息 ssh 2019.11.30
- public function actionDetail()
- {
- $userId = Yii::$app->request->get('userId');
- $info = CustomClass::getCustomInfo($userId);
- CustomClass::valid($info, $this->shopId);
- util::success($info);
- }
- //获取客户详情,包括基本信息、资产、订单和备注 2019.11.30
- public function actionUserDetail()
- {
- $userId = Yii::$app->request->get('userId');
- $info = UserService::getFullUserInfo($userId);
- UserService::valid($info, $this->sjId);
- $list = MerchantRemarkService::getRemarkList($userId);
- $info['remarkList'] = $list;
- util::success($info);
- }
- //添加客户,申请会员时会自动同步资产 ssh 2019.11.30
- public function actionAdd()
- {
- $post = Yii::$app->request->post();
- if (isset($post['mobile']) == false || stringUtil::isMobile($post['mobile']) == false) {
- util::fail('请输入手机号');
- }
- if ($post['mobile'] != $post['confirmMobile']) {
- util::fail('二次输入手机号不一样');
- }
- $payPassword = isset($post['payPassword']) ? $post['payPassword'] : '';
- AdminService::verifyPayPassword($this->adminId, $payPassword);
- $mobile = $post['mobile'];
- $user = UserService::getByMobile($mobile, $this->sjId);
- if (!empty($user)) {
- util::fail('手机号已使用');
- }
- $post['sjId'] = $this->sjId;
- $post['member'] = $post['memberLevel'];
- UserService::addUser($post);
- util::complete();
- }
- //充值 ssh 2019.12.1
- public function actionRecharge()
- {
- $post = Yii::$app->request->post();
- $payPassword = isset($post['payPassword']) ? $post['payPassword'] : '';
- AdminService::verifyPayPassword($this->adminId, $payPassword);
- $userId = isset($post['userId']) ? $post['userId'] : 0;
- $rechargeAmount = isset($post['rechargeAmount']) ? $post['rechargeAmount'] : 1;
- $user = UserService::getById($userId);
- if (empty($user)) {
- util::fail('找不到客户');
- }
- if ($user['sjId'] != $this->sjId) {
- util::fail('您无法操作');
- }
- $userAsset = UserAssetService::getByUserId($userId);
- $totalBalance = $userAsset['balance'] + $rechargeAmount;
- $totalRecharge = $userAsset['totalRecharge'] + $rechargeAmount;
- $upData['balance'] = $totalBalance;
- $upData['totalRecharge'] = $totalRecharge;
- $merchantAsset = MerchantAssetService::getBySjId($this->sjId);
- $return = xhRechargeService::recharge($rechargeAmount, $user, $this->adminId, $this->sj->attributes, $this->sjExtend->attributes, $merchantAsset);
- if ($return['code'] == 'A0001') {
- util::complete();
- }
- util::fail();
- }
- //升级 ssh 2019.12.1
- public function actionUpgrade()
- {
- $post = Yii::$app->request->post();
- $userId = isset($post['userId']) ? $post['userId'] : 0;
- $member = isset($post['member']) ? $post['member'] : 0;
- $user = UserService::getById($userId);
- if (empty($user)) {
- util::fail('客户不存在');
- }
- //验证是否商家客户
- UserService::valid($user, $this->sjId);
- //验证确认密码
- $payPassword = $post['payPassword'];
- AdminService::verifyPayPassword($this->adminId, $payPassword);
- $grade = xhMerchantExtendService::getGradeList($this->sjExtend->attributes, 'desc');
- //升级后的成长值
- $newLevelGrowth = $grade[$member]['growth'];
- $newDiscount = $grade[$member]['discount'];
- $userAsset = UserAssetService::getByUserId($userId);
- if ($userAsset['member'] >= $member) {
- util::fail('客户已经达到此级别了');
- }
- $now = time();
- $date = date("Y-m-d H:i", $now);
- $connection = Yii::$app->db;
- $transaction = $connection->beginTransaction();
- try {
- $addGrowth = $newLevelGrowth - $userAsset['growth'];
- $upData['growth'] = $newLevelGrowth;
- $upData['member'] = $member;
- $upData['discount'] = $newDiscount;
- UserAssetService::updateByUserId($userId, $upData);
- UserService::updateById($userId, ['member' => $member]);
- $upgradeData = [
- 'member' => $member,
- 'prevMember' => $userAsset['member'],
- 'sjId' => $this->sjId,
- 'gainType' => 0,
- 'addTime' => $now,
- 'userId' => $userId,
- ];
- $upgradeRespond = UserUpgradeService::add($upgradeData);
- $growthData = [
- 'userId' => $userId,
- 'userName' => $user['userName'],
- 'sjId' => $this->sjId,
- 'relateId' => $upgradeRespond['id'],
- 'growth' => $newLevelGrowth,
- 'num' => $addGrowth,
- 'io' => 1,
- 'payWay' => 4,
- 'alipayId' => '',
- 'event' => '管理员操作升到' . $member . '级增加成长值',
- 'operatorId' => $userId,
- 'createTime' => $date,
- 'gainType' => 0,
- 'addTime' => $now,
- ];
- UserGrowthService::add($growthData);
- $transaction->commit();
- } catch (\Exception $e) {
- $transaction->rollBack();
- util::fail();
- }
- $allTM = xhTMessageService::getList($this->sjId);
- $openId = isset($user['openId']) ? $user['openId'] : '';
- if (empty($openId)) {
- util::complete();
- }
- $shortTempId = 'OPENTM205211943';//升级通知
- if (isset($allTM[$shortTempId]) == false) {
- util::complete();
- }
- $tempId = $allTM[$shortTempId];
- $data = [
- "touser" => $openId, "template_id" => $tempId, "url" => '',
- "data" => [
- "first" => ["value" => "恭喜,您已经升为{$member}级会员。", "color" => "#173177"],
- "keyword1" => ["value" => $user['userName'], "color" => "#173177"],
- "keyword2" => ["value" => $date, "color" => "#173177"],
- "remark" => ["value" => "点击查看会员权益", "color" => "#173177"],
- ]];
- wxUtil::sendTaskInform($data, $this->sj);
- util::complete();
- }
- //重置客户密码
- public function actionResetPayPassword()
- {
- $post = Yii::$app->request->post();
- $userId = isset($post['userId']) ? $post['userId'] : 0;
- $password = isset($post['password']) ? $post['password'] : 0;
- $info = UserService::getById($userId);
- UserService::valid($info, $this->sjId);
- UserService::updateById($userId, ['payPassword' => password_hash($password, PASSWORD_BCRYPT)]);
- util::complete();
- }
- //获取登陆客户的资产 ssh 2019.11.22
- public function actionAsset()
- {
- $asset = UserAssetService::getByUserId($this->adminId);
- util::success($asset);
- }
- //获取登陆客户的优惠情况 ssh 2019.12.3
- public function actionDiscount()
- {
- $discount = UserAssetService::getDiscount($this->adminId);
- util::success($discount);
- }
- //小程序用户完整信息 ssh 2019.12.12
- public function actionMiniFullInfo()
- {
- $post = Yii::$app->request->post();
- $iv = isset($post['iv']) ? $post['iv'] : '';
- $encryptedData = isset($post['encryptedData']) ? $post['encryptedData'] : '';
- $appId = $this->sj['miniAppId'];
- $sjId = $this->sjId;
- $miniOpenId = $this->user['miniOpenId'];
- if (empty($miniOpenId)) {
- util::fail('mini_open_id empty');
- }
- $cacheKey = 'MALL_MINI_SESSION_KEY_' . $miniOpenId;
- $sessionKey = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
- $wxMiniSecret = Yii::getAlias("@vendor/weixinMiniSecret");
- require_once($wxMiniSecret . '/wxBizDataCrypt.php');
- $pc = new \WXBizDataCrypt($appId, $sessionKey);
- $errCode = $pc->decryptData($encryptedData, $iv, $result);
- if ($errCode != 0) {
- Yii::info($result . ' ' . $errCode);
- util::fail('获取用户信息失败');
- }
- Yii::info('小程序获取用户信息:' . $result);
- $originalInfo = Json::decode($result);
- $source = UserClass::$userSourceId['mini']['name'];
- $user = UserService::replaceUser($originalInfo, $source, $sjId);
- $userId = $user['id'];
- $userInfo = UserService::getUserInfo($userId);
- util::success($userInfo);
- }
- //小程序用户手机号
- public function actionMiniMobile()
- {
- $post = Yii::$app->request->post();
- $iv = $post['iv'];
- $encryptedData = $post['encryptedData'];
- $sjId = $this->sjId;
- $merchant = $this->sj->attributes;
- $appId = $merchant['miniAppId'];
- $miniOpenId = $this->user['miniOpenId'];
- $user = $this->user;
- if (!empty($user) && !empty($user['mobile'])) {
- $userId = $user['id'];
- util::success(['mobile' => $user['mobile']]);
- }
- $cacheKey = 'MALL_MINI_SESSION_KEY_' . $miniOpenId;
- $sessionKey = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
- if (empty($sessionKey)) {
- util::fail('系统错误,sesstion empty');
- }
- $wxMiniSecret = Yii::getAlias("@vendor/weixinMiniSecret");
- require_once($wxMiniSecret . '/wxBizDataCrypt.php');
- $pc = new \WXBizDataCrypt($appId, $sessionKey);
- $errCode = $pc->decryptData($encryptedData, $iv, $result);
- if ($errCode != 0) {
- util::fail('解密失败');
- }
- $arr = Json::decode($result);
- $mobile = isset($arr['purePhoneNumber']) ? $arr['purePhoneNumber'] : '';
- if (empty($mobile)) {
- util::fail('没有获取手机号,请重试');
- }
- $userId = $user['id'];
- UserService::becomeMember($user, $merchant, ['mobile' => $mobile]);
- util::success(['mobile' => $mobile]);
- }
- //密码修改
- public function actionPassword()
- {
- $post = Yii::$app->request->post();
- $old = isset($post['old']) ? $post['old'] : '';
- $new = isset($post['new']) ? $post['new'] : '';
- $confirm = isset($post['confirm']) ? $post['confirm'] : '';
- if (empty($new)) {
- util::fail('请输入新密码');
- }
- if ($new != $confirm) {
- util::fail('二次密码不一致');
- }
- $userId = $this->adminId;
- $user = UserService::getUserInfo($userId);
- if (isset($user['hasPayPwd']) && $user['hasPayPwd'] == 1) {
- if (empty($old)) {
- util::fail('请填写旧密码');
- }
- if (password_verify($old, $user['payPassword']) == false) {
- util::fail('旧密码错误');
- }
- }
- UserService::updateById($userId, ['payPassword' => password_hash($new, PASSWORD_BCRYPT), 'hasPayPwd' => 1]);
- util::complete('修改成功');
- }
- //申请会员 ssh 2019.12.18
- public function actionApplyMember()
- {
- $post = Yii::$app->request->post();
- $mobile = isset($post['mobile']) ? $post['mobile'] : 0;
- if (stringUtil::isMobile($mobile) == false) {
- util::fail('请输入手机号');
- }
- $userId = $this->adminId;
- $asset = UserAssetService::getByUserId($userId);
- if (isset($asset['member']) && $asset['member'] != -1) {
- util::fail('已经是会员了');
- }
- $code = isset($post['code']) ? $post['code'] : '';
- $cacheCode = SmsService::getApplyMemberCode($userId, $mobile);
- if (empty($cacheCode) || $cacheCode != $code) {
- util::fail('验证码错误');
- }
- $update = [];
- if (isset($post['realName']) && !empty($post['realName'])) {
- $update['realName'] = $post['realName'];
- }
- if (isset($post['birthday']) && !empty($post['birthday'])) {
- $update['birthday'] = $post['birthday'];
- }
- $user = UserService::getByCondition(['sjId' => $this->sjId, 'mobile' => $mobile]);
- if ($userId == $user['id']) {
- util::fail('手机号已验证');
- }
- if (!empty($user)) {
- util::fail('手机号已经注册过了');
- }
- $update['mobile'] = $mobile;
- UserService::becomeMember($this->user, $this->sj->attributes, $update);
- util::complete('注册成功');
- }
- //用户基本信息和资产 ssh 2019.12.19
- public function actionMyProfile()
- {
- $custom = $this->custom;
- $user = UserService::getUserInfo($this->adminId);
- $growth = $custom['growth'] ?? 0;
- $extend = $this->sjExtend->attributes;
- $grade = MerchantExtendService::getGradeList($extend, 'asc');
- //下个等级的积分
- $nextLevelGrowth = 0;
- foreach ($grade as $val) {
- $currentGrowth = $val['growth'];
- if ($currentGrowth > $growth) {
- $nextLevelGrowth = $currentGrowth;
- break;
- }
- }
- $user['userAsset']['nextLevelGrowth'] = $nextLevelGrowth;
- util::success($user);
- }
- //登陆客户的信息 ssh 2020.3.12
- public function actionLoginDetail()
- {
- $user = $this->user;
- util::success($user);
- }
- //总赊账和总余额汇总 ssh 20250620
- public function actionShowTotalBalance()
- {
- $lookMoney = \bizGhs\shop\classes\ShopAdminClass::lookMoneyPower($this->shopAdmin, $this->shop);
- if ($lookMoney == 0) {
- util::fail('无法查看哦');
- }
- $lsShop = $this->shop;
- $pfShopId = $lsShop->pfShopId;
- $lsShopId = $this->shopId;
- $respond = \bizGhs\custom\classes\CustomClass::showTotalBalance($pfShopId, $lsShopId);
- $respond['pfShopId'] = $pfShopId;
- $respond['lsShopId'] = $lsShopId;
- util::success($respond);
- }
- //今日访客
- public function actionGetVisit()
- {
- $userIds = StatVisitClass::getVisitCustomIds($this->shopId);
- if (empty($userIds)) {
- util::success(['list' => []]);
- }
- $sort = 'visitTime DESC';
- $where = [
- 'shopId' => $this->shopId,
- 'userId' => ['in', $userIds]
- ];
- $list = CustomService::getCustomList($where, $sort);
- util::success($list);
- }
- }
|