|
@@ -0,0 +1,87 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace app\store\controller;
|
|
|
+
|
|
|
+use library\Controller;
|
|
|
+use think\Db;
|
|
|
+
|
|
|
+class MemberBasic extends Controller
|
|
|
+{
|
|
|
+ /**
|
|
|
+ * 绑定数据表
|
|
|
+ * @var string
|
|
|
+ */
|
|
|
+ protected $table = 'store_member_basic';
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 会员信息管理
|
|
|
+ * @auth true
|
|
|
+ * @menu true
|
|
|
+ * @throws \think\Exception
|
|
|
+ * @throws \think\db\exception\DataNotFoundException
|
|
|
+ * @throws \think\db\exception\ModelNotFoundException
|
|
|
+ * @throws \think\exception\DbException
|
|
|
+ * @throws \think\exception\PDOException
|
|
|
+ */
|
|
|
+ public function index()
|
|
|
+ {
|
|
|
+ $this->title = '会员注册审核';
|
|
|
+ $query = $this->_query($this->table)->alias('e')->join('store_member_basic m','m.id=e.mid')->join('store_company c','c.id=c_id')->like('phone')->equal('state');
|
|
|
+ $query->dateBetween('e.create_at')->field('e.*,c.name c_name')->order('e.id desc')->page();
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 添加快递公司
|
|
|
+ * @auth true
|
|
|
+ * @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 true
|
|
|
+ * @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($data['status']==2){
|
|
|
+ $info = Db::name('store_examine')->where('id',$data['id'])->find();
|
|
|
+ $member = [
|
|
|
+ 'username'=>$info['name'],
|
|
|
+ 'phone'=>$info['phone'],
|
|
|
+ 'working'=>$info['c_id'],
|
|
|
+ 'vip_level'=>1,
|
|
|
+ ];
|
|
|
+ Db::name('store_member')->where('id',$info['mid'])->update($member);
|
|
|
+ }
|
|
|
+ $data['update_at']=date('Y-m-d H:i:s');
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ $data['describes_arr'] = explode(',',$data['m_images']);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|