aiyou 4 年 前
コミット
77058c08b4

+ 45 - 1
application/admin/controller/from/StoreFenqiCar.php

@@ -30,6 +30,50 @@ class StoreFenqiCar extends Backend
      * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
      * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
      */
-    
+
+    /**
+     * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+     * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+     * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+     */
+    /**
+     * 查看
+     */
+    public function index()
+    {
+        //设置过滤方法
+        $this->request->filter(['strip_tags']);
+        if ($this->request->isAjax()) {
+            //如果发送的来源是Selectpage,则转发到Selectpage
+            if ($this->request->request('keyField')) {
+                return $this->selectpage();
+            }
+            list($where, $sort, $order, $offset, $limit) = $this->buildparams();
+            $where1['is_del']='0';
+
+
+
+
+            $total = $this->model
+                ->where($where)
+                ->where($where1)
+                ->order($sort, $order)
+                ->count();
+
+            $list = $this->model
+                ->where($where)
+                ->where($where1)
+                ->with(['member','product'])
+                ->order($sort, $order)
+                ->limit($offset, $limit)
+                ->select();
+
+            $list = collection($list)->toArray();
+            $result = array("total" => $total, "rows" => $list);
+
+            return json($result);
+        }
+        return $this->view->fetch();
+    }
 
 }

+ 8 - 2
application/admin/model/from/StoreFenqiCar.php

@@ -27,10 +27,16 @@ class StoreFenqiCar extends Model
     protected $append = [
 
     ];
-    
 
-    
+    public function member()
+    {
+        return $this->belongsTo('app\admin\model\Member','mid','mid')->field('mid,nickname');
+    }
 
+    public function product()
+    {
+        return $this->belongsTo('app\admin\model\store\StoreProduct','store_id','id')->field('id,store_name,image,price,special_price');
+    }
 
 
 

+ 1 - 1
application/api/controller/Upload.php

@@ -60,6 +60,6 @@ class Upload extends Api
         //最终生成的字符串路径
         $imagePathStr = implode(',', $imageArr);
         //return $imagePathStr;
-        $this->result('ok', $imagePathStr, 1);
+        $this->result('SUCCESS', $imagePathStr, 1);
     }
 }

+ 5 - 8
public/assets/js/backend/from/store_fenqi_car.js

@@ -24,21 +24,18 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                 columns: [
                     [
                         {checkbox: true},
-                        {field: 'id', title: __('Id')},
-                        {field: 'mid', title: __('Mid')},
-                        {field: 'store_id', title: __('Store_id')},
-                        {field: 'fenqi', title: __('Fenqi')},
+                        {field: 'id', title: __('ID')},
+                        {field: 'member.nickname', title: __('用户'),operate:false},
+                        {field: 'store.store_name', title: __('商品')},
+
                         {field: 'shoufu', title: __('Shoufu'), operate:'BETWEEN'},
                         {field: 'price', title: __('Price'), operate:'BETWEEN'},
                         {field: 'one_price', title: __('One_price'), operate:'BETWEEN'},
                         {field: 'phone', title: __('Phone')},
                         {field: 'name', title: __('Name')},
                         {field: 'mark', title: __('Mark')},
-                        {field: 'is_del', title: __('Is_del')},
                         {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
-                        {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
-                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
-                    ]
+                       ]
                 ]
             });
 

+ 12 - 1
public/assets/js/backend/shop_user.js

@@ -63,7 +63,18 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                                     icon: 'fa fa-list',
                                     dropdown:'更多操作',
                                     url: function (row) {
-                                        return 'shop_order/index?suser_id='+ row.id;
+                                        if (row.cate_top_id =='1'){
+                                            return 'shop_order_new/index?suser_id='+ row.id;
+                                        }
+                                        else{
+                                            if(row.cate_top_id =='2'){
+                                                return 'shop_order_ershou/index?suser_id='+ row.id;
+
+                                            }else {
+                                                return 'shop_order/index?suser_id=' + row.id;
+                                            }
+                                        }
+
                                     }
                                 },
                                 {

BIN
新后台操作文档.doc