|
@@ -42,11 +42,22 @@ class Account extends Base
|
|
if($mobile!=""){
|
|
if($mobile!=""){
|
|
$where['mobile'] = ["like"=>"%{$mobile}%"];
|
|
$where['mobile'] = ["like"=>"%{$mobile}%"];
|
|
}
|
|
}
|
|
|
|
+
|
|
$count= Db::name("account_list")->where($where)->count();
|
|
$count= Db::name("account_list")->where($where)->count();
|
|
$total = ceil($count/$size);
|
|
$total = ceil($count/$size);
|
|
$page = $page>=$total? $total:$page;
|
|
$page = $page>=$total? $total:$page;
|
|
|
|
+
|
|
$list = Db::name("account_list")->where($where)->page($page,$size)->order("addtime desc")->select();
|
|
$list = Db::name("account_list")->where($where)->page($page,$size)->order("addtime desc")->select();
|
|
- return app_show(0,"获取成功",["list"=>$list,"count"=>$count]);
|
|
|
|
|
|
+ $i=[];
|
|
|
|
+ foreach ($list as $vus ){
|
|
|
|
+ $vi = Db::name('rela_video')->join('fc_video a','a.id=rela_video.video_id','left')->field('a.video_sn,a.video_name,a.video_url,a.video_img')->where(['accountid'=>$vus['id'],'is_del'=>0,])->select();
|
|
|
|
+ if(empty($vi)){
|
|
|
|
+ $vi=[];
|
|
|
|
+ }
|
|
|
|
+ $vus['info']=$vi;
|
|
|
|
+ $i[]=$vus;
|
|
|
|
+ }
|
|
|
|
+ return app_show(0,"获取成功",["list"=>$i,"count"=>$count]);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -127,11 +138,28 @@ class Account extends Base
|
|
if($info>0){
|
|
if($info>0){
|
|
$rela=["accountid"=>$acccount,"account_info"=>$info];
|
|
$rela=["accountid"=>$acccount,"account_info"=>$info];
|
|
$rela_acc=Db::name("rela_account")->insert($rela);
|
|
$rela_acc=Db::name("rela_account")->insert($rela);
|
|
|
|
+
|
|
|
|
+ // $rele = [["video_id"=>$video,"accountid"=>$video,"addtime"=>$video]];
|
|
|
|
+ $l=[];
|
|
|
|
+ foreach ($video as $value){
|
|
|
|
+
|
|
|
|
+ $temp=["video_id"=>$value,"accountid"=>$acccount,"addtime"=>date("Y-m-d H:i:s")];
|
|
|
|
+ $l[]=$temp;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $rele_a= Db::name("rela_video")->insertAll($l);
|
|
|
|
+ if($rele_a==false){
|
|
|
|
+ Db::rollback();
|
|
|
|
+ return error_show(1002,"绑定失败");
|
|
|
|
+ }else{
|
|
|
|
+ write_log("视频绑定成功",$this->userinfo,"account","add");
|
|
|
|
+ }
|
|
if($rela_acc){
|
|
if($rela_acc){
|
|
write_log("账户{$username}新建成功",$this->userinfo,"account","add");
|
|
write_log("账户{$username}新建成功",$this->userinfo,"account","add");
|
|
Db::commit();
|
|
Db::commit();
|
|
return app_show(0,"账户新建成功");
|
|
return app_show(0,"账户新建成功");
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
Db::rollback();
|
|
Db::rollback();
|
|
@@ -226,13 +254,31 @@ class Account extends Base
|
|
}
|
|
}
|
|
|
|
|
|
$rela['remark'] = isset($this->post['remark'])&&$this->post['remark']!=="" ? trim($this->post['remark']) :"";
|
|
$rela['remark'] = isset($this->post['remark'])&&$this->post['remark']!=="" ? trim($this->post['remark']) :"";
|
|
- $video = isset($this->post['video'])&&$this->post['video']!=="" ? trim($this->post['video']) :"";
|
|
|
|
|
|
+ $video = isset($this->post['video'])&&$this->post['video']!=="" ? $this->post['video'] :"";
|
|
$rela['updatetime'] = date("Y-m-d H:i:s");
|
|
$rela['updatetime'] = date("Y-m-d H:i:s");
|
|
|
|
+
|
|
Db::startTrans();
|
|
Db::startTrans();
|
|
try {
|
|
try {
|
|
$acccount = Db::name("account")->update($info);
|
|
$acccount = Db::name("account")->update($info);
|
|
if($acccount){
|
|
if($acccount){
|
|
$infoacc = Db::name("account_info")->update($rela);
|
|
$infoacc = Db::name("account_info")->update($rela);
|
|
|
|
+ $del = Db::name('rela_video')->where(["is_del"=>0,"accountid"=>$id])->select();
|
|
|
|
+ if($del==true){
|
|
|
|
+ $dl = Db::name('rela_video')->where(["is_del"=>0,"accountid"=>$id])->update(["updatetime"=>date("Y-m-d H:i:s"),"is_del"=>1]);
|
|
|
|
+ }
|
|
|
|
+ //$relo=["video_id"=>$video,"accountid"=>$video,"addtime"=>date("Y-m-d H:i:s")];
|
|
|
|
+ $k=[];
|
|
|
|
+ foreach ($video as $valu){
|
|
|
|
+ $temp=["video_id"=>$valu,"accountid"=>$id,"addtime"=>date("Y-m-d H:i:s")];
|
|
|
|
+ $k[]=$temp;
|
|
|
|
+ }
|
|
|
|
+ $rele_a= Db::name("rela_video")->insertAll($k);
|
|
|
|
+ if($rele_a==false){
|
|
|
|
+ Db::rollback();
|
|
|
|
+ return error_show(1002,"绑定失败");
|
|
|
|
+ }else{
|
|
|
|
+ write_log("视频绑定成功",$this->userinfo,"account","edit");
|
|
|
|
+ }
|
|
if($infoacc){
|
|
if($infoacc){
|
|
write_log("账户{$username}新建成功",$this->userinfo,"account","edit");
|
|
write_log("账户{$username}新建成功",$this->userinfo,"account","edit");
|
|
Db::commit();
|
|
Db::commit();
|