afa 5 сар өмнө
parent
commit
c420624d6e

+ 17 - 1
app/admin/common.php

@@ -40,4 +40,20 @@ if (!function_exists('format_bytes')) {
         }
         return round($size, $precision) . $delimiter . $units[$i];
     }
-}
+}
+
+if (!function_exists('resp_json')) {
+    /**
+     * 返回json
+     * @param int    $code      code
+     * @param string $msg       返回信息
+     * @param int    $data      返回数据
+     * @return string
+     */
+    function resp_json($code, $msg = '', $data = null)
+    {
+       
+        return json(['code' => $code,'msg' => $msg,'data' => $data]);
+    }
+}
+

+ 102 - 5
app/admin/controller/goods/StockConfig.php

@@ -7,6 +7,7 @@ use app\common\controller\Backend;
 use think\annotation\route\Group;
 use think\annotation\route\Route;
 use app\admin\traits\Actions;
+use think\facade\Db;
 use app\common\model\StockConfig as StockConfigModel;
 
 #[Group("goods/stock_config")]
@@ -21,12 +22,108 @@ class StockConfig extends Backend
     }
 
 
+    /**
+     * 添加
+     */
+    #[Route('GET,POST','add')]
+    public function add()
+    {
+        if (false === $this->request->isPost()) {
+            return $this->fetch();
+        }
+        $params = array_merge($this->request->post("row/a"),$this->postParams);
+        if (empty($params)) {
+            $this->error(__('提交的参数不能为空'));
+        }
+        if(!$this->request->checkToken('__token__',['__token__'=>$this->request->post('__token__')])){
+            $this->error(__('token错误,请刷新页面重试'));
+        }
+        if($this->model::where('field_name', $params['field_name'])->count() >0)  $this->error(__('库存唯一属性已存在'));
+        foreach ($params as &$value){
+            if(is_array($value)){
+                $value=implode(',',$value);
+            }
+            if($value===''){
+                $value=null;
+            }
+        }
+        $result = false;
+        Db::startTrans();
+        try {
+            $result = $this->model->save($params);
+            if($this->callback){
+                $callback=$this->callback;
+                $callback($this->model);
+            }
+            Db::commit();
+        } catch (\Exception $e) {
+            Db::rollback();
+            $this->error($e->getMessage());
+        }
+        if ($result === false) {
+            $this->error(__('没有新增任何数据'));
+        }
+        $this->success();
+    }
 
-    
-    //删除
-    #[Route("GET","del")]
-    public function del()
+    /**
+     * 编辑
+     */
+    #[Route('GET,POST','edit')]
+    public function edit(mixed $row=null)
     {
-        return "删除";
+        $ids = $this->request->get('ids');
+        if(!$row || is_array($row)){
+            $row = $this->model->find($ids);
+        }
+        if (!$row) {
+            $this->error(__('没有找到记录'));
+        }
+        if(count($this->volidateFields)>0){
+            foreach ($this->volidateFields as $field=>$value){
+                if($row[$field]!=$value){
+                    $this->error(__('没有操作权限'));
+                }
+            }
+        }
+        if (false === $this->request->isPost()) {
+            $this->assign('row', $row);
+            return $this->fetch();
+        }
+        $params = array_merge($this->request->post("row/a"),$this->postParams);
+        if (empty($params)) {
+            $this->error(__('提交的参数不能为空'));
+        }
+        if(!$this->request->checkToken('__token__',['__token__'=>$this->request->post('__token__')])){
+            $this->error(__('token错误,请刷新页面重试'));
+        }
+        if($this->model::where('field_name', $params['field_name'])->count() >1)  $this->error(__('库存唯一属性已存在'));
+        foreach ($params as &$value){
+            if(is_array($value)){
+                $value=implode(',',$value);
+            }
+            if($value===''){
+                $value=null;
+            }
+        }
+        $result = false;
+        Db::startTrans();
+        try {
+            $result = $row->save($params);
+            if($this->callback){
+                $callback=$this->callback;
+                $callback($row);
+            }
+            Db::commit();
+        } catch (\Exception $e) {
+            Db::rollback();
+            $this->error($e->getMessage());
+        }
+        if (false === $result) {
+            $this->error(__('没有数据被更新'));
+        }
+        $this->success();
     }
