WIN-2308041133\Administrator 5 hónapja
szülő
commit
b3234ec3bc

+ 10 - 4
application/admin/controller/platform/Vplatform.php

@@ -77,8 +77,11 @@ class Vplatform extends Backend
         }
         if ($this->request->isPost()) {
             $params = $this->request->post("row/a");
-            if($params['max']<$params['min']){
-                $this->error('最大值不能小于最小值');
+//            if($params['max']<$params['min']){
+//                $this->error('最大值不能小于最小值');
+//            }
+            if ($params['dividend']<0){
+                $this->error('分红金额不能小于0');
             }
         }
         $vid = $this->model->where('id', $ids)->value('vid');
@@ -99,8 +102,11 @@ class Vplatform extends Backend
                 if ($this->model->where('vid', $vid)->where('platform_id', $platform_id)->find()){
                     $this->error('该平台收益已设置');
                 }
-                if($params['max']<$params['min']){
-                    $this->error('最大值不能小于最小值');
+//                if($params['max']<$params['min']){
+//                    $this->error('最大值不能小于最小值');
+//                }
+                if ($params['dividend']<0){
+                    $this->error('分红金额不能小于0');
                 }
                 $params['vname'] = model('videolist')->where('id', $params['vid'])->value('name');
                 $params['pname'] = model('platform')->where('id', $params['platform_id'])->value('name');

+ 4 - 3
application/api/controller/Platform.php

@@ -186,9 +186,10 @@ class Platform extends Api
             foreach ($vid_list as $k => $v) {
                 $count = model('video_user')->where('vid',$v)->field('sum(contribution) as count')->find();
                 $count = $count['count'];  //该短剧的总贡献值
-                $income = model('video_platform_record')->where('vid', $v)->where('createtime', 'between', [$yesterdayStart, $yesterdayEnd])->sum('num');  //该短剧昨日收益
-                if ($income<=0) continue;
-                $each_income = $income / $count;  //每点贡献值的收益
+//                $income = model('video_platform_record')->where('vid', $v)->where('createtime', 'between', [$yesterdayStart, $yesterdayEnd])->sum('num');  //该短剧昨日收益
+                $each_income = model('video_platform')->where('vid', $v)->sum('dividend');
+                if ($each_income<=0) continue;
+//                $each_income = $income / $count;  //每点贡献值的收益
                 $user_list = model('video_user')->where('vid', $v)->where('contribution','>',0)->select();
                 $name = model('Videolist')->where('id', $v)->value('name');  //该短剧名称
                 if (empty($name)){

+ 3 - 2
public/assets/js/backend/platform/vplatform.js

@@ -27,8 +27,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {field: 'id', title: __('Id'),align: 'left',align: 'left', sortable: true},
                         {field: 'vname', title: __('短剧名称'), align: 'left',operate: 'LIKE'},
                         {field: 'pname', title: __('平台名称'),align: 'left', operate: 'LIKE'},
-                        {field: 'max', title: __('收益上限(每日)'),align: 'left', operate: '='},
-                        {field: 'min', title: __('收益下限(每日)'),align: 'left', operate: '='},
+                        // {field: 'max', title: __('收益上限(每日)'),align: 'left', operate: '='},
+                        // {field: 'min', title: __('收益下限(每日)'),align: 'left', operate: '='},
+                        {field: 'dividend', title: __('分红(每贡献值)'),align: 'left', operate: '='},
                         {field: 'createtime', title: __('添加时间'),align: 'left', formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
                         {field: 'operate', title: __('Operate'),align: 'left', table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
                     ]