|
|
|
@ -39,7 +39,21 @@ public function UsePlan(){
|
|
|
|
|
|
|
|
|
|
|
|
$u=DB::table('plans')->where(['id'=>$id,'status'=>1])->update(['status'=>2]);
|
|
|
|
$u=DB::table('plans')->where(['id'=>$id,'status'=>1])->update(['status'=>2]);
|
|
|
|
if($u){
|
|
|
|
if($u){
|
|
|
|
return \Yz::Return(true,'操作成功',[]);
|
|
|
|
return \Yz::Return(true,'占用成功',['id'=>$id]);
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
return \Yz::echoError1("操作失败");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function CancelUsePlan()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$id =request('id');
|
|
|
|
|
|
|
|
$plan=DB::table('plans')->where('id',$id)->first();
|
|
|
|
|
|
|
|
if(!$plan) return \Yz::echoError1("该号源不存在");
|
|
|
|
|
|
|
|
if($plan->status<>2) return \Yz::echoError1("该号源未被占用,无需撤销");
|
|
|
|
|
|
|
|
$u=DB::table('plans')->where(['id'=>$id])->update(['status'=>1]);
|
|
|
|
|
|
|
|
if($u){
|
|
|
|
|
|
|
|
return \Yz::Return(true,'撤销占用成功',['id'=>$id]);
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
return \Yz::echoError1("操作失败");
|
|
|
|
return \Yz::echoError1("操作失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|