ソースを参照

Merge branch 'free_share' of iqiyoo:zhuishuyun_wap into free_share

onlinetest 6 年 前
コミット
c1e0f94169

+ 8 - 5
app/Http/Controllers/Wap/Book/ChapterController.php

@@ -526,15 +526,15 @@ class ChapterController extends BaseController
                 $my_log->info('ad-----in--------------------');
             }
             //广告解锁2张
-            if($this->chapter->next_cid){
+            /*if($this->chapter->next_cid){
                 $next_chapter  = ChapterService::getChapterNameById($this->chapter->next_cid, $bid);
                 if($next_chapter){
                     $next_chapter_name = $next_chapter->name;
                     $this->bookOrderOrChapterOrder($book_info, $this->chapter->next_cid, 0, $next_chapter_name, 1);
                     AdVisitStatService::create($this->uid,$this->book_info->bid,$this->chapter->next_cid,'UNLOCK_2');
                 }
-            }
-            $this->chapter->is_show_ad = 0;
+            }*/
+            //$this->chapter->is_show_ad = 0;
             $this->bookOrderOrChapterOrder($book_info, $cid, 0, $chapter->name, 1);
             return response()->item(new ChapterTransformer, $this->chapter);
         }
@@ -1748,12 +1748,15 @@ class ChapterController extends BaseController
 
     //用户是否在广告样本中
     private function isUserInAdSample(){
-        $res = DataAnalysisSelectUserService::getByUidAndType($this->uid,'AD_V2');
+        /*$res = DataAnalysisSelectUserService::getByUidAndType($this->uid,'AD_V2');
         if($res){
             return true;
         }else{
             return false;
-        }
+        }*/
+        $is_ad_user = Cookie::get('cpc_ad_status');
+        if($is_ad_user && $is_ad_user == 'show') return true;
+        return false;
     }
     //阅读页面底部是否显示广告
     private function isShowAd(){

+ 14 - 8
app/Http/Controllers/Wap/Oauth/UsersV2Controller.php

@@ -175,14 +175,20 @@ class UsersV2Controller extends Controller
     }
 
     private function createUser($openid,$unionid,$distribution_channel_id,$send_order_id,$ip){
-        $user =  UserService::addUser(
-            ['openid' => $openid,
-                'unionid' => $unionid,
-                'distribution_channel_id' =>$distribution_channel_id,
-                'send_order_id'=>$send_order_id,
-                'is_new'=>1,
-                'register_ip'=>$ip
-            ]);
+        $user = null;
+        try{
+            $user =  UserService::addUser(
+                ['openid' => $openid,
+                    'unionid' => $unionid,
+                    'distribution_channel_id' =>$distribution_channel_id,
+                    'send_order_id'=>$send_order_id,
+                    'is_new'=>1,
+                    'register_ip'=>$ip
+                ]);
+        }catch (\Exception $e){
+            myLog('user-error')->info($e);
+        }
+
         // 注册动作
         $action_type = 'Register';
         $param = [

+ 15 - 9
app/Http/Controllers/Wap/Order/OrdersController.php

@@ -260,7 +260,7 @@ class OrdersController extends BaseController
         /*if( ($comparev2_id = $this->templateCompareV2()) ){
             $template_id = $comparev2_id;
         }*/
-        $this->outstandingYearOrder($this->uid);
+        $outstandingYearOrder = $this->outstandingYearOrder($this->uid);
         \Log::info('recordFirstIntoPayPage:$template_id:' . $template_id);
         $res = ProductService::getChargeProduct($template_id);
         if (!$res) {
@@ -338,7 +338,7 @@ class OrdersController extends BaseController
                     'is_year_order' => 1,
                     'text' => $text,
                     'first_charge' => false,
-                    'today_special' => false,
+                    'today_special' => $outstandingYearOrder,
                     'save_text' => $save_text,
                     'product_id' => $v->id,
                     'show_free_ads' => $appad
@@ -361,7 +361,7 @@ class OrdersController extends BaseController
                     'is_year_order' => 0,
                     'text' => $text,
                     'first_charge' => false,
-                    'today_special' => $v->is_default == 1 ? true : false,
+                    'today_special' => ($v->is_default == 1 && $outstandingYearOrder == false) ? true : false,
                     'save_text' => $save_text,
                     'product_id' => $v->id,
                     'show_free_ads' => $appad
@@ -779,27 +779,33 @@ class OrdersController extends BaseController
     private function outstandingYearOrder($uid)
     {
         if (!in_array($this->distribution_channel_id, explode(',', env('OUTSTANDING_YEAR_ORDER_SITE')))) {
-            return '';
+            return false;
         }
-        $exist = DataAnalysisSelectUserService::getByUidAndType($uid, 'OUTSTANDING_YEAR_ORDER');
-        if($exist) return  '';
+
         $userDivisionProperty = UserDivisionPropertyService::getUserProperty($uid);
-        if (!$userDivisionProperty) return '';
+        if (!$userDivisionProperty) return false;
 
-        if ($userDivisionProperty != 'high') return '';
+        if ($userDivisionProperty != 'high') return false;
 
         if ($uid % 2 == 0) {
+            $is_show_outstanding_year_order = true;
             $template_id = 1;
         } else {
+            $is_show_outstanding_year_order = false;
             $template_id = 2;
         }
 
+        $exist = DataAnalysisSelectUserService::getByUidAndType($uid, 'OUTSTANDING_YEAR_ORDER');
+        if($exist) return  $is_show_outstanding_year_order;
+
+
+
         DataAnalysisSelectUserService::create(
             $uid,
             $this->distribution_channel_id,
             'OUTSTANDING_YEAR_ORDER',
             -1, $template_id);
-        return '';
+        return $is_show_outstanding_year_order;
     }
 
     public function exchangeList(){

+ 6 - 1
app/Http/Controllers/Wap/Subscribe/LinkSubscribeController.php

@@ -126,7 +126,12 @@ class LinkSubscribeController extends Controller
 
     private function appad($uid, $distribution_channel_id)
     {
-        if (!in_array($distribution_channel_id, explode(',', env('ADS_OPEN_SITE')))) {
+        $ads_open_site = env('ADS_OPEN_SITE','');
+        if($ads_open_site == 'all'){
+            return UserService::isCpcUser($uid);
+        }
+
+        if (!in_array($distribution_channel_id, explode(',', $ads_open_site))) {
             return false;
         }
         return UserService::isCpcUser($uid);

+ 34 - 0
app/Http/Controllers/Wap/User/CoflController.php

@@ -6,6 +6,8 @@ use App\Modules\Activity\Services\ActivityService;
 use App\Modules\Book\Services\BookConfigService;
 use App\Modules\User\Models\User;
 use App\Modules\User\Services\ReadRecordService;
+use App\Modules\User\Services\UserBindHkWelfareService;
+use App\Modules\User\Services\UserService;
 use Illuminate\Http\Request;
 use App\Http\Controllers\Controller;
 use Hashids;
@@ -63,6 +65,38 @@ class CoflController extends Controller
         return redirect()->to($url);
     }
 
+    public function freeCurrencyView(Request $request){
+        $openid = $request->get('openid');
+        //授权
+        $params = $request->except('_url');
+        if(empty($openid)){
+            //$url = str_replace('http://', env('PROTOCOL') . '://', url()->current() . '?' . http_build_query($params));
+            $url = url()->current() . '?' . http_build_query($params);
+            $params['redirect_url'] = urlencode($url);
+            $app = new Application($this->auth($params));
+            return $app->oauth->redirect();
+        }
+
+        $user = $this->getUsers($openid);
+        if(!$user || !$user[0] || !$user[1]) return redirect()->to($this->getLink());
+        $get_free_currency = UserBindHkWelfareService::isHasGet($user[0]);
+        if($get_free_currency){
+            //已经领过
+            return view('jump.bindHkFreeCurrency',['url'=>$this->getLink($get_free_currency->distribution_channel_id),'is_get'=>1,'uid'=>$get_free_currency->uid]);
+        }else{
+            return view('jump.bindHkFreeCurrency',['url'=>$this->getLink($user[1]),'is_get'=>0,'uid'=>$user[0]]);
+        }
+    }
+
+    public function freeCurrencyPost(Request $request){
+        $uid = $request->post('uid');
+        $result = UserBindHkWelfareService::getfreeCurrency($uid);
+        if($result){
+            UserService::addBalance($uid,200,0,200);
+        }
+        return response()->success(['uid'=>$uid,'result'=>$result]);
+    }
+
     public function activity(Request $request){
         $token = $request->get('token');
         if(empty($token)){

+ 4 - 4
app/Http/Middleware/ReadOauth.php

@@ -122,9 +122,9 @@ class ReadOauth
             $back = $request->get('back', '');
             if ($openid && $appid && $distribution_channel_id && $uid_cookie) {
                 $this->apidAndOpenId($distribution_channel_id, $appid, $openid, $uid_cookie, $uri_send_order_id);
-                $channel = ChannelService::getById($distribution_channel_id);
-                $is_yq_move = $this->isQyMove($channel, $distribution_channel_id);
-                if ($is_yq_move) {
+                //$channel = ChannelService::getById($distribution_channel_id);
+                //$is_yq_move = $this->isQyMove($channel, $distribution_channel_id);
+                /*if ($is_yq_move) {
                     $move_user = YqMove::where('zsy_uid', $uid_cookie)->select('zsy_uid')->first();
                     if (!$move_user) {
                         if (!$back) {
@@ -141,7 +141,7 @@ class ReadOauth
                         }
                         $this->moveUserFromYq($distribution_channel_id, $appid, $openid, $uid_cookie);
                     }
-                }
+                }*/
             }
         }
         /*//云栖测试

+ 2 - 2
app/Http/Routes/Wap/WapRoutes.php

@@ -42,14 +42,14 @@ Route::group(['domain'=>env('share_domain'),'namespace'=>'App\Http\Controllers\W
 Route::group(['domain'=>env('FRIEND_LINK_DOMAIN'),'namespace'=>'App\Http\Controllers\Wap'],function(){
     Route::get('friendlink','User\CoflController@index');
     Route::get('friendactivitylink','User\CoflController@activity');
+    Route::get('freecurrency','User\CoflController@freeCurrencyView');
+    Route::post('freecurrency','User\CoflController@freeCurrencyPost');
 });
 
 Route::group(['domain'=>env('WAP_DOMAIN'),'namespace'=>'App\Http\Controllers\Wap','middleware'=>'EnableCross'],function(){
 
     Route::any('help','Web\RedirectController@help');
 
-    Route::any('friendlink','User\CoflController@index');
-
     Route::any('testLogin','Web\RedirectController@testLogin');
     Route::get('mmdggce','User\UserController@setOrderDelCookie');
 

+ 38 - 2
app/Libs/Helpers.php

@@ -493,7 +493,6 @@ function specialChannelAuthInfo(){
         '928'=>'wx76da3531773c1f39',
         '157'=>'wx5ebe6187c0fb0bd5',
         '4175'=>'wx64cf3051ceb145ae',
-        '4217'=>'wxdb15f8db194bf6f4',
         '4604'=>'wxc177995c55b5e75e'
     ];
 }
@@ -548,6 +547,43 @@ function specialChannelAuthInfoV2(){
         '5430'=>'wx956fd17a5d81c122',
         '5444'=>'wx3f11071d2c51fe3c',
         '5464'=>'wxe06f1e737730cda8',
-        '5225'=>'wx25d970a3f95ebebe'
+        '5225'=>'wx25d970a3f95ebebe',
+        '4217'=>'wxdb15f8db194bf6f4',
+        '5617'=>'wx94e7c0d2e805ba5e',
+        '527'=>'wxbfa2ba3dccf76921',
+        '5623'=>'wxe6fa23bd8c26e4a1',
+        '5644'=>'wx379246ab67f5ba9b',
+        '5645'=>'wx6723f21df29e0eb1',
+        '5646'=>'wx28ab08db5717a16d',
+        '5647'=>'wx14acfd6563f46ca9',
+        '5648'=>'wx3d9d9118751b6caf',
+        '5649'=>'wx8b1f11fcc7ba18da',
+        '5650'=>'wx5fa6c4a6aa4bdf2a',
+        '5651'=>'wxe5ab0cc5f3765329',
+        '5652'=>'wx4990a38d72a02577',
+        '5653'=>'wxdc09e7629d529a69',
+        '5654'=>'wx03f0aa164ea3b4d9',
+        '5655'=>'wxd9e763876c55864a',
+        '5656'=>'wxd9816239598d8fdb',
+        '5657'=>'wxb280a352c0a0ed65',
+        '5658'=>'wxd9a6a8b2749717c3',
+        '5660'=>'wx2c252d71dce324cb',
+        '5661'=>'wxcc024129cf943eda',
+        '5631'=>'wxc2282173679eca9f',
+        '5632'=>'wxb6cfac3a8618d758',
+        '5633'=>'wx7e4038e693ff47b8',
+        '5634'=>'wx0521f0de4dfea155',
+        '5635'=>'wx32ab656b849bd3b0',
+        '5636'=>'wx524790df543980f3',
+        '5637'=>'wx52ad84ebd80039fb',
+        '5643'=>'wx72037519796b1531',
+        '5664'=>'wx9265b52a75ebb042',
+        '5638'=>'wx8384f5fb7ab1b19c',
+        '5639'=>'wx7f470f3758928718',
+        '5640'=>'wxc565bc7bc4a42074',
+        '5641'=>'wx7e9d88af5216eedd',
+        '5642'=>'wx4618cda729138d15',
+        '5662'=>'wx44b8626c8ad9247e',
+        '5663'=>'wx8653757301ed2591'
     ];
 }

+ 11 - 0
app/Modules/User/Models/UserBindHkWelfare.php

@@ -0,0 +1,11 @@
+<?php
+
+namespace App\Modules\User\Models;
+
+use Illuminate\Database\Eloquent\Model;
+
+class UserBindHkWelfare extends Model
+{
+    protected $table = 'user_bind_hk_welfare';
+    protected $fillable = ['uid','openid','fee','type'];
+}

+ 40 - 0
app/Modules/User/Services/UserBindHkWelfareService.php

@@ -0,0 +1,40 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: z-yang
+ * Date: 2019/4/11
+ * Time: 15:05
+ */
+
+namespace App\Modules\User\Services;
+
+use App\Modules\User\Models\UserBindHkWelfare;
+
+class UserBindHkWelfareService
+{
+    public static function isHasGet($uid){
+        $result = UserBindHkWelfare::join('users','users.openid','=','user_bind_hk_welfare.openid')
+            ->where('users.id',$uid)
+            ->select('user_bind_hk_welfare.id','user_bind_hk_welfare.fee','users.distribution_channel_id','users.id as uid')
+            ->first();
+        return   $result;
+    }
+
+    public static function getfreeCurrency($uid,$fee=200){
+        if(self::isHasGet($uid)){
+            return false;
+        }
+        $user = UserService::getById($uid);
+        try{
+            UserBindHkWelfare::create([
+                'uid'=>$uid,
+                'openid'=>$user->openid,
+                'fee'=>$fee,
+                'type'=>'BIND_HK'
+            ]);
+            return true;
+        }catch (\Exception $e){}
+
+        return false;
+    }
+}

ファイルの差分が大きいため隠しています
+ 312 - 0
resources/views/jump/bindHkFreeCurrency.blade.php


+ 4 - 4
resources/views/wap/index.blade.php

@@ -9,7 +9,7 @@
     <script>window.VueRouter || document.write('<script src="https://cdn-novel.iycdm.com/static/vue-router.min.js"><\/script>')</script>
     <script>(window.Vue && window.VueLazyload) || document.write('<script src="https://cdn-novel.iycdm.com/static/vue-lazyload.js"><\/script>')</script>
     <title>{{$title}}</title>
-    <link href=https://cdn-novel.iycdm.com/static2019-4-12/css/app.8144ba9b88e3e856981eaa188e919eb5.css rel=stylesheet>
+    <link href=https://cdn-novel.iycdm.com/static2019-4-15/css/app.7b19e66c934ca6cbd2f85b6732d588ba.css rel=stylesheet>
 </head>
 <body>
 <div id=app></div>
@@ -32,8 +32,8 @@
     })();</script>
 <script id=options>window.options = {!! $options!!};</script>
 <script type=text/javascript
-        src=https://cdn-novel.iycdm.com/static2019-4-12/js/manifest.a00651f44f292b84bb23.js></script>
-<script type=text/javascript src=https://cdn-novel.iycdm.com/static2019-4-12/js/vendor.ffff3089fc2f18220e2f.js></script>
-<script type=text/javascript src=https://cdn-novel.iycdm.com/static2019-4-12/js/app.daf4883d65a2bc184bb1.js></script>
+        src=https://cdn-novel.iycdm.com/static2019-4-15/js/manifest.4c20d6254d3db4b6049a.js></script>
+<script type=text/javascript src=https://cdn-novel.iycdm.com/static2019-4-15/js/vendor.ffff3089fc2f18220e2f.js></script>
+<script type=text/javascript src=https://cdn-novel.iycdm.com/static2019-4-15/js/app.00627a040c0e8eafaee4.js></script>
 </body>
 </html>