//商城矿机设置
public function shop(){
if(!request()->isPost()){
return $this->fetch();
}else {
$mydata = input('post.');
$result = '0';
foreach ($mydata as $k=>$v){
$resulta = Db::name('btm_shop')
->where('id', $k)
->update(['ags_level' => $v]);
//if结果=1直接赋值
if($resulta == 1){
$result = 1;
}
}
if($result == 1){
$data = ['status'=>1,'msg'=>'矿机修改成功'];
}else{
$data = ['status'=>0,'msg'=>'矿机修改失败'];
}
return json($data);
}
}