瀏覽代碼

crm chapter order

zz 6 年之前
父節點
當前提交
55380d21bb

+ 10 - 0
app/Http/Controllers/Wap/Book/ChapterController.php

@@ -11,6 +11,7 @@ use App\Modules\Statistic\Services\AdVisitStatService;
 use App\Modules\Statistic\Services\DataAnalysisChapterService;
 use App\Modules\Statistic\Services\DataAnalysisSelectUserService;
 use App\Modules\Statistic\Services\WapVisitStatService;
+use App\Modules\Subscribe\Services\CrmChapterOrderDetailService;
 use App\Modules\Subscribe\Services\CustomChapterOrderService;
 use App\Modules\Subscribe\Services\OrderService;
 use App\Modules\Subscribe\Models\Order;
@@ -747,6 +748,7 @@ class ChapterController extends BaseController
                     $this->user->balance -= $fee;
                 }
                 $this->customChapterOrderStats($fee);
+                $this->crmChapterStats($fee);
                 return true;
             }
         }
@@ -1863,6 +1865,14 @@ class ChapterController extends BaseController
         }
     }
 
+    private function crmChapterStats($fee){
+        $crm = Cookie::get('crm');
+        if(!$crm)return ;
+        try{
+            CrmChapterOrderDetailService::create($this->uid,$fee);
+        }catch (\Exception $e){}
+
+    }
     private function customChapterOrderStats($fee)
     {
         //custom_290824

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

@@ -105,7 +105,7 @@ class ReadOauth
             }
         }
         //个性化推送
-        $this->stylePush($request, $uid_cookie, $distribution_channel_id);
+        //$this->stylePush($request, $uid_cookie, $distribution_channel_id);
 
         //禁止明文访问
         if ($this->isForbidPrimaryNumberChannleID($origin_distribution_channel_id, $uid_cookie)) {
@@ -155,7 +155,7 @@ class ReadOauth
         //只能推送的统计
         $this->smartPush($request, $uid_cookie);
         //数据分析 长篇推短片的统计
-        $this->dataAnalysis($request, $uid_cookie);
+        //$this->dataAnalysis($request, $uid_cookie);
         //from where的临时统计
         $this->tempFromWhere($request, $uid_cookie);
         //统计访问site数字的uid记录下

+ 12 - 0
app/Modules/Subscribe/Models/CrmChapterOrderDetail.php

@@ -0,0 +1,12 @@
+<?php
+
+namespace App\Modules\Subscribe\Models;
+
+use Illuminate\Database\Eloquent\Model;
+
+class CrmChapterOrderDetail extends Model
+{
+    protected $table = 'crm_chapter_order_detail';
+
+    protected $fillable = ['uid','day','fee'];
+}

+ 24 - 0
app/Modules/Subscribe/Services/CrmChapterOrderDetailService.php

@@ -0,0 +1,24 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: z-yang
+ * Date: 2019/6/6
+ * Time: 11:34
+ */
+
+namespace App\Modules\Subscribe\Services;
+
+use App\Modules\Subscribe\Models\CrmChapterOrderDetail;
+
+class CrmChapterOrderDetailService
+{
+    public static function create($uid, $fee)
+    {
+        CrmChapterOrderDetail::create([
+                'uid' => $uid,
+                'fee' => $fee,
+                'day' => date('Y-m-d')
+            ]
+        );
+    }
+}