+
+    
 }

+ 23 - 0
app/admin/controller/shop/ShopDelivery.php

@@ -0,0 +1,23 @@
+<?php
+declare (strict_types = 1);
+
+namespace app\admin\controller\shop;
+
+use app\common\controller\Backend;
+use think\annotation\route\Group;
+use app\admin\traits\Actions;
+use app\common\model\ShopDelivery as ShopDeliveryModel;
+
+#[Group("shop/shop_delivery")]
+class ShopDelivery extends Backend
+{
+    use Actions;
+
+    protected function _initialize()
+    {
+        parent::_initialize();
+        $this->model = new ShopDeliveryModel();
+    }
+
+
+}

+ 38 - 31
app/admin/controller/shop/ShopList.php

@@ -9,6 +9,9 @@ use think\annotation\route\Route;
 use app\admin\traits\Actions;
 use app\common\model\Customer;
 use app\common\model\User;
+use app\common\model\StockConfig;
+use app\common\model\ProductConfig;
+use think\Response;
 use app\common\model\ShopList as ShopListModel;
 
 #[Group("shop/shop_list")]
@@ -32,42 +35,46 @@ class ShopList extends Backend
     }   
 
  
-    
-    #[Route('GET,POST','add')]
-    public function add()
+    #[Route('GET,POST','specs')]
+    public function specs()
     {
-        if($this->request->isPost()){
-           
-        }
-        return $this->_add();
-    }
+        if($this->request->isAjax()){
+            $ids = $this->request->post('ids/d', 0);
+            $field_name= $this->request->post('field_name');
+            $type_id = $this->request->post('type_id');
+            $specs   = $this->request->post('type_box');
+            $specsList = [];
+            foreach ($specs as $item) {
+               if(empty($item['price'])) return resp_json(0, '请填写发货价格');
+               $specsList[] = ['name'=>$item['name'], 'price'=> $item['price']];
+            }
+            $row = $this->model::find($ids);
+            $row->type_spec = json_encode(['field_name'=>['type_id'=>$type_id, 'field_name'=>$field_name], 'specs'=> $specsList], JSON_UNESCAPED_UNICODE);
 
-    #[Route('GET,POST','edit')]
-    public function edit()
-    {
-        $ids = $this->request->get('ids');
-        $row = $this->model->find($ids);
-        //...可以对row进行一些前置的操作
-        if($this->request->isPost()){
-            //通过postParams属性可以增加或者覆盖前端row/a传过来的参数
-            //$this->postParams['属性名']='属性的值';
+            $row->save();
+            return resp_json(200,'操作成功');
+
+        }else{
+          
+            $ids = $this->request->get('ids/d', 0);
+            $rows = $this->model::find($ids);
+            $fieldList= StockConfig::where('type_id', 'variety_name')->column('field_name','id');
+            $this->assign('rows', $rows);
+            $this->assign('fieldList',$fieldList);
+            return $this->fetch();
         }
-        //注意这里传入已经修改过的$row
-        return $this->_edit($row);
     }
 
-    
-    //删除
-    #[Route("GET","del")]
-    public function del()
+  
+    #[Route('GET','get_box')]
+    public function get_box()
     {
-        return "删除";
-    }
-    
-    //导入
-    #[Route("GET","import")]
-    public function import()
-    {
-        return "导入";
+        if($this->request->isAjax()){
+            $type_id = $this->request->get('type_id/d', 0);
+            if(empty($type_id)) return resp_json(0, '参数错误');
+            $list = ProductConfig::where('type_id', $type_id)->order('sort desc')->field('another_name, title')->select();
+            return json($list, 200);
+        }
     }
+ 
 }

+ 111 - 5
app/admin/controller/user/Index.php

@@ -17,6 +17,7 @@ use app\admin\traits\Actions;
 use app\common\model\User;
 use app\common\model\UserLog;
 use think\annotation\route\Route;
+use think\facade\Db;
 
 #[Group("user/index")]
 class Index extends Backend
@@ -31,6 +32,115 @@ class Index extends Backend
         $this->model = new User();
     }
 
