shish пре 6 година
родитељ
комит
239ca491a0

+ 0 - 29
app/mini/assets/AppAsset.php

@@ -1,29 +0,0 @@
-<?php
-/**
- * @link http://www.yiiframework.com/
- * @copyright Copyright (c) 2008 Yii Software LLC
- * @license http://www.yiiframework.com/license/
- */
-
-namespace mini\assets;
-
-use yii\web\AssetBundle;
-
-/**
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @since 2.0
- */
-class AppAsset extends AssetBundle
-{
-    public $basePath = '@webroot';
-    public $baseUrl = '@web';
-    public $css = [
-        'css/site.css',
-    ];
-    public $js = [
-    ];
-    public $depends = [
-        'yii\web\YiiAsset',
-        'yii\bootstrap\BootstrapAsset',
-    ];
-}

+ 0 - 1
app/mini/config/bootstrap.php

@@ -1 +0,0 @@
-<?php

+ 0 - 4
app/mini/config/main-local.php

@@ -1,4 +0,0 @@
-<?php
-$config = [
-];
-return $config;

+ 0 - 53
app/mini/config/main.php

@@ -1,53 +0,0 @@
-<?php
-$params = array_merge(
-    require(__DIR__ . '/../../../common/config/params.php'),
-    require(__DIR__ . '/../../../common/config/params-local.php'),
-    require(__DIR__ . '/params.php'),
-    require(__DIR__ . '/params-local.php')
-);
-
-return [
-    'id' => 'app-mini',
-    'basePath' => dirname(__DIR__),
-    'bootstrap' => ['log'],
-    'defaultRoute' => 'main/index',//默认控制器
-    'controllerNamespace' => 'mini\controllers',
-    'components' => [
-	    'user' => [
-		    'identityClass' => 'common\models\xhUser',
-		    'enableAutoLogin' => true,
-		    'identityCookie' => [
-		   			 'name' => 'miniUser',
-		    ],
-		    'loginUrl' => ['main/index'],
-	    ],
-        'db' => [
-	        'class' => 'yii\db\Connection',
-            'dsn' => getenv('DB_DSN'),
-            'username' => getenv('DB_USERNAME'),
-            'password' => getenv('DB_PASSWORD'),
-	        'charset' => 'utf8',
-        ],
-        'log' => [
-            'traceLevel' => YII_DEBUG ? 3 : 0,
-            'targets' => [
-                [
-                    'class' => 'yii\log\FileTarget',
-                    'levels' => ['error', 'warning'],
-                ],
-            ],
-        ],
-        'errorHandler' => [
-            'errorAction' => 'site/error',
-        ],
-        'urlManager' => [
-            'enablePrettyUrl' => true,
-            'showScriptName' => false,
-            'rules' => [
-            	'a/<account:\d+>' => 'mobile/index',//商家花店首页
-            	'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
-            ],
-        ],
-    ],
-    'params' => $params,
-];

+ 0 - 3
app/mini/config/params-local.php

@@ -1,3 +0,0 @@
-<?php
-return [
-];

+ 0 - 3
app/mini/config/params.php

@@ -1,3 +0,0 @@
-<?php
-return [
-];

+ 0 - 97
app/mini/controllers/BaseController.php

@@ -1,97 +0,0 @@
-<?php
-/**
- * User: shish <479439056@qq.com>
- * Date: 2019/6/29
- * Time: 13:07
- */
-
-namespace mini\controllers;
-
-use biz\user\services\UserService;
-use common\components\util;
-use common\services\xhMerchantService;
-use Yii;
-use yii\web\Controller;
-
-class BaseController extends Controller
-{
-	
-	public $merchantId, $merchant, $userId = 0, $userInfo = [], $isLogin = false;
-	public $withoutLogin = [];//不需要登陆的方法名
-	
-	public function beforeAction($action)
-	{
-		
-		//获取token
-		$ignore = ['host', 'accept', 'content-length', 'content-type'];
-		$headers = [];
-		foreach ($_SERVER as $key => $value) {
-			if (substr($key, 0, 5) === 'HTTP_') {
-				$key = substr($key, 5);
-				$key = str_replace('_', ' ', $key);
-				$key = str_replace(' ', '-', $key);
-				$key = strtolower($key);
-				if (!in_array($key, $ignore)) {
-					$headers[$key] = $value;
-				}
-			}
-		}
-		$token = isset($headers['token']) ? $headers['token'] : '';
-		$account = isset($headers['account']) && !empty($headers['account']) ? $headers['account'] : 0;
-		$userId = Yii::$app->redis->executeCommand('GET', [$token]);
-		
-		if (empty($account)) {
-			$account = Yii::$app->request->get('account', 0);
-		}
-		if (empty($account)) {
-			util::sendFail('没有店铺信息');
-		}
-		$merchant = xhMerchantService::getByAccount($account);
-		if (empty($merchant)) {
-			util::sendFail('没有找到店铺信息');
-		}
-		if (in_array($action->id, $this->withoutLogin) == false) {
-			if (empty($userId)) {
-				util::sendFail('您没有权限访问');
-			}
-		}
-		if (!empty($userId)) {
-			$userInfo = UserService::getById($userId);
-			$this->userInfo = $userInfo;
-			Yii::$app->params['userInfo'] = $userInfo;
-		}
-		
-		$this->userId = $userId;
-		Yii::$app->params['userId'] = $userId;
-		
-		//全局变量设置
-		Yii::$app->params['merchantId'] = $account;
-		Yii::$app->params['merchant'] = $merchant;
-		$page = Yii::$app->request->get('page', 1);
-		Yii::$app->params['page'] = $page;
-		
-		//获取头信息里的token
-		$ignore = ['host', 'accept', 'content-length', 'content-type'];
-		$headers = [];
-		foreach ($_SERVER as $key => $value) {
-			if (substr($key, 0, 5) === 'HTTP_') {
-				$key = substr($key, 5);
-				$key = str_replace('_', ' ', $key);
-				$key = str_replace(' ', '-', $key);
-				$key = strtolower($key);
-				if (!in_array($key, $ignore)) {
-					$headers[$key] = $value;
-				}
-			}
-		}
-		$token = isset($headers['token']) ? $headers['token'] : '';
-
-		//小程序端默认的输出方式是json
-		Yii::$app->params['exportStyle'] = 'json';
-
-		$this->merchant = $merchant;
-		$this->merchantId = $account;
-		return parent::beforeAction($action);
-	}
-	
-}

+ 0 - 55
app/mini/controllers/CartController.php

