|
@@ -3,7 +3,7 @@
|
|
|
namespace app\admin\controller\user;
|
|
|
|
|
|
use app\common\controller\Backend;
|
|
|
-
|
|
|
+use think\Db;
|
|
|
/**
|
|
|
* 会员管理
|
|
|
*
|
|
@@ -72,6 +72,35 @@ class User extends Backend
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 充值积分
|
|
|
+ */
|
|
|
+ public function updatescore(){
|
|
|
+ $id = input('id');
|
|
|
+ $info = Db::name('user_wallet')
|
|
|
+ ->where('user_id',$id)
|
|
|
+ ->find();
|
|
|
+
|
|
|
+ if ($this->request->isPost()) {
|
|
|
+
|
|
|
+ $user_id = input('user_id');
|
|
|
+ $score = input('score');
|
|
|
+ $remark = input('remark','后台调节');
|
|
|
+
|
|
|
+ Db::startTrans();
|
|
|
+ $rs = model('wallet')->lockChangeAccountRemain($user_id,'score',$score,1,$remark);
|
|
|
+ if($rs['status'] === false){
|
|
|
+ Db::rollback();
|
|
|
+ $this->error($rs['msg']);
|
|
|
+ }
|
|
|
+
|
|
|
+ Db::commit();
|
|
|
+ $this->success('充值完成');
|
|
|
+ }
|
|
|
+
|
|
|
+ $this->assign('row',$info);
|
|
|
+ return $this->view->fetch();
|
|
|
+ }
|
|
|
|
|
|
|
|
|
public function selectpagenew()
|