Browse Source

sunguidong

zhangguidong 2 years ago
parent
commit
99127d0b59
2 changed files with 89 additions and 1 deletions
  1. 2 1
      application/api/controller/Index.php
  2. 87 0
      application/store/controller/MemberBasic.php

+ 2 - 1
application/api/controller/Index.php

@@ -566,7 +566,8 @@ class Index extends Api
             'age'=>$age,
             'education'=>$education,
             'phone'=>$phone,
-            'state'=>0
+            'state'=>0,
+            'create_at'=>date('Y-m-d H:i:s')
         ];
         $is_have  = Db::name('store_member_basic')->where('mid',$uid)->find();
         if($is_have){

+ 87 - 0
application/store/controller/MemberBasic.php

@@ -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']);
+
+        }
+    }
+
+}