Browse Source

fix:分销商

super-yimizi 1 day ago
parent
commit
58d0f2d2ba

+ 11 - 12
application/admin/controller/commission/Agent.php

@@ -76,18 +76,17 @@ class Agent extends Backend
      *
      * @param  $id
      */
-    public function detail($id)
+    public function detail($ids = null)
     {
-        if (!$this->request->isAjax()) {
-            return $this->view->fetch();
-        }
-
-        $detail = $this->model->with(['user.parent_user', 'level_info', 'level_status_info', 'upgrade_level'])->where('user_id', $id)->find();
-        if (!$detail) {
+    
+        $row = $this->model->with(['user.parent_user', 'level_info', 'level_status_info', 'upgrade_level'])
+        ->where('user_id', $ids)
+        ->find();
+        if (!$row) {
             $this->error(__('No Results were found'));
-        }
-
-        $this->success('分销商详情', null, $detail);
+        }       
+        $this->view->assign('row', $row);
+        return $this->view->fetch();
     }
 
 
@@ -96,13 +95,13 @@ class Agent extends Backend
      *
      * @param  $id
      */
-    public function team($id)
+    public function team($ids = null)
     {
         if (!$this->request->isAjax()) {
             return $this->view->fetch();
         }
 
-        $detail = $this->model->with(['user.parent_user', 'level_info'])->where('user_id', $id)->find();
+        $detail = $this->model->with(['user.parent_user', 'level_info'])->where('user_id', $ids)->find();
         if (!$detail) {
             $this->error(__('No Results were found'));
         }

+ 0 - 2
application/admin/view/commission/agent/index.html

@@ -9,8 +9,6 @@
                         <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
                     </div>
                     <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
-                           data-operate-edit="{:$auth->check('commission/agent/edit')}"
-                           data-operate-del="{:$auth->check('commission/agent/del')}"
                            width="100%">
                     </table>
                 </div>

+ 0 - 26
public/assets/js/backend/commission/agent.js

@@ -7,8 +7,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                 extend: {
                     index_url: 'commission/agent/index' + location.search,
                     add_url: '',
-                    edit_url: 'commission/agent/edit',
-                    del_url: 'commission/agent/del',
                     multi_url: 'commission/agent/multi',
                     import_url: 'commission/agent/import',
                     table: 'commission_agent',
@@ -89,30 +87,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                                      table.bootstrapTable('refresh');
                                  }
                              },
-                             {
-                                 name: 'edit_status',
-                                 text: __('编辑状态'),
-                                 title: __('编辑状态'),
-                                 classname: 'btn btn-xs btn-success btn-click',
-                                 icon: 'fa fa-edit',
-                                 click: function (data) {
-                                     Layer.prompt({
-                                         title: '修改状态',
-                                         formType: 2,
-                                         value: data.status,
-                                         select: ['normal', 'pending', 'freeze', 'forbidden', 'reject'],
-                                         selectTips: ['正常', '审核中', '冻结', '禁用', '拒绝']
-                                     }, function(value, index, elem) {
-                                         Fast.api.ajax({
-                                             url: 'commission/agent/edit',
-                                             data: {ids: data.user_id, status: value}
-                                         }, function(data, ret) {
-                                             table.bootstrapTable('refresh');
-                                             Layer.close(index);
-                                         });
-                                     });
-                                 }
-                             }
                          ], 
                          formatter: Table.api.formatter.operate}
                     ]