+    /**
+     * 添加
+     */
+    #[Route('GET,POST','add')]
+    public function add()
+    {
+        if (false === $this->request->isPost()) {
+            return $this->fetch();
+        }
+        $params = array_merge($this->request->post("row/a"),$this->postParams);
+        if (empty($params)) {
+            $this->error(__('提交的参数不能为空'));
+        }
+        if(!$this->request->checkToken('__token__',['__token__'=>$this->request->post('__token__')])){
+            $this->error(__('token错误,请刷新页面重试'));
+        }
+        foreach ($params as &$value){
+            if(is_array($value)){
+                $value=implode(',',$value);
+            }
+            if($value===''){
+                $value=null;
+            }
+        }
+        $result = false;
+        Db::startTrans();
+        try {
+            $params['salt'] = str_rand(4);
+            $params['password']= md5(md5($params['salt'].$params['password'])) ;
+            $result = $this->model->save($params);
+            if($this->callback){
+                $callback=$this->callback;
+                $callback($this->model);
+            }
+            Db::commit();
+        } catch (\Exception $e) {
+            Db::rollback();
+            $this->error($e->getMessage());
+        }
+        if ($result === false) {
+            $this->error(__('没有新增任何数据'));
+        }
+        $this->success();
+    }
+    /**
+     * 编辑
+     */
+    #[Route('GET,POST','edit')]
+    public function edit(mixed $row=null)
+    {
+        $ids = $this->request->get('ids');
+        if(!$row || is_array($row)){
+            $row = $this->model->find($ids);
+        }
+        if (!$row) {
+            $this->error(__('没有找到记录'));
+        }
+        if(count($this->volidateFields)>0){
+            foreach ($this->volidateFields as $field=>$value){
+                if($row[$field]!=$value){
+                    $this->error(__('没有操作权限'));
+                }
+            }
+        }
+        if (false === $this->request->isPost()) {
+            $this->assign('row', $row);
+            return $this->fetch();
+        }
+        $params = array_merge($this->request->post("row/a"),$this->postParams);
+        if (empty($params)) {
+            $this->error(__('提交的参数不能为空'));
+        }
+        if(!$this->request->checkToken('__token__',['__token__'=>$this->request->post('__token__')])){
+            $this->error(__('token错误,请刷新页面重试'));
+        }
+        foreach ($params as &$value){
+            if(is_array($value)){
+                $value=implode(',',$value);
+            }
+            if($value===''){
+                $value=null;
+            }
+        }
+        $result = false;
+        Db::startTrans();
+        try {
+           if(!empty($params['password'])) {
+                $params['salt'] = str_rand(4);
+                $params['password']= md5(md5($params['salt'].$params['password'])) ;
+            }
+            $result = $row->save($params);
+            if($this->callback){
+                $callback=$this->callback;
+                $callback($row);
+            }
+            Db::commit();
+        } catch (\Exception $e) {
+            Db::rollback();
+            $this->error($e->getMessage());
+        }
+        if (false === $result) {
+            $this->error(__('没有数据被更新'));
+        }
+        $this->success();
+    }
+
+
+
+
     #[Route('POST,GET','recharge')]
     public function recharge($ids)
     {
@@ -57,11 +167,7 @@ class Index extends Backend
         }
     }
 
-    #[Route('GET','test')]
-    public function test()
-    {
-        return $this->fetch();
-    }
+   
 
     #[Route('GET,JSON','detail')]
     public function detail($ids)

+ 1 - 0
app/admin/view/shop/customer/add.html

@@ -23,6 +23,7 @@
         },
         methods: {
 
+        
         }
     }
 </script>

+ 50 - 0
app/admin/view/shop/shop_delivery/index.html