@@ -1,55 +0,0 @@
-<?php
-/**
- * User: shish <shish@zhhinc.com>
- * Date: 2019/7/17
- * Time: 14:27
- */
-
-namespace mini\controllers;
-
-use common\components\util;
-use common\services\xhCartService;
-use Yii;
-use yii\helpers\Json;
-
-class CartController extends BaseController
-{
-	
-	public $enableCsrfValidation = false;
-	
-	//添加到购物车 shish 2019.7.17
-	public function actionAddCart()
-	{
-		//还有个post参数 multiPriceId
-		$post = Yii::$app->request->post();
-		$goodsId = isset($post['goodsId']) ? $post['goodsId'] : 0;
-		$post['merchantId'] = $this->merchantId;
-		$post['createTime'] = date("Y-m-d H:i:s");
-		$post['userId'] = $this->userId;
-		xhCartService::replace($this->userId, $goodsId, $post);
-		util::sendSuccess();
-	}
-
-	//获取购物车的列表 shish 2019.7.17
-	public function actionGetList()
-	{
-		$userId = $this->userId;
-		$cart = xhCartService::getUserCartList($userId);
-		util::sendJson(['cart' => $cart]);
-	}
-
-	//删除购物车记录 2019.7.17
-	public function actionDelCart()
-	{
-		$post = Yii::$app->request->post();
-		$goodsId = isset($post['goodsId']) ? $post['goodsId'] : 0;
-		$cart = xhCartService::getByIds($this->userId, $goodsId, $post['goodsPriceId']);
-		if ($cart['userId'] != $this->userId) {
-			util::failInfo('非法访问');
-		}
-		$goodsPriceId = $cart['goodsPriceId'];
-		xhCartService::delByIds($this->userId, $goodsId, $goodsPriceId, $cart['goodsPriceId']);
-		util::sendSuccess('删除成功');
-	}
-	
-}

+ 0 - 64
app/mini/controllers/CategoryController.php

@@ -1,64 +0,0 @@
-<?php
-/**
- * Created by PhpStorm.
- * User: shish <shish@zhhinc.com>
- * Date: 2019/6/29
- * Time: 14:27
- */
-
-namespace mini\controllers;
-
-use biz\goods\services\CategoryRelateService;
-use biz\goods\services\CategoryService;
-use biz\goods\services\GoodsCategoryService;
-use biz\goods\services\GoodsUsageService;
-use biz\goods\services\UsageRelationService;
-use common\components\util;
-use Yii;
-
-class CategoryController extends BaseController
-{
-	
-	//取商家分类和第一个分类的商品 shish 2019.7.3
-	public function actionGetCategoryList()
-	{
-		$menuList = CategoryRelateService::getShowList();
-		$firstGoodsList = [];
-		$id = 0;
-		if (!empty($menuList)) {
-			$first = reset($menuList);
-			$id = $first['id'];
-			$type = $first['type'];
-			if ($type == 'category') {
-				$goodsList = GoodsCategoryService::getGoodsList($id);
-			} elseif ($type == 'usage') {
-				$goodsList = GoodsUsageService::getGoodsData($id);
-			} else {
-				util::fail('菜单类型不存在');
-			}
-			$firstGoodsList = $goodsList;
-		}
-		$data = ['categoryList' => $menuList, 'firstGoodsList' => $firstGoodsList, 'categoryId' => $id];
-		util::sendJson($data);
-	}
-	
-	//取分类下的商品 shish 2019.7.9
-	public function actionGetList()
-	{
-		$id = Yii::$app->request->get('id', 0);
-		$type = Yii::$app->request->get('type', 'category');
-		if ($type == 'category') {
-			$data = GoodsCategoryService::getCategoryAndList($id);
-			$data['category']['categoryName'] = $data['category']['showName'];
-		} elseif ($type == 'usage') {
-			$data = GoodsUsageService::getGoodsList($id);
-			$data['category'] = $data['info'];
-			$data['category']['categoryName'] = $data['info']['showName'];
-		} else {
-			util::fail('无效类型');
-		}
-		$data['vipShow'] = 1;
-		util::sendJson($data);
-	}
-
-}

+ 0 - 69
app/mini/controllers/GoodsController.php

@@ -1,69 +0,0 @@
-<?php
-/**
- * Created by PhpStorm.
- * User: shish <shish@zhhinc.com>
- * Date: 2019/6/29
- * Time: 14:27
- */
-
-namespace mini\controllers;
-
-use biz\goods\services\CategoryRelateService;
-use biz\goods\services\GoodsCategoryService;
-use biz\goods\services\GoodsUsageService;
-use common\components\util;
-use common\services\xhGoodsService;
-use common\services\xhRecommendService;
-use Yii;
-use yii\helpers\Json;
-
-class GoodsController extends BaseController
-{
-	
-	public $withoutLogin = ['get-index-data'];
-	
-	public function actionGetLimitGoods()
-	{
-		$list = xhGoodsService::getLimitGoods($this->merchantId);
-		util::sendJson($list);
-	}
-	
-	public function actionGetIndexData()
-	{
-		$slide = xhRecommendService::getSlide($this->merchantId);
-		$list = xhGoodsService::getLimitGoods($this->merchantId);
-		$categoryData = CategoryRelateService::getShowList(8);
-		$chunkData = array_chunk($categoryData, 4);
-		$category1 = $chunkData[0];
-		$category2 = $chunkData[1];
-		//首页第一个分类列表的名称 shish 2019.8.3
-		$firstCategoryName = '掌柜推荐';
-		//是否显示第一个分类列表的名称 shish 2019.8.3
-		$showFirstCategory = 1;
-		$data = ['goods' => $list, 'slide' => $slide, 'category1' => $category1,
-			'category2' => $category2, 'firstCategoryName' => $firstCategoryName, 'showFirstCategory' => $showFirstCategory];
-		util::sendJson($data);
-	}
-	
-	public function actionGetById()
-	{
-		$id = Yii::$app->request->get('id', 0);
-		$info = xhGoodsService::getById($id);
-		$info['shopImg'] = json_decode($info['shopImg'], true);
-		util::sendJson($info);
-	}
-	
-	//根据分类取商品列表 shish 2019.7.3
-	public function actionGetListByCategory()
-	{
-		$id = Yii::$app->request->get('categoryId', 0);
-		$type = Yii::$app->request->get('type', 'category');
-		if ($type == 'category') {
-			$return = GoodsCategoryService::getGoodsList($id);
-		} else {
-			$return = GoodsUsageService::getGoodsData($id);
-		}
-		util::sendJson($return);
-	}
-
-}

+ 0 - 19
app/mini/controllers/MainController.php

@@ -1,19 +0,0 @@
-<?php
-namespace mini\controllers;
-
-use common\components\util;
-use common\services\xhGoodsService;
-use common\services\xhRecommendService;
-use Yii;
-use yii\helpers\Json;
-
-class MainController extends BaseController{
-
-    public function actionIndex()
-    {
-	    $slide = xhRecommendService::getSlide($this->merchantId);
-	    //$list = xhGoodsService::getLimitGoods($this->merchantId);
-	    echo Json::encode($slide);
-    }
-
-}

