|
@@ -175,6 +175,7 @@ class PlayerControl extends BaseController
|
|
|
|
|
|
|
|
|
|
|
|
|
$controlWhere = [];
|
|
$controlWhere = [];
|
|
|
|
|
+ $controlWhere[] = ['user_id', '=', $userInfo['user_id']];
|
|
|
|
|
|
|
|
|
|
|
|
|
$where = [];
|
|
$where = [];
|
|
@@ -292,11 +293,12 @@ class PlayerControl extends BaseController
|
|
|
*/
|
|
*/
|
|
|
public function cancelPlayerControlInfo()
|
|
public function cancelPlayerControlInfo()
|
|
|
{
|
|
{
|
|
|
|
|
+ $userInfo = $this->getUserInfo();
|
|
|
$control_id = Request::post('control_id','', 'trim');
|
|
$control_id = Request::post('control_id','', 'trim');
|
|
|
if(empty($control_id)) {
|
|
if(empty($control_id)) {
|
|
|
return json_error([], '参数错误');
|
|
return json_error([], '参数错误');
|
|
|
}
|
|
}
|
|
|
- $info = PlayerControlModel::find($control_id);
|
|
|
|
|
|
|
+ $info = PlayerControlModel::where(['control_id' => $control_id, 'user_id' => $userInfo['user_id']]);
|
|
|
if(!empty($info)) {
|
|
if(!empty($info)) {
|
|
|
$info->end_time = time();
|
|
$info->end_time = time();
|
|
|
$info->status = 0;
|
|
$info->status = 0;
|
|
@@ -305,4 +307,15 @@ class PlayerControl extends BaseController
|
|
|
return json_success([],'操作成功');
|
|
return json_success([],'操作成功');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 一键取消全部点控
|
|
|
|
|
+ * @return \think\response\Json
|
|
|
|
|
+ */
|
|
|
|
|
+ public function cancelAllPlayerControlInfo()
|
|
|
|
|
+ {
|
|
|
|
|
+ $userInfo = $this->getUserInfo();
|
|
|
|
|
+ PlayerControlModel::where(['user_id' => $userInfo['user_id']])->save(['status' => 0, 'end_time' => time()]);
|
|
|
|
|
+ return json_success([],'操作成功');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|