@@ -0,0 +1,50 @@
+<template>
+    <el-card shadow="never">
+        <yun-table
+                :columns="columns"
+                search="name,phone"
+                toolbar="refresh,add,edit,del,more"
+                ref="yuntable"
+                :auth="auth"
+                :extend="extend">
+        </yun-table>
+    </el-card>
+</template>
+<script>
+    import table from "@components/Table.js";
+    export default{
+        components:{'YunTable':table},
+        data:{
+            auth:{
+               
+                recyclebin:Yunqi.auth.check('app\\admin\\controller\\shop\\ShopList','recyclebin'),
+            },
+            extend:{
+                index_url: 'shop/shop_delivery/index',
+                recyclebin_url: 'shop/shop_delivery/recyclebin',
+            },
+            columns:[
+                {checkbox: true},
+                {field: 'id',title: __('ID'),width:80,sortable: true},
+                {field: 'customer_id',title: __('客户'),operate:'LIKE'},
+                {field: 'type_id',title: __('平台'),operate: '=', searchList: Yunqi.data.platformList},
+                {field: 'type_box', title: __('店铺名称'),operate: 'LIKE'},
+                {field: 'num', title: __('员工'),searchList: {1: __('日结'), 2: __('周结'), 3: __('半月结')}},
+                {field: 'status', title: __('状态'),width:120,searchList: {1: __('正常'),2: __('停用')},formatter:Yunqi.formatter.switch},
+                {field: 'create_time', title: __('创建时间'), width:160,formatter: Yunqi.formatter.datetime,operate:false,sortable: true},
+                {
+                    field: 'operate',
+                    title: __('操作'),
+                    width:150,
+                    action:{sort:true,edit:true,del:true}
+                }
+            ]
+        },
+        methods: {
+        
+        }
+    }
+</script>
+<style>
+
+</style>

+ 19 - 2
app/admin/view/shop/shop_list/index.html

@@ -44,12 +44,29 @@
                     field: 'operate',
                     title: __('操作'),
                     width:150,
-                    action:{sort:true,edit:true,del:true}
+                    action:{
+                        spec:{
+                            tooltip:true,
+                            icon:'fa fa-list',
+                            type:'info',
+                            text:__('设置规格'),
+                            method:'spec'
+                        },
+                        edit:true,
+                        del:true
+                    }
                 }
             ]
         },
         methods: {
-        
+            spec:function (row){
+                Yunqi.api.open({
+                    url:'shop/shop_list/specs?ids='+row.id,
+                    width:1000,
+                    title:__('设置规格'),
+                    icon:'fa fa-list'
+                });
+            },
         }
     }
 </script>

+ 106 - 0
app/admin/view/shop/shop_list/specs.html

@@ -0,0 +1,106 @@
+<template>
+    <el-card shadow="never" style="border: 0;">
+  
+        <el-form ref="form" :model="form" label-width="80px" border stripe>
+            <el-form-item label="品种">
+                <el-radio-group v-model="form.nameValue">
+                    <el-radio :label="item.label" :value= "JSON.stringify(item)" v-for="(item, index) in options"
+                        :key="index" @change="changeType"></el-radio>
+                </el-radio-group>
+            </el-form-item>
+            <el-form-item label="规格">
+                <el-table :data="tableData" style="border: 1px solid rgb(235, 235, 235); border-radius: 6px">
+                    <el-table-column prop="name" label="规格" width="200">
+                    </el-table-column>
+                    
+                    <el-table-column prop="price" label="发货价格" align="center">
+                        <template #default="{row}">
+                            <el-input v-model="row.price" placeholder="发货价格"></el-input>
+                        </template>
+                    </el-table-column>
+                </el-table>
+            </el-form-item>
+            <el-form-item>
+                <el-button type="primary" @click="onSubmit">立即创建</el-button>
+                <el-button>取消</el-button>
+            </el-form-item>
+        </el-form>
+    </el-card>
+</template>
+<script>
+    import form from "@components/Form.js";
+    var typeList = [], boxList=[], field_name = '';
+    export default {
+        components: { 'YunForm': form },
+        data() {
+            return {
+                row: Yunqi.data.row,
+                tableData: boxList,
+                value:0,
+                form: {
+                    nameValue: "",
+                },
+                options: typeList,
+            }
+        },
+        methods: {
+            changeType: function (data, row) {
+                this.tableData = []
+                //获取规格
+                data = JSON.parse(data);    
+                field_name = data.label
+
+                    Yunqi.ajax.get('shop/shop_list/get_box',{type_id: data.value},false,false,true).then(res=>{
+
+                        //编辑数据
+                        let type_spec = Yunqi.data.rows.type_spec;
+                        let type_arr = JSON.parse(type_spec);
+                        if(type_arr != null && type_arr['field_name']['type_id'] == data.value){
+                            this.tableData = type_arr['specs']
+                        }else{
+                            if(res.length > 0){
+                                for (var key in Object(res)) {
+                                    this.tableData.push({name: res[key]['title'], value: ""});
+                                }
+                            }
+                        }
+                    });
+            },
+            onSubmit() {
+                //获取规格
+                if(this.tableData == "")  return
+                Yunqi.ajax.post('shop/shop_list/specs',{ids:Yunqi.data.rows.id,type_id:JSON.parse(this.form.nameValue).value,field_name:field_name, type_box: this.tableData},false,false,true).then(res=>{    
+                    if(res.code == 200){
+                        this.$message.success(__('设置成功'));
+                        Yunqi.api.closelayer(Yunqi.app.window.id,true);
+                    }else{
+                        Yunqi.alert(__('请填写发货价格'),__('温馨提示'),{type: 'error'});
+                    }
+                });
+                
+            },
+        },
+        onLoad:function (){
+      
+            let type_spec = Yunqi.data.rows.type_spec; //编辑数据
+            let type = Yunqi.data.fieldList;
+            if(type_spec != null){
+                let spec_arr = JSON.parse(type_spec)
+                let obj = {
+                    label : spec_arr.field_name.field_name,
+                    value : spec_arr.field_name.type_id,
+                }
+                this.form.nameValue = JSON.stringify(obj)
+                this.tableData = spec_arr.specs
+             
+            }
+            //全部品种
+            for (var key in Object(type)) {
+                typeList.push({label: type[key], value: key});
+            }
+        },
+    }
+</script>
+<style>
+
+</style>