+ 0 - 27
app/mini/controllers/MerchantController.php

@@ -1,27 +0,0 @@
-<?php
-
-namespace mini\controllers;
-
-use biz\user\services\UserAssetService;
-use common\components\util;
-use common\services\xhMerchantExtendService;
-use Yii;
-
-class MerchantController extends BaseController
-{
-	
-	//商家信息 shish 2019.7.28
-	public function actionGetInfo()
-	{
-		$userAsset = UserAssetService::getByUserId($this->userId);
-		$extend = xhMerchantExtendService::getByMerchantId($this->merchantId);
-		$level = $userAsset['memberLevel'];
-		$memberIntegral = xhMerchantExtendService::getGradeList($extend, 'desc');
-		$discount = isset($memberIntegral[$level]['discount']) ? $memberIntegral[$level]['discount'] : 100;
-		$userAsset['discount'] = $discount;
-		//用于展示,去掉0的折扣
-		$userAsset['discountShow'] = str_replace('0', '', $discount);
-		util::sendJson(['merchant' => $this->merchant, 'userAsset' => $userAsset]);
-	}
-	
-}

+ 0 - 85
app/mini/controllers/NoticeController.php

@@ -1,85 +0,0 @@
-<?php
-
-namespace mini\controllers;
-
-use common\services\xhPayToolService;
-use Yii;
-use yii\web\Controller;
-use common\components\util;
-use common\services\xhRechargeService;
-
-class NoticeController extends Controller
-{
-	
-	public $enableCsrfValidation = false;
-	
-	/**
-	 * 微信支付异步回调
-	 */
-	public function actionWeixinRechargeCallback()
-	{
-		$postStr = file_get_contents('php://input');//接收微信服务器返回的xml消息体
-		if (empty($postStr)) {
-			util::end();
-		}
-		$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);
-		if ($postObj->return_code != 'SUCCESS') {
-			Yii::warning('return_code error:' . $postObj->return_code);
-			util::end();
-		}
-		$orderId = $postObj->out_trade_no;
-		Yii::info('recharge order id:' . $orderId);
-		$total_fee = $postObj->total_fee;
-		$totalFee = $total_fee / 100;
-		$attach = $postObj->attach;
-		parse_str($attach);//接收流水类型、代金劵
-		$couponId = isset($couponId) ? $couponId : 0;
-		$capitalType = isset($capitalType) ? $capitalType : null;//流水类型
-		if (isset($capitalType) == false) {
-			Yii::warning('capitalType empty,orderId:' . $orderId);
-			util::end();
-		}
-		$recharge = xhRechargeService::getById($orderId);
-		if (empty($recharge)) {
-			Yii::warning('recharge order empty');
-			util::end();
-		}
-		$return = xhRechargeService::miniRecharge($orderId, $totalFee);
-		if ($return['status'] == false) {
-			Yii::warning($return['msg']);
-			util::end();
-		}
-		echo '<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>';
-	}
-	
-	public function actionMiniPayCallback()
-	{
-		$postStr = file_get_contents('php://input');//接收微信服务器返回的xml消息体
-		if (empty($postStr)) {
-			util::end();
-		}
-		$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);
-		if ($postObj->return_code != 'SUCCESS') {
-			Yii::warning('return_code error:' . $postObj->return_code);
-			util::end();
-		}
-		$orderId = $postObj->out_trade_no;
-		$total_fee = $postObj->total_fee;
-		$totalFee = $total_fee / 100;
-		$attach = $postObj->attach;
-		parse_str($attach);//接收流水类型、代金劵
-		$couponId = isset($couponId) ? $couponId : 0;
-		$capitalType = isset($capitalType) ? $capitalType : null;//流水类型
-		if (isset($capitalType) == false) {
-			Yii::warning('capitalType empty,orderId:' . $orderId);
-			util::end();
-		}
-		$return = xhPayToolService::weixinPay($orderId, $totalFee, $capitalType, $couponId);//支付回调流程
-		if ($return['code'] == 'A0002') {
-			Yii::warning('callback exec and failed,capitalType:' . $capitalType . ' orderId:' . $orderId);
-			util::end();
-		}
-		echo '<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>';
-	}
-	
-}

+ 0 - 216
app/mini/controllers/OrderController.php

