|
@@ -154,10 +154,11 @@ class VideoUrl extends Controller
|
|
|
|
|
|
protected function _form_result($result)
|
|
|
{
|
|
|
- $url_num = \app\common\model\VideoUrl::where(['video_id'=>$this->request->post('video_id'),'is_deleted'=>0])->count();
|
|
|
+ $url_num = \app\common\model\VideoUrl::field('id,read_num')->where(['video_id'=>$this->request->post('video_id'),'is_deleted'=>0])->select()->toArray();
|
|
|
$video_info = VideoIntro::where('id',$this->request->post('video_id'))->find()->toArray();
|
|
|
$url = $this->request->post('up_type',1) == 1 ? $this->request->post('up_url'):$this->request->post('path');
|
|
|
- $up['url_num'] = $url_num;
|
|
|
+ $up['url_num'] = count($url_num);
|
|
|
+ $up['read_num'] = array_sum(array_column($url_num,'read_num'));
|
|
|
if(!$video_info['cover']) $up['cover'] = $this->request->post('cover');
|
|
|
if(!$video_info['video_url']) $up['video_url'] = $url;
|
|
|
if(!$video_info['article_id']) $up['article_id'] = $this->request->post('article_id');
|