title = '会员注册审核'; $query = $this->_query($this->table)->like('nickname,phone')->equal('state#status'); $query->dateBetween('create_at')->order('id desc')->page(); } /** * 添加快递公司 * @auth false * @throws \think\Exception * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException * @throws \think\exception\PDOException */ public function add() { $this->_form($this->table, 'form'); } /** * 编辑快递公司 * @auth false * @throws \think\Exception * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException * @throws \think\exception\PDOException */ public function edit() { $this->_form($this->table, 'form'); } /** * 表单数据处理 * @param array $data * @auth true */ protected function _form_filter(&$data) { if ($this->request->isPost()) { if (isset($data['state'])) { if ($data['state'] == 1) { $info = Db::name('store_member_basic')->where('id', $data['id'])->find(); $user = Db::name('store_member')->where('id',$info['mid'])->find(); // $member = [ // 'username' => $info['username'], // 'phone' => $info['phone'], // 'vip_level' => 0, // ]; $member = [ 'nickname'=>$info['nickname'], 'ID_car'=>$info['ID_car'], 'education'=>$info['education'], 'age'=>$info['age'], 'sex'=>$info['sex'], 'height'=>$info['height'], 'weight'=>$info['weight'], 'headimg'=>$info['headimg'], 'province_id'=>1375, 'city_id'=>1479, 'area_id'=>$info['area_id'], 'username' => $info['username'], 'phone' => $info['phone'], 'vip_level' => 0, ]; if(empty($user['openid'])||$user['phone']){ Db::name('store_member')->where('id', $info['mid'])->update($member); } else{ $user2 = Db::name('store_member')->where('phone',$info['phone'])->find(); if(empty($user2)){ Db::name('store_member')->where('id', $info['mid'])->update($member); } else{ Db::name('store_member')->where('id', $user2['id'])->update(['openid'=>$user['openid']]); Db::name('store_member')->where('id', $user['id'])->delete(); } } } } } } }