@@ -1,216 +0,0 @@
-<?php
-/**
- * User: shish <shish@zhhinc.com>
- * Date: 2019/7/15
- * Time: 14:27
- */
-
-namespace mini\controllers;
-
-use biz\order\services\OrderService;
-use common\components\configDict;
-use common\components\util;
-use common\services\xhCartService;
-use common\services\xhCouponService;
-use common\services\xhGoodsPriceService;
-use common\services\xhGoodsService;
-use common\services\xhGoodsSettingService;
-use common\services\xhMerchantExtendService;
-use common\services\xhOrderGoodsService;
-use common\services\xhOrderService;
-use common\services\xhUserAssetService;
-use Yii;
-use yii\helpers\Json;
-
-class OrderController extends BaseController
-{
-	
-	public $enableCsrfValidation = false;
-	
-	//创建订单
-	public function actionGenerateOrder()
-	{
-		$post = Yii::$app->request->post();
-		$userId = $this->userId;
-		$post['userId'] = $userId;
-		$post['payWay'] = 0;
-		$regionArr = explode(',',$post['region']);
-
-		/*
-				$lat2 = $post['receiveLat'];//收货人纬度
-				$lng2 = $post['receiveLong'];//收货人经度
-				$lat1 = $this->merchant['shopLat'];//花店纬度
-				$lng1 = $this->merchant['shopLong'];//花店经度
-				$calcDistance = util::getDistance($lat1, $lng1, $lat2, $lng2);//防止别人改动,PHP计算的距离会比腾讯js算的小,但能保证有一定准确性
-				$post['sendDistance'] = $post['sendDistance'] >= $calcDistance ? $post['sendDistance'] : $calcDistance;//二地距离
-				$sendDistance = $post['sendDistance'];
-				$freight = configDict::getConfig('freight');
-				$firstDistance = $freight['firstDistance'];
-				$firstPrice = $freight['firstPrice'];
-				$nextDistance = $freight['nextDistance'];
-				$nextPrice = $freight['nextPrice'];
-				if ($sendDistance <= $firstDistance && $post['isCharge'] == 1) {
-					$post['sendCost'] = $firstPrice;
-				} else if ($post['isCharge'] == 1) {
-					$subDistance = $sendDistance - $firstDistance;
-					$addPrice = intval($subDistance / $nextDistance) * $nextPrice;
-					$post['sendCost'] = $firstPrice + $addPrice;
-				}
-		*/
-		$post['receiveProvince'] = $regionArr[0];
-		$post['receiveCity'] = $regionArr[1];
-		$post['receiveDist'] = $regionArr[2];		
-		$post['receiveFullAddress'] = $regionArr[0].$regionArr[1].$regionArr[2].$post['receiveAddress'].$post['receiveFloor'];
-
-
-		$extend = xhMerchantExtendService::getByMerchantId($this->merchantId);
-		if (empty($extend['payment'])) {
-			util::sendFail('支付功能未开通,暂时无法购买哦~');
-		}
-		$couponAmount = 0;
-		$couponId = isset($post['couponId']) ? $post['couponId'] : 0;//代金劵
-		if (!empty($couponId)) {
-			$coupon = xhCouponService::getById($couponId);
-			$couponUserId = $coupon['userId'];
-			if ($couponUserId != $userId) {
-				util::failInfo('不是你的代金劵');
-			}
-			if ($coupon['useStatus'] == 1 || $coupon['deadline'] < time()) {
-				util::failInfo('代金劵已经失效了');
-			}
-			$couponAmount = $coupon['amount'];
-		}
-		//不要将代金劵保存到订单表,付款成功后再保存进去!!!
-		unset($post['couponId']);
-		$post['merchantId'] = $this->merchantId;
-		//店铺id
-		$post['shopId'] = $this->merchant['defaultShopId'];
-		$order = xhOrderService::add($post);//创建订单
-		if ($order == false) {
-			util::failInfo('创建订单失败');
-		}
-		$orderId = $order['id'];
-		$oData = [];
-		$goodsInfo = json_decode($post['goodsInfo'], true);
-		$totalFee = 0;//计算总价格
-		$goodsIdList = [];
-		$multiPriceIdList = [];
-		$orderName = '';
-		$goodsNum = 0;
-		foreach ($goodsInfo as $key => $val) {
-			$multiPriceId = 0;//多种价格表Id
-			$goodsId = $val['goodsId'];
-			$num = $val['num'];
-			$goodsNum += $num;
-			$goods = xhGoodsService::getById($goodsId);
-			if (empty($orderName)) {
-				$orderName = $goods['goodsName'];
-			}
-			$price = $goods['price'];
-			if ($val['multiPriceId'] != 0 && $goods['multiPrice'] != '') {
-				$pos = strpos($goods['multiPrice'], $val['multiPriceId']);
-				if ($pos === false) {
-					util::failInfo('订单的商品不存在');
-				}
-				$goodPrice = xhGoodsPriceService::getById($val['multiPriceId']);
-				//$price = $goodPrice['price'];
-				$price = xhGoodsSettingService::changePrice($goods, $goodPrice['price']);//统一对商品进行价格等方面设置
-				//多种价格规格 替换 默认(单价格)
-				$goods['goodsName'] = $goodPrice['title'];
-				//$goods['cover'] = $goodPrice['picture'];//后台图片上传功能未开发,暂时使用默认商品图片
-				$multiPriceId = $val['multiPriceId'];
-			}
-			$totalFee += $price * $num;
-			$goodsIdList[] = $goodsId;
-			$multiPriceIdList[] = $multiPriceId;
-			$data = [
-				'orderId' => $orderId,
-				'goodsId' => $goodsId,
-				'userId' => $userId,
-				'merchantId' => $this->merchantId,
-				'title' => $goods['goodsName'],
-				'cover' => $goods['cover'],
-				'unitPrice' => $price,
-				'num' => $num,
-				'multiPriceId' => $multiPriceId,
-				'createTime' => date("Y-m-d H:i:s"),
-			];
-			xhOrderGoodsService::add($data);//创建订单商品列表
-		}
-		$sendCost = $post['sendCost'];//运费
-		$oData['goodsNum'] = $goodsNum;//订单的商品数量类型,单个还是多个的
-		$oData['prePrice'] = $totalFee + $sendCost;
-		$oData['orderName'] = $goodsNum > 1 ? $orderName . '等' . $goodsNum . '件商品' : $orderName;
-		if (isset($post['sourceType']) && $post['sourceType'] == 'cart') {
-			if (!empty($goodsIdList)) {
-				foreach ($goodsIdList as $key => $goodsId) {
-					xhCartService::delByIds($userId, $goodsId, $multiPriceIdList[$key]);//删除购物车($userId, $goodsId, $goodsPriceId, $cartId)
-				}
-			}
-		}
-		$userAsset = xhUserAssetService::getByUserId($userId);
-		$level = $userAsset['memberLevel'];
-		if ($level > 0) {
-			$merchantExtend = xhMerchantExtendService::getByMerchantId($this->merchantId);
-			$gradeList = xhMerchantExtendService::getGradeList($merchantExtend);
-			$discount = $gradeList[$level]['discount'];
-			$discount = strlen($discount) == 1 ? $discount * 10 : $discount;
-			$totalFee = number_format($discount * $totalFee / 100, 2);
-		}
-		$oData['actPrice'] = $totalFee + $sendCost - $couponAmount;
-		xhOrderService::updateById($orderId, $oData);
-		util::sendJson(['orderId' => $orderId, 'couponId' => $couponId, 'price' => $oData['actPrice']]);
-	}
-	
-	//取出所有订单
-	public function actionGetList()
-	{
-		$list = OrderService::getAllListInfo($this->userId);
-		util::sendJson(['list' => $list]);
-	}
-	
-	//订单详情
-	public function actionGetDetail()
-	{
-		$id = Yii::$app->request->get('id');
-		$info = OrderService::getDetail($id);
-		if (isset($info) && $info['userId'] != $this->userId) {
-			util::sendFail('不是你的订单');
-		}
-		util::sendJson(['info' => $info]);
-	}
-	
-	public function actionOrder()
-	{
-		$order = xhOrderService::getAllByCondition(['userId' => $this->userId]);
-		$payStatusName = configDict::getConfig('payStatusName');
-		return $this->render('order', ['order' => $order, 'payStatusName' => $payStatusName]);
-	}
-	
-	public function actionOrderDetail()
-	{
-		$get = Yii::$app->request->get();
-		$id = isset($get['id']) ? $get['id'] : 0;
-		$order = xhOrderService::getById($id);
-		if ($order['userId'] != $this->userId) {
-			util::stop('非法访问');
-		}
-		if ($order['sourceType'] == 0) {//0商城订单
-			$goodsList = xhOrderGoods::getAllByCondition(['orderId' => $id]);
-			foreach ($goodsList as $key => $good) {
-				$goodsId = $good['goodsId'];
-				$goodsData = xhGoodsService::getById($goodsId);
-				if ($goodsData['goodsName'] != $good['title']) {
-					$subTitle = $good['title'];
-					$goodsList[$key]['title'] = $goodsData['goodsName'];
-					$goodsList[$key]['subTitle'] = $subTitle;
-				}
-			}
-		} else if ($order['sourceType'] == 1) {//1付款订单
-			$goodsList = [];
-		} else {
-			util::stop('未知订单类型');
-		}
-	}
-	
-}

