Authored by xiaofeng.yao@yoho.cn

增加红包分享文案

... ... @@ -388,9 +388,13 @@
"hls_downstream_address": "http://2718.liveplay.myqcloud.com/2718_3baa8de762c411e6a2cba4dcbef5e35a.m3u8",
"live_last_time": "321",
"background_pic": "http://img11.static.yhbimg.com/global/2016/08/17/18/01f17a9cd44149052482e4ee58e590cf1b.png",
"share_pic": "http://img11.static.yhbimg.com/global/2016/08/17/18/01f17a9cd44149052482e4ee58e590cf1b.png?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80",
"share_url": "http://m.yohobuy.com/activity/live/2266102578",
"share_title":"分享标题",
"share_content":"分享内容"
"redbag_share_pic": "http://img10.static.yhbimg.com/global/2016/11/01/17/01835bcc555349d7d7a5a83bb9e68f1fa7.png?imageView2/1/w/{width}/h/{height}",
"redbag_share_title": "有货直播发红包啦,快来抢!",
"redbag_share_content": "有货直播中狂发红包,领取立享优惠!"
},
"timestamp": 1471339317,
"md5": "36ca1d1279edc257a8dd5ee1ae052bc6"
... ... @@ -416,8 +420,12 @@
| live_last_time | int|直播时长(秒)
| background_pic | str|房间背景图片url
| share_url | str|分享链接url
| share_pic | str|分享图片
| share_title | str|分享标题
| share_content | str|分享内容
| redbag_share_pic | str|红包分享图片
| redbag_share_title | str|红包分享标题
| redbag_share_content | str|红包分享内容
# **回放视频详情**
... ... @@ -447,30 +455,30 @@
###### 正确返回
{
"code": 200,
"message": "",
"data": {
"master_pic": "http://usr.im/100x100?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80",
"master_name": "王力宏1",
"master_meta": "ddd1",
"title": "qweqw",
"pic": "http://img11.static.yhbimg.com/global/2016/08/12/15/011efc2fc675679ad87c38a2ce5a2cd9cf.png?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80",
"watermark": "5655",
"url": "",
"like_num": 0,
"audience_num": 0,
"live_title": "qwe",
"live_start_time": 321,
"live_end_time": 0,
"background_pic": "http://img11.static.yhbimg.com/global/2016/08/17/18/01f17a9cd44149052482e4ee58e590cf1b.png",
"share_url": "http://m.yohobuy.com/activity/live/replay/2",
"share_title":"分享标题",
"share_content":"分享内容"
},
"timestamp": 1471339317,
"md5": "37a83576b0f194bdae7c9f52a8adbff4"
}
{
"code": 200,
"message": "",
"data": {
"master_pic": "http://usr.im/100x100?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80",
"master_name": "王力宏1",
"master_meta": "ddd1",
"title": "qweqw",
"pic": "http://img11.static.yhbimg.com/global/2016/08/12/15/011efc2fc675679ad87c38a2ce5a2cd9cf.png?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80",
"watermark": "5655",
"url": "",
"like_num": 0,
"audience_num": 0,
"live_title": "qwe",
"live_start_time": 321,
"live_end_time": 0,
"background_pic": "http://img11.static.yhbimg.com/global/2016/08/17/18/01f17a9cd44149052482e4ee58e590cf1b.png",
"share_url": "http://m.yohobuy.com/activity/live/replay/2",
"share_title":"分享标题",
"share_content":"分享内容"
},
"timestamp": 1471339317,
"md5": "37a83576b0f194bdae7c9f52a8adbff4"
}
###### 返回说明
名称| 类型|说明|
... ...
... ... @@ -83,4 +83,17 @@ class Share extends \yii\db\ActiveRecord
}
return $ret;
}
/**
* 红包分享
* @return array
*/
public function redBag()
{
return [
'redbag_share_pic' => CommonImages::getTemplateComplex('/2016/11/01/17/01835bcc555349d7d7a5a83bb9e68f1fa7.png', 1),
'redbag_share_title' => '有货直播发红包啦,快来抢!',
'redbag_share_content' => '有货直播中狂发红包,领取立享优惠!',
];
}
}
... ...
... ... @@ -280,8 +280,11 @@ class LivingController extends BaseController
}
$ret['background_pic'] = $ret['background_pic'] ? : 'http://img11.static.yhbimg.com/global/2016/08/17/18/01f17a9cd44149052482e4ee58e590cf1b.png';
$share = (new Share)->getLivingShare($room_id);
$ret += $share;
$shareModel = new Share();
//内容分享
$ret += $shareModel->getLivingShare($room_id);
//红包分享
$ret += $shareModel->redBag();
$dependency = new \yii\caching\DbDependency(['sql' => Yii::$app->db
->createCommand('SELECT update_time FROM {{%room}} WHERE room_id=:room_id')
... ...