ソースを参照

短剧统计增加点击人数

liuzejian 1 年間 前
コミット
22a5f85cf2

+ 9 - 7
modules/Statistic/Http/Controllers/VideoStatController.php

@@ -18,12 +18,12 @@ class VideoStatController extends CatchController
     use UserTrait;
     public function __construct(protected readonly VideoStatByCompany $videoStatByCompany)
     {
-        
+
     }
 
     public function index(Request $request)
     {
-        
+
         if(!$this->isCompanyManager()){
             return [];
         }
@@ -32,9 +32,11 @@ class VideoStatController extends CatchController
         $is_export = $request->get('is_export');
         $where = $this->requestParam($request);
         if($is_export){
-            $result = $this->videoStatByCompany->where($where)->select('day','video_name','video_id','amount','charge_count','charge_user_num','play_count')->get();
+            $result = $this->videoStatByCompany->where($where)
+                ->select('day','video_name','video_id','amount','charge_count','charge_user_num','play_count', 'click_uv')->get();
         }else{
-            $result = $this->videoStatByCompany->where($where)->select('day','video_name','video_id','amount','charge_count','charge_user_num','play_count')->paginate($limit);
+            $result = $this->videoStatByCompany->where($where)
+                ->select('day','video_name','video_id','amount','charge_count','charge_user_num','play_count', 'click_uv')->paginate($limit);
         }
         return $result;
     }
@@ -67,7 +69,7 @@ class VideoStatController extends CatchController
         $video_name = $request->get('video_name');
         $start_date = $request->get('start_date');
         $end_date = $request->get('end_date');
-        
+
         if(!$end_date){
             $end_date = $default_end_time;
         }else{
@@ -86,12 +88,12 @@ class VideoStatController extends CatchController
             ['day','>=',$start_date->format('Y-m-d')],
             ['day','<=',$end_date->format('Y-m-d')]
         ];
-        
+
         if(trim($video_name)){
             $where[] = ['video_name','like','%'.trim($video_name).'%'];
         }
         return $where;
     }
 
- 
+
 }

+ 2 - 1
modules/Statistic/Models/VideoStatByCompany.php

@@ -10,7 +10,8 @@ class VideoStatByCompany extends BaseModel
     protected $table = 'video_stat_by_company';
 
     protected $fillable = [
-        'id', 'day', 'user_id', 'video_name', 'video_id', 'amount', 'charge_count', 'charge_user_num', 'play_count', 'is_delete', 'created_at', 'updated_at', 
+        'id', 'day', 'user_id', 'video_name', 'video_id', 'amount', 'charge_count',
+        'charge_user_num', 'play_count', 'is_delete', 'created_at', 'updated_at', 'click_uv',
     ];
 
 }