+ 31 - 0
app/admin/view/user/index/add.html

@@ -0,0 +1,31 @@
+<template>
+    <el-card shadow="never" style="border: 0;">
+        <yun-form :data="row" :columns="columns">
+            {:token_field()}
+        </yun-form>
+    </el-card>
+</template>
+<script>
+    import form from "@components/Form.js";
+    export default{
+        components:{'YunForm':form},
+        data:{
+            row:Yunqi.data.row,
+            columns:[
+                {field: 'id',title: __('ID'),edit:'hidden'},
+                {field: 'nickname', title: __('姓名'), edit: 'text',rules:"required",searchList: Yunqi.data.varietyList},
+                {field: 'username',title: __('账户'),edit:'text',rules:'required'},
+                {field: 'password',title: __('密码'),edit:'text',rules:'required;length(6~30)'},
+                {field: 'role',title: __('角色'),edit:'radio',searchList: {1:'录入员', 2:'库管'}},
+                {field: 'remark',title: __('备注'),edit:'textarea'},
+                {field: 'status', title: __('状态'), edit:'switch',searchList: {'normal': __('正常'),'hidden': __('隐藏')}},
+            ]
+        },
+        methods: {
+
+        }
+    }
+</script>
+<style>
+
+</style>

+ 0 - 51
app/admin/view/user/index/detail.html

@@ -1,51 +0,0 @@
-<template>
-    <el-card shadow="never">
-        <el-tabs v-model="activeType" type="card" @tab-change="refreshLog">
-            {foreach $moduletype as $key=>$type}
-            <el-tab-pane label="{$type}" name="{$key}"></el-tab-pane>
-            {/foreach}
-        </el-tabs>
-        <yun-table
-                v-if="recharge_url"
-                :columns="rechargeDetail"
-                toolbar="refresh"
-                :extend="recharge_url">
-        </yun-table>
-    </el-card>
-</template>
-<script>
-    import table from "@components/Table.js";
-    export default{
-        components:{'YunTable':table},
-        data:{
-            rechargeDetail: [
-                {field: 'createtime', title: __('时间'),operate: {form:'date-picker',type:'daterange',size:'large'}},
-                {field: 'before', title: __('交易前'),operate:false},
-                {field: 'change', title: __('变化数目'),operate:false},
-                {field: 'after', title: __('交易后'),operate:false},
-                {field: 'order_no', title: __('订单编号')},
-                {field: 'remark', title: __('备注'),operate:false}
-            ],
-            activeType:'',
-            recharge_url:''
-        },
-        onLoad:function (){
-            this.activeType=Object.keys(Yunqi.data.moduletype)[0];
-            this.refreshLog();
-        },
-        methods: {
-            refreshLog:function (){
-                this.recharge_url='';
-                Vue.nextTick(()=>{
-                    this.recharge_url={
-                        index_url:'user/index/detail?type='+this.activeType+'&ids='+Yunqi.data.user.id
-                    };
-                });
-            }
-        }
-    }
-</script>
-<style>
-
-</style>
-

