diff --git a/hyhproject/app/controller/Note.php b/hyhproject/app/controller/Note.php index 690b18d..4117c53 100644 --- a/hyhproject/app/controller/Note.php +++ b/hyhproject/app/controller/Note.php @@ -116,6 +116,7 @@ class Note extends Base $name = input("post.name"); $cur_cash = input('post.cur_cash'); $credit_cash = input('post.credit_cash'); + $return_date = input('post.return_date', 1); if ($id == 0){ Db::startTrans(); try { @@ -124,6 +125,7 @@ class Note extends Base "cur_cash" => $cur_cash, 'name' => $name, 'credit_cash' => $credit_cash, + "return_date" => $return_date, ]); Db::name("note_credit_detail")->insert([ "credit_id" => $id, @@ -159,7 +161,7 @@ class Note extends Base } Db::name('note_credit') ->where(["user_id" => $userId, "id" => $id]) - ->update(compact('name', 'credit_cash')); + ->update(compact('name', 'credit_cash', 'return_date')); Db::commit(); return WSTReturn("OK", 1); } catch (Exception $e) { diff --git a/hyhproject/app/controller/Users.php b/hyhproject/app/controller/Users.php index 532a89e..cdd074c 100755 --- a/hyhproject/app/controller/Users.php +++ b/hyhproject/app/controller/Users.php @@ -1,5 +1,6 @@ getShareInfo(); } + + /** + * 注销 + */ + public function unregister(){ + $m = new M(); + $userId = $this->getUserId(); + $user = $m->getById($userId); + if (empty($user)) exit(jsonReturn('系统异常',0,[])); + $opUser = input('post.op_user'); + // TODO: 记录操作人员名称 + // TODO: 验证规则 + Db::startTrans(); + $m->where('userId', '=', $userId)->update([ + 'dataFlag'=>9, + ]); + Db::rollback(); + exit(jsonReturn('成功',1,[])); + } }