WIN-2308041133\Administrator il y a 8 mois
Parent
commit
28b1e734dc

+ 2 - 1
application/api/controller/Platform.php

@@ -121,6 +121,7 @@ class Platform extends Api
         $list = model('VideoShare')->where('endtime','<',time())->where('type',2)->select();
         if($list) {
             foreach ($list as $k => $v) {
+                @file_put_contents("quanju.txt", json_encode($v) . "-要扣除的版权\r\n", 8);
                 $video_user = model('VideoUser')->where('uid',$v['uid'])->where('vid',$v['vid'])->find();
                 if ($video_user){
 //                    要过期的版权数量也就是贡献值数量
@@ -138,7 +139,7 @@ class Platform extends Api
                         'createtime' => time(),
                         'pm' => 1,
                     ];
-                    $id = Db::name('VideoShareRecord')->insertGetId($up);
+                    $id = Db::name('VideoContributionRecord')->insertGetId($up);
                     $user = model('VideoList')->where('id',$v['vid'])->find();
                     $user_contribution = $user['share']+$v['num'];
                     $res2 = model('VideoList')->where('id',$v['vid'])->update(['share'=>$user_contribution]);

+ 29 - 0
application/common/model/VideoContributionRecord.php

@@ -0,0 +1,29 @@
+<?php
+
+namespace app\common\model;
+
+use think\Model;
+
+/**
+ * 会员模型
+ */
+class VideoContributionRecord extends Model
+{
+    // 表名
+    protected $name = 'video_contribution_record';
+    // 开启自动写入时间戳字段
+    protected $autoWriteTimestamp = 'int';
+    // 定义时间戳字段名
+    protected $createTime = 'createtime';
+    // 追加属性
+    protected $append = [];
+
+    public function videolist()
+    {
+        return $this->belongsTo('Videolist', 'vid', 'id', [], 'LEFT')->setEagerlyType(0);
+    }
+    public function platform()
+    {
+        return $this->belongsTo('Platform', 'platform_id', 'id', [], 'LEFT')->setEagerlyType(0);
+    }
+}