+ 0 - 318
app/mini/controllers/PayController.php

@@ -1,318 +0,0 @@
-<?php
-
-namespace mini\controllers;
-
-use biz\user\services\UserService;
-use common\components\configDict;
-use common\components\stringUtil;
-use common\components\util;
-use common\services\xhMerchantExtendService;
-use common\services\xhMerchantService;
-use common\services\xhOrderService;
-use common\services\xhPayToolService;
-use common\services\xhRechargeService;
-use common\services\xhUserAssetService;
-use common\services\xhUserService;
-use Yii;
-use yii\web\Controller;
-use yii\helpers\Json;
-use linslin\yii2\curl;
-use common\components\jsSDK;
-
-class PayController extends BaseController
-{
-	
-	public $enableCsrfValidation = false;
-	
-	public $secretKey = 'wx3hj5a26af5c17fb86921f3';
-	
-	public function actionBalancePay()
-	{
-		$account = $this->merchantId;
-		$merchant = $this->merchant;
-		$payAmount = Yii::$app->request->get('payAmount', 2000);
-		$shopId = $merchant['defaultShopId'];
-		$user = $this->userInfo;
-		ini_set('date.timezone', 'Asia/Shanghai');
-		if ($payAmount < 0) {
-			util::failInfo('付款金额太少');
-		}
-		$userId = $user['id'];
-		$userAsset = xhUserAssetService::getByUserId($userId);
-		$level = isset($userAsset['memberLevel']) ? $userAsset['memberLevel'] : 0;
-		
-		$merchantExtend = xhMerchantExtendService::getByMerchantId($account);
-		$memberIntegral = xhMerchantExtendService::getGradeList($merchantExtend, 'desc');
-		$discount = isset($memberIntegral[$level]['discount']) ? $memberIntegral[$level]['discount'] : $memberIntegral[$level]['discount'];
-		$prePrice = $payAmount;
-		$actPrice = $payAmount;
-		//折扣后保留一位小数
-		if (!empty($discount) && $prePrice >= 1) {
-			$currentPrice = ($prePrice * $discount) / 100;
-			$actPrice = substr(sprintf("%.3f", $currentPrice), 0, -2);
-		}
-		
-		$userId = $user['id'];
-		$payData['userId'] = $userId;
-		$payData['prePrice'] = $prePrice;
-		$payData['actPrice'] = $actPrice;
-		$payData['payStyle'] = 0;
-		$payData['shopId'] = $shopId;
-		$payData['merchantId'] = $merchant['id'];
-		$now = time();
-		$expireTime = $now + 300;//订单5分钟后过期
-		$payData['createTime'] = date("Y-m-d H:i:s", $now);
-		$payData['addTime'] = time();
-		$payData['deadline'] = $expireTime;
-		$payData['id'] = stringUtil::generateOrderNo($account, $userId);
-		$payData['sourceType'] = 1;//订单来源:0商城订单 1付款订单
-		$payment = xhOrderService::add($payData);
-		$orderId = $payment['id'];
-		
-		$couponId = isset($post['couponId']) ? $post['couponId'] : 0;
-		$order = xhOrderService::getById($orderId);
-		
-		$typeList = configDict::getConfig('capitalType');
-		$capitalType = $typeList['xhOrder']['id'];
-		$totalFee = $order['actPrice'];
-		
-		$return = xhPayToolService::balancePay($orderId, $totalFee, $capitalType, $couponId);
-		if ($return['code'] == 'A0001') {
-			util::sendSuccess();
-		}
-		util::failInfo($return['msg']);
-	}
-	
-	//小程序快速付款页 shish 2019.7.26
-	public function actionGetPayParams()
-	{
-		$merchant = $this->merchant;
-		$shopId = $merchant['defaultShopId'];
-		$account = $this->merchantId;
-		$extend = xhMerchantExtendService::getByMerchantId($account);
-		if (empty($extend)) {
-			util::failInfo('商家信息有误');
-		}
-		$user = $this->userInfo;
-		if (empty($user)) {
-			util::failInfo('没有用户信息');
-		}
-		ini_set('date.timezone', 'Asia/Shanghai');
-		$payAmount = Yii::$app->request->get('payAmount', 2000);
-		if ($payAmount < 0) {
-			util::failInfo('付款金额太少');
-		}
-		
-		$userId = $user['id'];
-		$userAsset = xhUserAssetService::getByUserId($userId);
-		$level = isset($userAsset['memberLevel']) ? $userAsset['memberLevel'] : 0;
-		
-		$memberIntegral = xhMerchantExtendService::getGradeList($extend, 'desc');
-		$discount = isset($memberIntegral[$level]['discount']) ? $memberIntegral[$level]['discount'] : $memberIntegral[$level]['discount'];
-		$prePrice = $payAmount;
-		$actPrice = $payAmount;
-		//折扣后保留一位小数
-		if (!empty($discount) && $prePrice >= 1) {
-			$currentPrice = ($prePrice * $discount) / 100;
-			$actPrice = substr(sprintf("%.3f", $currentPrice), 0, -2);
-		}
-		
-		$userId = $user['id'];
-		$payData['userId'] = $userId;
-		$payData['prePrice'] = $prePrice;
-		$payData['actPrice'] = $actPrice;
-		$payData['payStyle'] = 0;
-		$payData['shopId'] = $shopId;
-		$payData['merchantId'] = $merchant['id'];
-		$now = time();
-		$expireTime = $now + 300;//订单5分钟后过期
-		$payData['createTime'] = date("Y-m-d H:i:s", $now);
-		$payData['addTime'] = time();
-		$payData['deadline'] = $expireTime;
-		$payData['id'] = stringUtil::generateOrderNo($account, $userId);
-		$payData['sourceType'] = 1;//订单来源:0商城订单 1付款订单
-		$payment = xhOrderService::add($payData);
-		$orderId = $payment['id'];
-		
-		Yii::$app->params['userId'] = $userId;
-		Yii::$app->params['merchantId'] = $merchant['id'];
-		UserService::updateVisitTime();
-		
-		$name = '买单';
-		$totalFee = $actPrice;
-		$openId = $user['miniOpenId'];
-		if (empty($openId)) {
-			util::failInfo('miniOpenId empty');
-		}
-		
-		$typeList = configDict::getConfig('capitalType');
-		$capitalType = $typeList['xhOrder']['id'];
-		$attach = 'capitalType=' . $capitalType;//将流水类型、代金劵传过去
-		$weixin = Yii::getAlias("@vendor/weixin");
-		require_once($weixin . '/lib/WxPay.Api.php');
-		require_once($weixin . '/example/WxPay.JsApiPay.php');
-		$input = new \WxPayUnifiedOrder();
-		$input->SetBody($name);
-		$input->SetOut_trade_no($orderId);
-		$input->SetTotal_fee($totalFee * 100);
-		$input->SetTime_start(date("YmdHis", $now));
-		$input->SetAttach($attach);
-		$input->SetTime_expire(date("YmdHis", $expireTime));//设置订单有效期5分钟
-		$input->SetNotify_url(Yii::$app->params['miniUrl'] . '/notice/mini-pay-callback/');
-		$input->SetTrade_type("JSAPI");
-		
-		//服务商 代设置微信支付,要添加的参数设置
-		if ($extend['generalMerchant'] == 1) {
-			//$input->SetOpenid($openId);
-			$input->SetSub_openid($openId);
-			//自设置 微信支付
-		} else {
-			$input->SetOpenid($openId);
-		}
-		//这里用的wxAppId是小程序的appId
-		$extend['wxAppId'] = $extend['miniAppId'];
-		$wxOrder = \WxPayApi::unifiedOrder($input, 6, $extend);
-		$tools = new \JsApiPay();
-		$jsApiParameters = $tools->GetJsApiParameters($wxOrder, $extend);
-		$newParams = json_decode($jsApiParameters, true);
-		$newParams['orderId'] = $orderId;
-		util::successInfo('操作成功', 'A0001', $newParams);
-	}
-	
-	//小程序商品发起支付需要的参数
-	public function actionGetMiniPayParams()
-	{
-		$id = Yii::$app->request->get('id');
-		$merchant = $this->merchant;
-		
-		$extend = xhMerchantExtendService::getByMerchantId($this->merchantId);
-		
-		$payment = xhOrderService::getById($id);
-		$orderId = $payment['id'];
-		
-		Yii::$app->params['userId'] = $this->userId;
-		Yii::$app->params['merchantId'] = $merchant['id'];
-		UserService::updateVisitTime();
-		
-		$name = '买单';
-		$totalFee = $payment['actPrice'];
-		$openId = $this->userInfo['miniOpenId'];
-		if (empty($openId)) {
-			util::failInfo('miniOpenId empty');
-		}
-		$now = time();
-		$expireTime = $now + 300;//订单5分钟后过期
-		
-		$typeList = configDict::getConfig('capitalType');
-		$capitalType = $typeList['xhOrder']['id'];
-		$attach = 'capitalType=' . $capitalType;//将流水类型、代金劵传过去
-		$weixin = Yii::getAlias("@vendor/weixin");
-		require_once($weixin . '/lib/WxPay.Api.php');
-		require_once($weixin . '/example/WxPay.JsApiPay.php');
-		$input = new \WxPayUnifiedOrder();
-		$input->SetBody($name);
-		$input->SetOut_trade_no($orderId);
-		$input->SetTotal_fee($totalFee * 100);
-		$input->SetTime_start(date("YmdHis", $now));
-		$input->SetAttach($attach);
-		$input->SetTime_expire(date("YmdHis", $expireTime));//设置订单有效期5分钟
-		$input->SetNotify_url(Yii::$app->params['miniUrl'] . '/notice/mini-pay-callback/');
-		$input->SetTrade_type("JSAPI");
-		
-		//服务商 代设置微信支付,要添加的参数设置
-		if ($extend['generalMerchant'] == 1) {
-			//$input->SetOpenid($openId);
-			$input->SetSub_openid($openId);
-			//自设置 微信支付
-		} else {
-			$input->SetOpenid($openId);
-		}
-		//这里用的wxAppId是小程序的appId
-		$extend['wxAppId'] = $extend['miniAppId'];
-		$wxOrder = \WxPayApi::unifiedOrder($input, 6, $extend);
-		$tools = new \JsApiPay();
-		$jsApiParameters = $tools->GetJsApiParameters($wxOrder, $extend);
-		$newParams = json_decode($jsApiParameters, true);
-		$newParams['orderId'] = $orderId;
-		util::successInfo('操作成功', 'A0001', $newParams);
-	}
-	
-	public function actionGetRechargeParams()
-	{
-		$account = $this->merchantId;
-		$merchant = $this->merchant;
-		$extend = xhMerchantExtendService::getByMerchantId($account);
-		if (empty($extend)) {
-			util::failInfo('没有商家信息...');
-		}
-		$user = $this->userInfo;
-		if (empty($user)) {
-			util::failInfo('没有用户信息');
-		}
-		ini_set('date.timezone', 'Asia/Shanghai');
-		$rechargeAmount = Yii::$app->request->get('rechargeAmount', 0);
-		if ($rechargeAmount <= 0) {
-			util::failInfo('请填写充值金额');
-		}
-		$rechargeAmount = round($rechargeAmount, 2);//四舍五入,保留二位小数
-		$userId = $user['id'];
-		$rechargeData['userId'] = $userId;
-		$rechargeData['actPrice'] = $rechargeAmount;
-		$rechargeData['payStyle'] = 0;
-		$rechargeData['merchantId'] = $merchant['id'];
-		$now = time();
-		$expireTime = $now + 300;//订单5分钟后过期
-		$rechargeData['createTime'] = date("Y-m-d H:i:s", $now);
-		$rechargeData['addTime'] = time();
-		$rechargeData['deadline'] = $expireTime;
-		$rechargeData['id'] = stringUtil::generateOrderNo($account, $userId);
-		$rechargeData['sourceType'] = 1;//订单来源:0商城订单 1付款订单
-		$payment = xhRechargeService::add($rechargeData);
-		$orderId = $payment['id'];
-		
-		Yii::$app->params['userId'] = $userId;
-		Yii::$app->params['merchantId'] = $merchant['id'];
-		UserService::updateVisitTime();
-		
-		$name = '充值';
-		$totalFee = $rechargeAmount;
-		$openId = $user['miniOpenId'];
-		if (empty($openId)) {
-			util::failInfo('miniOpenId empty');
-		}
-		
-		$typeList = configDict::getConfig('capitalType');
-		$capitalType = $typeList['xhRecharge']['id'];
-		$attach = 'capitalType=' . $capitalType;//将流水类型、代金劵传过去
-		$weixin = Yii::getAlias("@vendor/weixin");
-		require_once($weixin . '/lib/WxPay.Api.php');
-		require_once($weixin . '/example/WxPay.JsApiPay.php');
-		$input = new \WxPayUnifiedOrder();
-		$input->SetBody($name);
-		$input->SetOut_trade_no($orderId);
-		$input->SetTotal_fee($totalFee * 100);
-		$input->SetTime_start(date("YmdHis", $now));
-		$input->SetAttach($attach);
-		$input->SetTime_expire(date("YmdHis", $expireTime));//设置订单有效期5分钟
-		$input->SetNotify_url(Yii::$app->params['miniUrl'] . '/notice/weixin-recharge-callback/');
-		$input->SetTrade_type("JSAPI");
-		
-		//服务商 代设置微信支付,要添加的参数设置
-		if ($extend['generalMerchant'] == 1) {
-			//$input->SetOpenid($openId);
-			$input->SetSub_openid($openId);
-			//自设置 微信支付
-		} else {
-			$input->SetOpenid($openId);
-		}
-		//这里用的wxAppId是小程序的appId
-		$extend['wxAppId'] = $extend['miniAppId'];
-		$wxOrder = \WxPayApi::unifiedOrder($input, 6, $extend);
-		$tools = new \JsApiPay();
-		$jsApiParameters = $tools->GetJsApiParameters($wxOrder, $extend);
-		$newParams = json_decode($jsApiParameters, true);
-		$newParams['orderId'] = $orderId;
-		util::sendJson($newParams);
-	}
-	
-}