+ 8 - 1
app/admin/view/user/index/edit.html

@@ -15,10 +15,17 @@
                 {field: 'id',title: __('ID'),edit:'hidden'},
                 {field: 'username',title: __('用户名'),edit:'text',rules:'required'},
                 {field: 'nickname',title: __('昵称'),edit:'readonly',rules:'required'},
+                {field: 'password',title: __('密码'),edit:{
+                    form:'input',
+                    type:'password',
+                    value:'',
+                    rules:'required;length(6~30)',
+                    placeholder:'不填写则不修改',
+                }},
                 {field: 'sex', title: __('性别'), edit: 'radio',rules:"required",searchList: {1: __('男'), 2: __('女')}},
                 {field: 'email',title: __('邮箱'),rules:'email',edit:'text'},
                 {field: 'mobile',title: __('手机'),edit:'text',rules:'mobile'},
-                {field: 'level', title: __('等级'),edit:{form:'select', value:1},searchList:{0:'普通',1:'1级',2:'2级',3:'3级',4:'4级'}},
+                {field: 'role',title: __('角色'),edit:'radio',searchList: {1:'录入员', 2:'库管'}},
                 {field: 'status', title: __('状态'), edit:'switch',searchList: {'normal': __('正常'),'hidden': __('隐藏')}},
             ]
         },

+ 23 - 37
app/admin/view/user/index/index.html

@@ -3,7 +3,7 @@
         <yun-table
                 :columns="columns"
                 search="nickname,mobile"
-                toolbar="refresh,edit,del,recyclebin,more"
+                toolbar="refresh,add,edit,del,recyclebin,more"
                 ref="yuntable"
                 :auth="auth"
                 :extend="extend">
@@ -23,7 +23,9 @@
                 recyclebin:Yunqi.auth.check('app\\admin\\controller\\user\\Index','recyclebin'),
             },
             extend:{
+             
                 index_url: 'user/index/index',
+                add_url: 'user/index/add',
                 edit_url: 'user/index/edit',
                 del_url: 'user/index/del',
                 multi_url: 'user/index/multi',
@@ -36,12 +38,10 @@
                 {field: 'username',title: __('用户名'),operate:'='},
                 {field: 'avatar', title: __('头像'), formatter: Yunqi.formatter.image, operate: false},
                 {field: 'nickname',title: __('昵称'),operate: 'LIKE',formatter: Yunqi.formatter.tag},
-                {field: 'sex', title: __('性别'),width:100,searchList: {1: __('男'), 2: __('女')},operate:'select',formatter:Yunqi.formatter.select},
+                {field: 'sex', title: __('性别'),width:100,searchList: {1: __('男'), 2: __('女')},operate:false,formatter:Yunqi.formatter.select},
                 {field: 'email',title: __('邮箱'),operate:'LIKE'},
                 {field: 'mobile',title: __('手机'),operate: '='},
-                {field: 'level', title: __('等级'),sortable: true,operate:'selects',searchList:{0:'普通',1:'1级',2:'2级',3:'3级',4:'4级'}},
-                {field: 'score', title: __('积分'),sortable: true,operate:'between'},
-                {field: 'balance', title: __('余额'),sortable: true,operate:'between'},
+                {field: 'role', title: __('角色'),sortable: true,operate:'selects',searchList:{0:'录入员 ',1:'库管'}},
                 {field: 'status', title: __('状态'),searchList: {'normal': __('正常'),'hidden': __('隐藏')},formatter:Yunqi.formatter.switch,operate:'select'},
                 {field: 'createtime', title: __('创建时间'), width:160,formatter: Yunqi.formatter.datetime,operate:false,sortable: true},
                 {
@@ -50,20 +50,6 @@
                     width:180,
                     fixed:'right',
                     action:{
-                        recharge:{
-                            tooltip:true,
-                            icon:'fa fa-plug',
-                            type:'warning',
-                            text:__('会员充值'),
-                            method:'recharge'
-                        },
-                        detail:{
-                            tooltip:true,
-                            icon:'fa fa-list',
-                            type:'info',
-                            text:__('会员明细'),
-                            method:'detail'
-                        },
                         edit:true,
                         del:true
                     }
@@ -71,24 +57,24 @@
             ]
         },
         methods: {
-            detail:function (row){
-                Yunqi.api.open({
-                    url:'user/index/detail?ids='+row.id,
-                    width:1000,
-                    title:__('会员明细'),
-                    icon:'fa fa-list'
-                });
-            },
-            recharge:function (row){
-                Yunqi.api.open({
-                    url:'user/index/recharge?ids='+row.id,
-                    title:__('会员充值'),
-                    icon:'fa fa-plug',
-                    close:()=>{
-                        this.$refs.yuntable.reload();
-                    }
-                });
-            }
+            // detail:function (row){
+            //     Yunqi.api.open({
+            //         url:'user/index/detail?ids='+row.id,
+            //         width:1000,
+            //         title:__('会员明细'),
+            //         icon:'fa fa-list'
+            //     });
+            // },
+            // recharge:function (row){
+            //     Yunqi.api.open({
+            //         url:'user/index/recharge?ids='+row.id,
+            //         title:__('会员充值'),
+            //         icon:'fa fa-plug',
+            //         close:()=>{
+            //             this.$refs.yuntable.reload();
+            //         }
+            //     });
+            // }
         }
     }
 </script>

