|
|
@@ -810,6 +810,43 @@ class User extends BaseController
|
|
810
|
810
|
return app('json')->fail("失败");
|
|
811
|
811
|
}
|
|
812
|
812
|
}
|
|
|
813
|
+
|
|
|
814
|
+ /**
|
|
|
815
|
+ * 修改用户奖励表单
|
|
|
816
|
+ * @param $id
|
|
|
817
|
+ * @return mixed
|
|
|
818
|
+ * @throws FormBuilderException
|
|
|
819
|
+ */
|
|
|
820
|
+ public function changeAwardForm($id)
|
|
|
821
|
+ {
|
|
|
822
|
+ if (!$this->repository->exists($id))
|
|
|
823
|
+ return app('json')->fail('数据不存在');
|
|
|
824
|
+ return app('json')->success(formToData($this->repository->changeAwardForm($id)));
|
|
|
825
|
+ }
|
|
|
826
|
+
|
|
|
827
|
+
|
|
|
828
|
+ /**
|
|
|
829
|
+ * 修改用户奖励
|
|
|
830
|
+ * @param $id
|
|
|
831
|
+ * @param UserRepository $repository
|
|
|
832
|
+ * @return mixed
|
|
|
833
|
+ */
|
|
|
834
|
+ public function changeAward($id,UserRepository $repository)
|
|
|
835
|
+ {
|
|
|
836
|
+ $type = $this->request->param('type');
|
|
|
837
|
+ $award_type = $this->request->param('award_type');
|
|
|
838
|
+ $num = $this->request->param('num');
|
|
|
839
|
+ $mark = $this->request->param('mark','');
|
|
|
840
|
+ $admin_id = $this->request->param('admin_id');
|
|
|
841
|
+ if (!$id || !$award_type || !$num){
|
|
|
842
|
+ return app('json')->fail('参数丢失');
|
|
|
843
|
+ }
|
|
|
844
|
+ if($repository->changeAward($id,$type,$award_type,$num,$mark,$admin_id)){
|
|
|
845
|
+ return app('json')->success("修改成功");
|
|
|
846
|
+ }else{
|
|
|
847
|
+ return app('json')->fail("失败");
|
|
|
848
|
+ }
|
|
|
849
|
+ }
|
|
813
|
850
|
/**
|
|
814
|
851
|
* @param $id
|
|
815
|
852
|
* @return mixed
|