+ 0 - 24
app/mini/controllers/RecommendController.php

@@ -1,24 +0,0 @@
-<?php
-/**
- * Created by PhpStorm.
- * User: shishaohua <shish@zhhin.com>
- * Date: 2019/6/29
- * Time: 14:27
- */
-namespace mini\controllers;
-
-use common\components\util;
-use common\services\xhGoodsService;
-use common\services\xhRecommendService;
-use Yii;
-use yii\helpers\Json;
-
-class RecommendController extends BaseController{
-	
-	public function actionGetSlide()
-	{
-		$slide = xhRecommendService::getSlide($this->merchantId);
-		echo Json::encode($slide);
-	}
-	
-}

+ 0 - 197
app/mini/controllers/UserController.php

@@ -1,197 +0,0 @@
-<?php
-
-namespace mini\controllers;
-
-use biz\user\services\UserAssetService;
-use biz\user\services\UserOldDataService;
-use biz\user\services\UserService;
-use common\components\stringUtil;
-use common\components\util;
-use common\services\xhMerchantExtendService;
-use common\services\xhMerchantService;
-use common\services\xhUserService;
-use Yii;
-use yii\web\Controller;
-use yii\helpers\Json;
-use linslin\yii2\curl;
-
-class UserController extends BaseController
-{
-	
-	public $enableCsrfValidation = false;
-	
-	public $secretKey = 'wx3hj5a26af5c17fb86921f3';
-	
-	public $withoutLogin = ['get-info'];
-	
-	//首次进入小程序,通过code获取用户的openid
-	public function actionGetInfo()
-	{
-		$code = Yii::$app->request->get('code', '');
-		if (empty($code)) {
-			util::failInfo('没有CODE信息');
-		}
-		$merchant = $this->merchant;
-		$account = $this->merchantId;
-		$appId = $merchant['miniAppId'];
-		$appSecret = $merchant['miniAppSecret'];
-		$url = "https://api.weixin.qq.com/sns/jscode2session?appid={$appId}&secret={$appSecret}&js_code={$code}&grant_type=authorization_code";
-		
-		$curl = new curl\Curl();
-		$result = $curl->get($url);
-		$arr = Json::decode($result);
-		$sessionKey = isset($arr['session_key']) ? $arr['session_key'] : '';
-		$openid = isset($arr['openid']) ? $arr['openid'] : '';
-		//用户来源
-		$userSource = UserService::$userSourceId['mini']['name'];
-		$user = UserService::getByMiniOpenId($openid, $account);
-		if (empty($user)) {
-			$userInfo = ['miniOpenId' => $openid, 'merchantId' => $account];
-			$user = UserService::replaceUser($userInfo, $userSource, $account);
-		}
-		
-		$cacheKey = 'sessionKey_' . $openid;
-		Yii::$app->redis->executeCommand('SET', [$cacheKey, $sessionKey]);
-		
-		$userId = $user['id'];
-		
-		$asset = UserAssetService::getByUserId($userId);
-		
-		//敏感信息不输出
-		unset($user['password']);
-		unset($user['payPassword']);
-		unset($user['openId']);
-		unset($user['miniOpenId']);
-		unset($user['unionId']);
-		unset($user['alipayId']);
-		
-		$merchantExtend = xhMerchantExtendService::getByMerchantId($account);
-		$memberIntegral = xhMerchantExtendService::getGradeList($merchantExtend, 'desc');
-		$level = $asset['memberLevel'];
-		$memberLevelName = '普通会员';
-		if (!empty($level)) {
-			$memberLevelName = $level . "级会员";
-		}
-		$discountName = '';
-		if (isset($memberIntegral[$level]['discount'])) {
-			$currentDiscount = $memberIntegral[$level]['discount'];
-			$discountName = '享' . $currentDiscount . '折优惠';
-		}
-		$asset['memberLevelName'] = $memberLevelName;
-		$asset['discountName'] = $discountName;
-		
-		//token对应的就是userId
-		$token = 'SID_MINI_' . $account . '_' . $userId . '_' . date("mdHis") . '_' . stringUtil::charsShuffle(8);
-		Yii::$app->redis->executeCommand('SET', [$token, $userId]);
-		Yii::$app->redis->executeCommand('EXPIRE', [$token, 30 * 86400]);//过期
-		
-		$return = ['user' => $user, 'token' => $token, 'userAsset' => $asset, 'merchant' => $this->merchant];
-		util::sendJson($return);
-	}
-	
-	//获取用户信息 shish 2019.7.25
-	public function actionGetUserInfo()
-	{
-		$asset = UserAssetService::getByUserId($this->userId);
-		$asset['discountShow'] = $asset['discount'] == 100 ? 0 : str_replace('0', '', $asset['discount']);
-		util::sendJson(['user' => $this->userInfo, 'userAsset' => $asset]);
-	}
-	
-	//授权获取用户完整信息 shish 2019.7.25
-	public function actionGetFullInfo()
-	{
-		$post = Yii::$app->request->post();
-		$iv = $post['iv'];
-		$encryptedData = $post['encryptedData'];
-		$appId = $this->merchant['miniAppId'];
-		$merchantId = $this->merchantId;
-		$miniOpenId = $this->userInfo['miniOpenId'];
-		if (empty($miniOpenId)) {
-			util::failInfo('mini_open_id empty');
-		}
-		$cacheKey = 'sessionKey_' . $miniOpenId;
-		$sessionKey = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
-		$weixinMiniSecret = Yii::getAlias("@vendor/weixinMiniSecret");
-		require_once($weixinMiniSecret . '/wxBizDataCrypt.php');
-		$pc = new \WXBizDataCrypt($appId, $sessionKey);
-		$errCode = $pc->decryptData($encryptedData, $iv, $result);
-		if ($errCode != 0) {
-			Yii::info($result . ' ' . $errCode);
-			util::failInfo('获取用户信息失败');
-		}
-		Yii::info('小程序获取用户信息:' . $result);
-		$originalInfo = Json::decode($result);
-		$source = UserService::$userSourceId['mini']['name'];
-		$user = UserService::replaceUser($originalInfo, $source, $merchantId);
-		
-		unset($user['password']);
-		unset($user['payPassword']);
-		unset($user['openId']);
-		unset($user['miniOpenId']);
-		unset($user['unionId']);
-		unset($user['alipayId']);
-		
-		$userId = $user['id'];
-		$asset = UserAssetService::getByUserId($userId);
-		
-		//更新下访问时间
-		UserService::updateById($userId, ['visitTime' => time()]);
-		
-		$merchantExtend = xhMerchantExtendService::getByMerchantId($merchantId);
-		$memberIntegral = xhMerchantExtendService::getGradeList($merchantExtend, 'desc');
-		$level = $asset['memberLevel'];
-		$memberLevelName = '普通会员';
-		if (!empty($level)) {
-			$memberLevelName = $level . "级会员";
-		}
-		$discountName = '';
-		if (isset($memberIntegral[$level]['discount'])) {
-			$currentDiscount = $memberIntegral[$level]['discount'];
-			$discountName = '享' . $currentDiscount . '折优惠';
-		}
-		$asset['memberLevelName'] = $memberLevelName;
-		$asset['discountName'] = $discountName;
-		
-		util::successInfo('操作成功', 'A0001', ['user' => $user, 'userAsset' => $asset]);
-	}
-	
-	public function actionGetMobile()
-	{
-		$post = Yii::$app->request->post();
-		$iv = $post['iv'];
-		$encryptedData = $post['encryptedData'];
-		$merchantId = $this->merchantId;
-		
-		$merchant = $this->merchant;
-		$appId = $merchant['miniAppId'];
-		$miniOpenId = $this->userInfo['miniOpenId'];
-		$user = $this->userInfo;
-		if (!empty($user) && !empty($user['mobile'])) {
-			$userId = $user['id'];
-			UserService::updateById($userId, ['isMember' => 1]);
-			UserAssetService::updateByUserId($userId, ['isMember' => 1]);
-			util::successInfo('操作成功', 'A0001', ['mobile' => $user['mobile']]);
-		}
-		$cacheKey = 'sessionKey_' . $miniOpenId;
-		$sessionKey = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
-		if (empty($sessionKey)) {
-			util::failInfo('sesstion key empty');
-		}
-		$weixinMiniSecret = Yii::getAlias("@vendor/weixinMiniSecret");
-		require_once($weixinMiniSecret . '/wxBizDataCrypt.php');
-		
-		$pc = new \WXBizDataCrypt($appId, $sessionKey);
-		$errCode = $pc->decryptData($encryptedData, $iv, $result);
-		if ($errCode != 0) {
-			util::failInfo();
-		}
-		$arr = Json::decode($result);
-		$mobile = isset($arr['purePhoneNumber']) ? $arr['purePhoneNumber'] : '';
-		$userId = $user['id'];
-		/**升级成为会员**/
-		UserService::upgradeToMember($userId, $merchantId, ['mobile' => $mobile]);
-		$user = UserService::getById($userId);
-		util::successInfo('操作成功', 'A0001', ['mobile' => $mobile, 'user' => $user]);
-	}
-	
-}

