|
|
@@ -25,11 +25,32 @@ use common\services\xhInitService;
|
|
|
class InitController extends Controller
|
|
|
{
|
|
|
|
|
|
+ //首次开店初始化 shish 2020.1.19
|
|
|
+ public function actionFirstInit()
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ //二次初始化 shish 2020.1.19
|
|
|
+ public function actionSecondInit()
|
|
|
+ {
|
|
|
+ $id = Yii::$app->request->get('id');
|
|
|
+ if (empty($id)) {
|
|
|
+ echo "商家ID无效\n";
|
|
|
+ }
|
|
|
+ $merchant = xhMerchantService::getById($id);
|
|
|
+ if (empty($merchant)) {
|
|
|
+ echo "商家无效\n";
|
|
|
+ }
|
|
|
+ //初始化微信菜单
|
|
|
+ xhWxMenuService::applyInit($merchant);
|
|
|
+ }
|
|
|
+
|
|
|
public function actionChangeDb()
|
|
|
{
|
|
|
echo 'ok';
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//接入一个商家需要的操作 shish 2019.9.7 yii init/join-one
|
|
|
public function actionJoinOne()
|
|
|
{
|
|
|
@@ -41,18 +62,18 @@ class InitController extends Controller
|
|
|
$r = xhTMessageService::supplement($merchant);
|
|
|
print_r($r);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//yii init/sub
|
|
|
public function actionSub()
|
|
|
{
|
|
|
$name = 'redis_shi';
|
|
|
$redisPubSub = \Yii::$app->redisPubSub;
|
|
|
$redisPubSub->setOptReadTimeout(-1);
|
|
|
- $redisPubSub->subscribe($name, function($instance, $channelName, $message) {
|
|
|
+ $redisPubSub->subscribe($name, function ($instance, $channelName, $message) {
|
|
|
$a = 123;
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public function actionPub()
|
|
|
{
|
|
|
$name = 'redis_shi';
|
|
|
@@ -63,94 +84,94 @@ class InitController extends Controller
|
|
|
|
|
|
public function actionBegin()
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
//先清除公众号里的模板消息!!!!!!!
|
|
|
-
|
|
|
+
|
|
|
$num = 0;
|
|
|
-
|
|
|
+
|
|
|
//清空数据
|
|
|
$this->actionFlushAll();
|
|
|
|
|
|
//国兰花尚
|
|
|
- if($num == 0){
|
|
|
- xhAdminService::updateById(1,['mobile'=>'18030142050','password'=>'6a348767a0b612172e5da7539de20cb5','confirmPassword' => 'c80fd29375a3a91d3681d8445822248a','adminName'=>'姜祖岚']);
|
|
|
+ if ($num == 0) {
|
|
|
+ xhAdminService::updateById(1, ['mobile' => '18030142050', 'password' => '6a348767a0b612172e5da7539de20cb5', 'confirmPassword' => 'c80fd29375a3a91d3681d8445822248a', 'adminName' => '姜祖岚']);
|
|
|
xhMerchantService::updateById(12358, [
|
|
|
- 'merchantName'=>'国兰花尚',
|
|
|
- 'miniAppId'=>'wxe994a9f5fd036f69',
|
|
|
- 'miniAppSecret'=>'53b646675251e940f56bd304c2dba480',
|
|
|
- 'wxAppId'=>'wx193341a4a80f6ea3',
|
|
|
- 'wxUserName'=>'gh_090c30df22e6',
|
|
|
- 'wxAliasName'=>'glhs520',
|
|
|
- 'openAppId'=>'wxe9211595a1d5a39f',
|
|
|
+ 'merchantName' => '国兰花尚',
|
|
|
+ 'miniAppId' => 'wxe994a9f5fd036f69',
|
|
|
+ 'miniAppSecret' => '53b646675251e940f56bd304c2dba480',
|
|
|
+ 'wxAppId' => 'wx193341a4a80f6ea3',
|
|
|
+ 'wxUserName' => 'gh_090c30df22e6',
|
|
|
+ 'wxAliasName' => 'glhs520',
|
|
|
+ 'openAppId' => 'wxe9211595a1d5a39f',
|
|
|
'wxToken' => 'wt01467284437',
|
|
|
- 'status' =>1,
|
|
|
+ 'status' => 1,
|
|
|
]);
|
|
|
- xhMerchantExtendService::updateByMerchantId(12358,[
|
|
|
- 'wxAppId'=>'wx193341a4a80f6ea3',
|
|
|
+ xhMerchantExtendService::updateByMerchantId(12358, [
|
|
|
+ 'wxAppId' => 'wx193341a4a80f6ea3',
|
|
|
'miniAppId' => 'wxe994a9f5fd036f69',
|
|
|
- 'wxPayMerchantId'=>'1244548702',
|
|
|
- 'wxPayKey'=>'eez23jf739jsmm4309j10jnza3qw8dwm',
|
|
|
- 'webTitle'=>'国兰花尚',
|
|
|
- 'webKeyword'=>'国兰花尚',
|
|
|
- 'webDescription'=>'国兰花尚',
|
|
|
- 'alipayAccount'=>'18030142050',
|
|
|
- 'alipayAccountName'=>'游俊涛',
|
|
|
+ 'wxPayMerchantId' => '1244548702',
|
|
|
+ 'wxPayKey' => 'eez23jf739jsmm4309j10jnza3qw8dwm',
|
|
|
+ 'webTitle' => '国兰花尚',
|
|
|
+ 'webKeyword' => '国兰花尚',
|
|
|
+ 'webDescription' => '国兰花尚',
|
|
|
+ 'alipayAccount' => '18030142050',
|
|
|
+ 'alipayAccountName' => '游俊涛',
|
|
|
]);
|
|
|
}
|
|
|
//花美灵
|
|
|
- if($num == 1){
|
|
|
- xhAdminService::updateById(1,['mobile'=>'15280215347','password'=>'6a348767a0b612172e5da7539de20cb5','confirmPassword'=>'6a348767a0b612172e5da7539de20cb5','adminName'=>'石少华']);
|
|
|
+ if ($num == 1) {
|
|
|
+ xhAdminService::updateById(1, ['mobile' => '15280215347', 'password' => '6a348767a0b612172e5da7539de20cb5', 'confirmPassword' => '6a348767a0b612172e5da7539de20cb5', 'adminName' => '石少华']);
|
|
|
xhMerchantService::updateById(12358, [
|
|
|
- 'merchantName'=>'花美灵',
|
|
|
- 'miniAppId'=>'wxe4675bab299a52f7',
|
|
|
- 'miniAppSecret'=>'03dd4000a26af5c17fb86321b7d1ebf3',
|
|
|
- 'wxAppId'=>'wx84d95afcb7b594eb',
|
|
|
- 'wxUserName'=>'gh_090c30df22e6',
|
|
|
- 'wxAliasName'=>'glhs520',
|
|
|
+ 'merchantName' => '花美灵',
|
|
|
+ 'miniAppId' => 'wxe4675bab299a52f7',
|
|
|
+ 'miniAppSecret' => '03dd4000a26af5c17fb86321b7d1ebf3',
|
|
|
+ 'wxAppId' => 'wx84d95afcb7b594eb',
|
|
|
+ 'wxUserName' => 'gh_090c30df22e6',
|
|
|
+ 'wxAliasName' => 'glhs520',
|
|
|
'wxToken' => 'wt01467284437',
|
|
|
- 'openAppId'=>'wxb46e972ab18f27bb',
|
|
|
- 'status' =>1,
|
|
|
- ]);
|
|
|
- xhMerchantExtendService::updateByMerchantId(12358,[
|
|
|
- 'wxAppId'=>'wx84d95afcb7b594eb',
|
|
|
+ 'openAppId' => 'wxb46e972ab18f27bb',
|
|
|
+ 'status' => 1,
|
|
|
+ ]);
|
|
|
+ xhMerchantExtendService::updateByMerchantId(12358, [
|
|
|
+ 'wxAppId' => 'wx84d95afcb7b594eb',
|
|
|
'miniAppId' => 'wxe4675bab299a52f7',
|
|
|
- 'wxPayMerchantId'=>'1371367002',
|
|
|
- 'wxPayKey'=>'eoz23aG739jscv4309275jnza32wvdwm',
|
|
|
- 'webTitle'=>'花美灵',
|
|
|
- 'webKeyword'=>'花美灵',
|
|
|
- 'webDescription'=>'花美灵',
|
|
|
- 'alipayAccount'=>'shishaohua8879@sina.com',
|
|
|
- 'alipayAccountName'=>'石少华',
|
|
|
+ 'wxPayMerchantId' => '1371367002',
|
|
|
+ 'wxPayKey' => 'eoz23aG739jscv4309275jnza32wvdwm',
|
|
|
+ 'webTitle' => '花美灵',
|
|
|
+ 'webKeyword' => '花美灵',
|
|
|
+ 'webDescription' => '花美灵',
|
|
|
+ 'alipayAccount' => 'shishaohua8879@sina.com',
|
|
|
+ 'alipayAccountName' => '石少华',
|
|
|
]);
|
|
|
}
|
|
|
//花卉宝
|
|
|
- if($num == 2){
|
|
|
- xhAdminService::updateById(1,['mobile'=>'15280215347','password'=>'6a348767a0b612172e5da7539de20cb5','confirmPassword'=>'6a348767a0b612172e5da7539de20cb5','adminName'=>'石少华']);
|
|
|
+ if ($num == 2) {
|
|
|
+ xhAdminService::updateById(1, ['mobile' => '15280215347', 'password' => '6a348767a0b612172e5da7539de20cb5', 'confirmPassword' => '6a348767a0b612172e5da7539de20cb5', 'adminName' => '石少华']);
|
|
|
xhMerchantService::updateById(12358, [
|
|
|
- 'merchantName'=>'花卉宝',
|
|
|
- 'miniAppId'=>'',
|
|
|
- 'miniAppSecret'=>'',
|
|
|
- 'wxAppId'=>'wx66dd83ff8744f7a8',
|
|
|
- 'wxUserName'=>'gh_a9105e0f02b9',
|
|
|
- 'wxAliasName'=>'ihuahuibao',
|
|
|
+ 'merchantName' => '花卉宝',
|
|
|
+ 'miniAppId' => '',
|
|
|
+ 'miniAppSecret' => '',
|
|
|
+ 'wxAppId' => 'wx66dd83ff8744f7a8',
|
|
|
+ 'wxUserName' => 'gh_a9105e0f02b9',
|
|
|
+ 'wxAliasName' => 'ihuahuibao',
|
|
|
'wxToken' => 'wt01467284437',
|
|
|
- 'status' =>1,
|
|
|
+ 'status' => 1,
|
|
|
]);
|
|
|
- xhMerchantExtendService::updateByMerchantId(12358,[
|
|
|
- 'wxAppId'=>'wx66dd83ff8744f7a8',
|
|
|
+ xhMerchantExtendService::updateByMerchantId(12358, [
|
|
|
+ 'wxAppId' => 'wx66dd83ff8744f7a8',
|
|
|
'miniAppId' => '',
|
|
|
- 'wxPayMerchantId'=>'1442448402',
|
|
|
- 'wxPayKey'=>'xxe29ax639jvcv4m082a1jnza32svdd0',
|
|
|
- 'webTitle'=>'花卉宝',
|
|
|
- 'webKeyword'=>'花卉宝',
|
|
|
- 'webDescription'=>'花卉宝',
|
|
|
- 'alipayAccount'=>'shishaohua8879@sina.com',
|
|
|
- 'alipayAccountName'=>'石少华',
|
|
|
+ 'wxPayMerchantId' => '1442448402',
|
|
|
+ 'wxPayKey' => 'xxe29ax639jvcv4m082a1jnza32svdd0',
|
|
|
+ 'webTitle' => '花卉宝',
|
|
|
+ 'webKeyword' => '花卉宝',
|
|
|
+ 'webDescription' => '花卉宝',
|
|
|
+ 'alipayAccount' => 'shishaohua8879@sina.com',
|
|
|
+ 'alipayAccountName' => '石少华',
|
|
|
]);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public function actionLast()
|
|
|
{
|
|
|
//拉取用户
|
|
|
@@ -158,7 +179,7 @@ class InitController extends Controller
|
|
|
//生成模板消息
|
|
|
//$this->actionTMSupplement();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public function actionFlushAll()
|
|
|
{
|
|
|
$sql = "TRUNCATE xhDrawCash;
|
|
|
@@ -213,7 +234,7 @@ TRUNCATE xhUserByDay;";
|
|
|
$total = isset($return['data']['total']) ? $return['data']['total'] : 0;
|
|
|
xhMerchantAssetService::updateByMerchantId($merchantId, ['totalFans' => $total]);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 开放平台初始化
|
|
|
* yii init/open hhb
|
|
|
@@ -247,7 +268,7 @@ TRUNCATE xhUserByDay;";
|
|
|
xhTMessageService::supplement($merchant);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 初始化 花卉宝 的行政区划
|
|
|
*/
|
|
|
@@ -320,7 +341,7 @@ TRUNCATE xhUserByDay;";
|
|
|
|
|
|
public function actionImport()
|
|
|
{
|
|
|
-$str = '13947241000 0 1012
|
|
|
+ $str = '13947241000 0 1012
|
|
|
18050645581 500.85 10000
|
|
|
15710626721 645.00 2000 秋妹
|
|
|
13959203009 104.00 5000 王小姐
|
|
|
@@ -870,25 +891,25 @@ $str = '13947241000 0 1012
|
|
|
|
|
|
$str = trim($str);
|
|
|
$arr = explode('
|
|
|
-',$str);
|
|
|
- if(!empty($arr)){
|
|
|
-
|
|
|
+', $str);
|
|
|
+ if (!empty($arr)) {
|
|
|
+
|
|
|
$sql = "TRUNCATE xhUserOldData";
|
|
|
Yii::$app->db->createCommand($sql)->execute();
|
|
|
-
|
|
|
- foreach($arr as $item){
|
|
|
- $it = explode(' ',$item);
|
|
|
+
|
|
|
+ foreach ($arr as $item) {
|
|
|
+ $it = explode(' ', $item);
|
|
|
$mobile = $it[0];
|
|
|
$amount = $it[1];
|
|
|
$integral = $it[2];
|
|
|
$name = '';
|
|
|
- if(isset($it[3]) && !empty($it[3])){
|
|
|
+ if (isset($it[3]) && !empty($it[3])) {
|
|
|
$name = $it[3];
|
|
|
}
|
|
|
- if(isset($it[4]) && !empty($it[4])){
|
|
|
+ if (isset($it[4]) && !empty($it[4])) {
|
|
|
$name = $it[4];
|
|
|
}
|
|
|
- UserOldDataService::add(['merchantId'=>12358,'mobile'=>$mobile,'userName'=>$name,'integral'=>$integral,'balance'=>$amount,'status'=>0,'createTime'=>date("Y-m-d H:i:s")]);
|
|
|
+ UserOldDataService::add(['merchantId' => 12358, 'mobile' => $mobile, 'userName' => $name, 'integral' => $integral, 'balance' => $amount, 'status' => 0, 'createTime' => date("Y-m-d H:i:s")]);
|
|
|
}
|
|
|
}
|
|
|
}
|