Jelajahi Sumber

Merge branch 'master' of iqiyoo:zhuishuyun_wap

onlinetest 6 tahun lalu
induk
melakukan
1f46b12537

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

@@ -2,7 +2,6 @@
 
 namespace App\Http\Controllers\Wap\Book;
 
-use App\Console\Commands\YqBook;
 use App\Modules\Book\Models\DataAnalysisBookConfig;
 use App\Modules\Book\Services\BookService;
 use App\Modules\Book\Services\ChapterCommentsService;
@@ -1092,10 +1091,17 @@ class ChapterController extends BaseController
     protected function getSubscribe()
     {
         $send_order_info = null;
+        if(!$this->send_order_id && Redis::hget('channel:setting:'.$this->distribution_channel_id,'no_send_order_subscribe')){
+            return true;
+        }
         if($this->send_order_id){
             $send_order_info = SendOrderService::getById($this->send_order_id);
         }
-        if(in_array($this->distribution_channel_id,explode(',',env('INNER_CHANNEL_SUB','1'))) &&
+        $send_order_subsribe_status = Redis::hget('channel:setting:'.$this->distribution_channel_id,'send_order_subsribe');
+        if(is_null($send_order_subsribe_status)){
+            $send_order_subsribe_status = 1;
+        }
+        if($send_order_subsribe_status &&
             $send_order_info &&
             $send_order_info->promotion_type == 'EXTERNAL'
         ){

+ 33 - 4
app/Http/Controllers/Wap/User/CoflController.php

@@ -83,7 +83,8 @@ class CoflController extends Controller
         $uri = $request->path();
         $token = $request->get('token');
         $rfee = $request->get('amount');
-        $crm = $request->get('crm');
+        $crm = $request->get('crm','reward');
+        $source = $request->get('wx','none');
         if($uri == 'freethrhcurrency'){
             $fee = 300;
             $this->stats('reward_300',$crm);
@@ -106,7 +107,7 @@ class CoflController extends Controller
             }else{
                 $link = $this->getLink($get_free_currency->distribution_channel_id).'?'.http_build_query($params);
             }
-            return view('jump.bindHkFreeCurrency',['fee'=>$fee,'url'=>$link,'is_get'=>1,'uid'=>$get_free_currency->uid]);
+            return view('jump.bindHkFreeCurrency',['fee'=>$fee,'url'=>$link,'is_get'=>1,'uid'=>$get_free_currency->uid,'source'=>$source]);
         }else{
             if(isset($user[2]) && !empty($user[2]) && isset($user[3]) && !empty($user[3])){
                 $bid = Hashids::encode($user[2]);
@@ -117,7 +118,7 @@ class CoflController extends Controller
             }else{
                 $link = $this->getLink($user[1]).'?'.http_build_query($params);
             }
-            return view('jump.bindHkFreeCurrency',['fee'=>$fee,'url'=>$link,'is_get'=>0,'uid'=>$user[0]]);
+            return view('jump.bindHkFreeCurrency',['fee'=>$fee,'url'=>$link,'is_get'=>0,'uid'=>$user[0],'source'=>$source]);
         }
     }
 
@@ -132,7 +133,8 @@ class CoflController extends Controller
     public function freeCurrencyPost(Request $request){
         $uid = $request->post('uid');
         $fee = $request->post('fee',200);
-        $result = UserBindHkWelfareService::getfreeCurrency($uid,$fee);
+        $source = $request->post('source','');
+        $result = UserBindHkWelfareService::getfreeCurrency($uid,$fee,'CRM',$source);
         if($result){
             UserService::addBalance($uid,$fee,0,$fee);
         }
@@ -314,6 +316,33 @@ class CoflController extends Controller
         Cookie::queue('crm_flag', $flag, env('U_COOKIE_EXPIRE'), null, null, false, false);
     }
 
+
+    public function longActivity(Request $request)
+    {
+        $openid = $request->get('openid');
+        //授权
+        $params = $request->except('_url');
+        if(empty($openid)){
+            $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[0]){
+            $distribution_channel_id = 123;
+        }else{
+            $distribution_channel_id = $user[1];
+        }
+        $crm = $request->get('crm');
+        $this->stats('activity',$crm);
+        $baselink  = $this->getLink($distribution_channel_id).'activity/crm?'.http_build_query($params);
+        if(isset($params['token']) && !empty($params['token'])){
+            return redirect()->to($baselink.'activity/crm?'.http_build_query($params));
+        }
+        return redirect()->to($baselink);
+    }
+
     public function guidePersonalAccount(Request $request,$channel_id){
         $uid = $request->get('uid');
         if($uid){

+ 28 - 0
app/Http/Controllers/Wap/Web/ActivityController.php

@@ -3,6 +3,7 @@
 namespace App\Http\Controllers\Wap\Web;
 
 use App\Modules\Activity\Services\ActivityService;
+use App\Modules\Product\Services\ProductService;
 use Illuminate\Http\Request;
 use App\Http\Controllers\Wap\BaseController;
 use Redis;
@@ -108,4 +109,31 @@ class ActivityController extends BaseController
         $default_url = env('H5_SCHEME', 'https') . '://site' . $encode_distribution_channel_id . '.' . env('CUSTOM_HOST') . '.com/';
         return redirect()->to($default_url);
     }
+
+    public function crmActivity(Request $request){
+        $default_url = env('H5_SCHEME', 'https') . '://site' . $this->en_distribution_channel_id . '.' . env('CUSTOM_HOST') . '.com/';
+
+        $token = $request->input('token');
+        if(!$token){
+            return redirect()->to($default_url);
+        }
+        $activity_info = ActivityService::getByToken($token);
+        if(!$activity_info){
+            return redirect()->to($default_url);
+        }
+        $img = \GuzzleHttp\json_decode($activity_info->setting,1);
+        $param = [
+            'uid' => $this->uid,
+            'distribution_channel_id' => $this->distribution_channel_id,
+            'product_id' => $activity_info->product_id,
+            'activity_id' => $activity_info->id,
+            'fromtype' => 'crm',
+            'pay_redirect_url' => $default_url.'person',
+            'limit' => 100,
+        ];
+        $product_info = ProductService::getProductSingle($activity_info->product_id);
+        $url = env('CREATE_PAY_URL') . '?' . http_build_query($param);
+        $fee = $product_info->price*100+$product_info->given;
+        return view('crm.crmActivity', ['url' => $url,'img'=>$img['button'],'fee'=>$fee]);
+    }
 }

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

@@ -53,6 +53,7 @@ Route::group(['domain'=>env('FRIEND_LINK_DOMAIN'),'namespace'=>'App\Http\Control
     Route::get('freecurrency','User\CoflController@freeCurrencyView');
     Route::get('freethrhcurrency','User\CoflController@freeCurrencyView');
     Route::post('freecurrency','User\CoflController@freeCurrencyPost');
+    Route::get('activity','User\CoflController@longActivity');
 });
 
 Route::group(['domain'=>env('WAP_DOMAIN'),'namespace'=>'App\Http\Controllers\Wap','middleware'=>'EnableCross'],function(){
@@ -244,6 +245,7 @@ Route::group(['domain'=>env('WAP_DOMAIN'),'namespace'=>'App\Http\Controllers\Wap
 
         Route::get('activity/channel','Web\ActivityController@channelCustomActivity');
         Route::get('activity/common','Web\ActivityController@commonActivity');
+        Route::get('activity/crm','Web\ActivityController@crmActivity');
 
         Route::get('welfare/giving','Web\WelfareController@giving');
 

+ 1 - 1
app/Modules/User/Models/UserBindHkWelfare.php

@@ -7,5 +7,5 @@ use Illuminate\Database\Eloquent\Model;
 class UserBindHkWelfare extends Model
 {
     protected $table = 'user_bind_hk_welfare';
-    protected $fillable = ['uid','openid','fee','type'];
+    protected $fillable = ['uid','openid','fee','type','source'];
 }

+ 3 - 2
app/Modules/User/Services/UserBindHkWelfareService.php

@@ -20,7 +20,7 @@ class UserBindHkWelfareService
         return   $result;
     }
 
-    public static function getfreeCurrency($uid,$fee=200){
+    public static function getfreeCurrency($uid,$fee=200,$type='BIND_HK',$source=''){
         if(self::isHasGet($uid)){
             return false;
         }
@@ -30,7 +30,8 @@ class UserBindHkWelfareService
                 'uid'=>$uid,
                 'openid'=>$user->openid,
                 'fee'=>$fee,
-                'type'=>'BIND_HK'
+                'type'=>$type,
+                'source'=>$source
             ]);
             return true;
         }catch (\Exception $e){}

+ 131 - 0
resources/views/crm/crmActivity.blade.php

@@ -0,0 +1,131 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8" />
+    <meta
+            name="viewport"
+            content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
+    />
+    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
+    <title>充值活动</title>
+    <style>
+        html,
+        body {
+            margin: 0 auto;
+            padding: 0;
+            max-width: 450px;
+            font-size: 100px;
+        }
+
+        html {
+            background: #ffe69d;
+        }
+
+        p {
+            margin: 0;
+        }
+
+        .main_box {
+            font-size: 0;
+            position: relative;
+        }
+
+        .main_box img {
+            width: 100%;
+        }
+
+        .time {
+            font-size: 0.14rem;
+            font-weight: bold;
+            text-align: center;
+            color: #fff;
+        }
+
+        .recharge-item {
+            font-size: 0;
+            width: 90%;
+            margin: 0.3rem auto;
+            position: absolute;
+            top: 60%;
+            left: 50%;
+            transform: translateX(-50%);
+        }
+
+        .recharge_box_one {
+            width: 95%;
+            margin: 0 auto;
+        }
+
+        .rule-box {
+            font-size: 0;
+            margin: 0rem auto 0;
+            text-align: center;
+            position: relative;
+            top: -0.25rem;
+        }
+
+        .rule-box img {
+            width: 80%;
+        }
+
+        .rule-texts {
+            font-size: 0.14rem;
+            color: #000;
+            margin-top: 0.1rem;
+            text-align: left;
+        }
+
+        .rule-texts .rule {
+            line-height: 2;
+        }
+
+        .rule-box .copyright {
+            font-size: 0.15rem;
+            margin-top: 0.15rem;
+            text-align: center;
+            color: #000;
+        }
+
+        .main_box img,
+        a {
+            -webkit-tap-highlight-color: transparent;
+        }
+
+        .recharge-box {
+            font-size: 0;
+            position: absolute;
+            top: 41%;
+            left: 50%;
+            -webkit-transform: translateX(-50%);
+            -ms-transform: translateX(-50%);
+            transform: translateX(-50%);
+        }
+
+        .recharge-item .pay{
+            display: block;
+
+        }
+        .nub {
+            font-size: .28rem;
+            font-weight: 800;
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            transform: translate(-50%);
+            color: #ff6600;
+        }
+    </style>
+</head>
+
+<body>
+<main class="main_box">
+    <img src="https://cdn-novel.iycdm.com/h5/activity-crm/bg.jpg" alt="" />
+    <div class="nub">{{$fee}}书币</div>
+    <div class="recharge-item">
+        <div class="rule-box">
+            <a href="{{$url}}" class="pay"><img src="{{$img}}" alt="" /></a>
+        </div>
+    </div>
+</main>
+</body>
+</html>

+ 2 - 1
resources/views/jump/bindHkFreeCurrency.blade.php

@@ -263,6 +263,7 @@ a{text-decoration: none}
 window.onload=function(){
     var d = document;
     var is_get = {{$is_get}};
+    var source = {{$source}};
     var fee = {{$fee}};
     var url = "{{$url}}";
         is_get = parseInt(is_get);
@@ -289,7 +290,7 @@ window.onload=function(){
         var xhr = new XMLHttpRequest();
         xhr.open(method, url, true);
         xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
-        xhr.send('uid='+uid+'&fee='+fee);
+        xhr.send('uid='+uid+'&fee='+fee+'&source='+source);
         xhr.onreadystatechange=function(){
         if (xhr.readyState ==4 && xhr.status==200)
         {

+ 4 - 13
resources/views/pay/order/yearactivityV3.blade.php

@@ -70,8 +70,9 @@
         }
 
         .book-list {
-            padding: 0.2rem 0;
+            /* padding: 0.2rem 0; */
             background: #fff5f4;
+            font-size: 0;
         }
 
         .book-list h3 {
@@ -160,7 +161,7 @@
         <img src="https://cdn-novel.iycdm.com/h5/activity-2019-05-10/banner.png" alt="">
     </div>
     <p class="intro">
-        365天内,全站书籍免费看!无需额外付费!最新最火最热门小说一网打尽,限时低价,机会难得,赶快订购吧!
+        365天内,全站小说任你畅读!一站式阅读所有小说,无需额外付费!不是每个人都像你这么幸运哦,时间有限,快使用优惠券成为最尊贵的VIP吧~
     </p>
     <input type="hidden" name="is_get" value="{{$is_get}}">
     <div class="coupon" data-value="{{$discount}}">
@@ -203,17 +204,7 @@
 
     </div>
     <div class="book-list">
-        <h3>榜单精选
-            <span>海量小说任意看</span>
-        </h3>
-        <div class="book-list__container">
-            @foreach($books as $book)
-                <a class="book-item" href="#">
-                    <img src="{{$book['cover_url']}}" alt="">
-                    <span>{{$book['book_category']}}</span>
-                </a>
-            @endforeach
-        </div>
+        <img src="https://cdn-novel.iycdm.com/h5/activity-2019-05-10/shuping.jpg" alt="">
     </div>
 </main>
 <div class="coupon-dialog" style="display:none">