541469799@qq.com 1 ano atrás
pai
commit
06b1270fe4

+ 14 - 9
app/index/controller/User.php

@@ -93,7 +93,7 @@ class User extends Controller
             $selfTrack[] = ['time' => date('Y-m-d H:i:s', $createTimeInt + 3653), 'text' => 'Orders taken', 'desc' => 'The merchant has received your order and is waiting to be shipped'];
         }
 
-        if ($model['pay_status'] == PayStatus::SUCCESS){
+        if ($model['pay_status'] == PayStatus::SUCCESS) {
             $selfTrack[] = ['time' => date('Y-m-d H:i:s', $createTimeInt + 5), 'text' => 'Order paid', 'desc' => 'Successful'];
         }
 
@@ -159,10 +159,15 @@ class User extends Controller
         $MailCaptchaService = new MailCaptchaService;
         if ($MailCaptchaService->sendText($mailbox, 'From Your Friend', $url)) {
             $shareKeyModel = new ShareKey();
-            $shareKeyModel->save(['key_string' => $encryptUserId, 'user_id' => $userId, 'create_time' => time(), 'is_delete' => 0, 'update_time' => time()]);
+            $shareKeyModel->save(['key_string' => $encryptUserId, 'user_id' => $userId, 'store_id' => $this->storeId, 'create_time' => time(), 'is_delete' => 0, 'update_time' => time()]);
             return $this->renderSuccess([], 'Successful! Tell your friends to check for new emails.');
         }
 
+        if (is_debug()) {
+            $shareKeyModel = new ShareKey();
+            $shareKeyModel->save(['key_string' => $encryptUserId, 'user_id' => $userId, 'store_id' => $this->storeId, 'create_time' => time(), 'is_delete' => 0, 'update_time' => time()]);
+        }
+
         return $this->renderSuccess([], 'Successful! Tell your friends to check for new emails.');
     }
 
@@ -688,7 +693,7 @@ class User extends Controller
         $preg = '/<div\s+class="structItem-title"\s+uix-href="\/threads.+\/">/';
         $matches = [];
         preg_match_all($preg, $f, $matches);
-        if (empty($matches[0])){
+        if (empty($matches[0])) {
             return $this->renderSuccess();
         }
 
@@ -697,7 +702,7 @@ class User extends Controller
         //匹配详情页的里面的链接
         $pregSon = '/<div\s+class="bbWrapper"><a\s+href="http\S+"/';
         $pregSon1 = '/<div\s+class="bbWrapper"><div>\s+<a\s+href="http\S+"/';
-        $posts = array_slice($matches[0],2,3);
+        $posts = array_slice($matches[0], 2, 3);
         //dd($posts);
 
         //$titleStr = 'rel="nofollow ugc noopener">Scoring Endgame | Former CDC Tobacco Control Director Talks Battle Over Vaping | RegWatch</a>';
@@ -727,22 +732,22 @@ class User extends Controller
             //todo
             preg_match($pregSon, $f1, $matches1);
             //dd($matches1);
-            if (empty($matches1)){
+            if (empty($matches1)) {
                 //dd('ooo');
                 preg_match($pregSon1, $f1, $matches1);
                 //dd($matches1);
-                if (empty($matches1)){
+                if (empty($matches1)) {
                     continue;
                 }
             }
             //文章详情的原始链接
             $postDetailOriginal = $matches1[0];
 
-            $ps3 = strpos($postDetailOriginal,'f',0);
-            if ($ps3 === false){
+            $ps3 = strpos($postDetailOriginal, 'f', 0);
+            if ($ps3 === false) {
                 continue;
             }
-            $postDetailOriginal = substr($postDetailOriginal,$ps3 + 3,-1);
+            $postDetailOriginal = substr($postDetailOriginal, $ps3 + 3, -1);
             //dd($postDetailOriginal);
 
             //文章的标题

+ 1 - 0
public/install/data/install_struct.sql

@@ -973,6 +973,7 @@ CREATE TABLE `yoshop_share_key` (
  `key_string` varchar(255) NOT NULL DEFAULT '' COMMENT '分享链接key',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户ID',
  `is_delete` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '是否删除',
+ `store_id` int unsigned NOT NULL DEFAULT '0' COMMENT '商城ID',
  `create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  `update_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`key_id`)