+ 0 - 15
app/mini/controllers/UserInfoController.php

@@ -1,15 +0,0 @@
-<?php
-
-namespace mini\controllers;
-
-use biz\user\services\UserAssetService;
-use common\components\util;
-use Yii;
-use yii\helpers\Json;
-
-class UserInfoController extends BaseController
-{
-	
-	public $enableCsrfValidation = false;
-	
-}

+ 0 - 1
app/mini/web/Toa2JJkst2.txt

@@ -1 +0,0 @@
-b4cf556236964ae1129846b67e41c36a

BIN
app/mini/web/favicon.ico


+ 0 - 18
app/mini/web/index-test.php

@@ -1,18 +0,0 @@
-<?php
-
-// NOTE: Make sure this file is not accessible when deployed to production
-if (!in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1'])) {
-    die('You are not allowed to access this file.');
-}
-
-defined('YII_DEBUG') or define('YII_DEBUG', true);
-defined('YII_ENV') or define('YII_ENV', 'test');
-
-require(__DIR__ . '/../../vendor/autoload.php');
-require(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php');
-require(__DIR__ . '/../../common/config/bootstrap.php');
-require(__DIR__ . '/../config/bootstrap.php');
-
-$config = require(__DIR__ . '/../../tests/codeception/config/mini/acceptance.php');
-
-(new yii\web\Application($config))->run();

+ 0 - 19
app/mini/web/index.php

@@ -1,19 +0,0 @@
-<?php
-
-require(__DIR__ . '/../../../vendor/autoload.php');
-
-require(__DIR__ . '/../../../env.php');// Environment
-
-require(__DIR__ . '/../../../vendor/yiisoft/yii2/Yii.php');
-require(__DIR__ . '/../../../common/config/bootstrap.php');
-require(__DIR__ . '/../config/bootstrap.php');
-
-$config = yii\helpers\ArrayHelper::merge(
-    require(__DIR__ . '/../../../common/config/main.php'),
-    require(__DIR__ . '/../../../common/config/main-local.php'),
-    require(__DIR__ . '/../config/main.php'),
-    require(__DIR__ . '/../config/main-local.php')
-);
-
-$application = new yii\web\Application($config);
-$application->run();

+ 0 - 0
app/mini/web/robots.txt


+ 0 - 1
common/config/bootstrap.php

@@ -7,6 +7,5 @@ Yii::setAlias('@open', dirname(dirname(__DIR__)) . '/app/open');
 Yii::setAlias('@saas', dirname(dirname(__DIR__)) . '/app/saas');
 Yii::setAlias('@teach', dirname(dirname(__DIR__)) . '/app/teach');
 Yii::setAlias('@whole', dirname(dirname(__DIR__)) . '/app/whole');
-Yii::setAlias('@mini', dirname(dirname(__DIR__)) . '/app/mini');
 Yii::setAlias('@api', dirname(dirname(__DIR__)) . '/app/api');
 Yii::setAlias('@biz', dirname(dirname(__DIR__)) . '/biz');