123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <?php
- namespace app\admin\controller;
- use app\common\controller\Backend;
- use think\Db;
- class Useridconfirm extends Backend
- {
-
-
- protected $model = null;
- public function _initialize()
- {
- parent::_initialize();
- $this->model = new \app\admin\model\Useridconfirm;
- $this->view->assign("statusList", $this->model->getStatusList());
- }
- public function import()
- {
- parent::import();
- }
-
-
-
- public function index()
- {
-
- $this->relationSearch = true;
-
- $this->request->filter(['strip_tags', 'trim']);
- if ($this->request->isAjax()) {
-
- if ($this->request->request('keyField')) {
- return $this->selectpage();
- }
- list($where, $sort, $order, $offset, $limit) = $this->buildparams();
- $list = $this->model
- ->with(['user'])
- ->where($where)
- ->order($sort, $order)
- ->paginate($limit);
- foreach ($list as $row) {
-
- $row->getRelation('user')->visible(['username']);
- }
- $result = array("total" => $list->total(), "rows" => $list->items());
- return json($result);
- }
- return $this->view->fetch();
- }
-
- public function audit(){
- if ($this->request->isAjax()) {
- $id = input('id');
- $status = input('status');
- $info = Db::name('user_idconfirm')->where('id',$id)->find();
- $data = [
- 'status' => $status,
- 'updatetime' => time(),
- ];
- Db::startTrans();
- $rs = Db::name('user_idconfirm')->where('id',$id)->update($data);
-
- $update = [
- 'idcard_status'=>$data['status'],
- ];
- $rs = Db::name('user')->where('id',$info['user_id'])->update($update);
-
- $remark = '实名认证已经被取消';
- if($status == 1){
- $remark = '实名认证已经被恢复';
- }
- $msg_id = \app\common\model\Message::addMessage($info['user_id'],'实名认证',$remark);
- Db::commit();
- $this->success('取消完成');
- }
- }
- }
|