+ 3 - 1
app/api/controller/User.php

@@ -2,7 +2,7 @@
 
 namespace app\api\controller;
 
-use app\common\model\Orders;
+use think\captcha\facade\Captcha;
 use app\api\service\auth\ApiAuthService;
 use app\api\validate\User as UserValidate;
 use think\exception\ValidateException;
@@ -14,6 +14,8 @@ class User extends Base
     protected $noNeedLogin = ['login'];
 
 
+
+
     public function userinfo(ApiAuthService $authService)
     {
       

+ 1 - 1
app/api/route/route.php

@@ -10,7 +10,7 @@ Route::group('user', function () {
      
       Route::rule('login','user/login','POST');
       Route::rule('userinfo','user/userinfo','GET|POST');
-      Route::rule('createAddress','transaction/createAddress','GET|POST');
+      Route::rule('captcha','user/captcha','GET|POST');
 
 
   })->middleware(AllowCrossDomain::class);

+ 1 - 1
app/api/validate/User.php

@@ -14,7 +14,7 @@ class User extends Validate
     protected $message  =   [
         'name'      => '名称必须',
         'password'  => '密码长度只能在6-32之间',
-        'email'        => '邮箱格式错误',    
+        'email'     => '邮箱格式错误',    
     ];
 
 

+ 3 - 2
app/common/model/Customer.php

@@ -10,6 +10,7 @@ class Customer extends BaseModel
 
 
 
-      const STATUS_NORMAL = 1;
-      const STATUS_HIDDEN = 2;
+      const STATUS_NORMAL = 'normal';
+      const STATUS_HIDDEN = 'hidden';
+
 }

+ 25 - 0
app/common/model/ShopDelivery.php

@@ -0,0 +1,25 @@
+<?php
+declare(strict_types=1);
+
+namespace app\common\model;
+
+use think\Model;
+
+class ShopDelivery Extends Model
+{
+    // 自动写入时间戳字段
+    protected $autoWriteTimestamp = true;
+    protected $createTime = 'createtime';
+    protected $updateTime = 'updatetime';
+
+    protected $type = [
+        'createtime'     =>  'timestamp:Y-m-d H:i',
+        'updatetime'     =>  'timestamp:Y-m-d H:i',
+    ];
+
+    public static function onAfterInsert($data)
+    {
+        $data->weigh=1000-$data->id;
+        $data->save();
+    }
+}

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
runtime/cache/7a/b2b683b6c3e8e0985917962d853b9c.php


Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно