xxxrrrdddd 3 years ago
parent
commit
c601c49e2a

+ 1 - 1
application/admin/controller/Mobile.php

@@ -68,7 +68,7 @@ class Mobile extends Backend
             list($where, $sort, $order, $offset, $limit) = $this->buildindexparams();
 
             $list = $this->model
-                    ->with('info')
+                    ->with(['info','proxy'])
                     ->where($where)
                     ->order($sort, $order)
                     ->paginate($limit);

+ 3 - 0
application/admin/model/Mobile.php

@@ -14,4 +14,7 @@ class Mobile extends \app\common\model\Mobile
     {
         return parent::info()->setEagerlyType(0); // TODO: Change the autogenerated stub
     }
+    public function proxy(){
+        return $this->belongsTo(Admin::class,'proxy_id')->setEagerlyType(0);
+    }
 }

+ 1 - 1
application/admin/view/auth/proxy/index.html

@@ -10,7 +10,7 @@
                     </div>
                     <table id="table" class="table table-striped table-bordered table-hover" 
                            data-operate-edit="{:$auth->check('auth/proxy/edit')}"
-                           data-operate-del="{:$auth->check('auth/proxy/del')}"
+                           data-operate-del="0"
                            width="100%">
                     </table>
                 </div>

+ 4 - 0
application/common/model/Mobile.php

@@ -2,6 +2,7 @@
 
 namespace app\common\model;
 
+use app\admin\model\Admin;
 use app\common\service\MobileComputer;
 use think\Model;
 use traits\model\SoftDelete;
@@ -25,6 +26,9 @@ class Mobile extends Model
     public function info(){
         return $this->hasOne(MobileInfo::class);
     }
+    public function proxy(){
+        return $this->belongsTo(Admin::class,'proxy_id');
+    }
 
 
 

+ 5 - 5
public/assets/js/backend/mobile.js

@@ -35,12 +35,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {field: 'province', title: __('Province')},
                         {field: 'city', title: __('归属地')},
                         {field: 'network', title: __('运营商'),formatter: Table.api.formatter.label},
-                        {field: 'proxy', title: __('代理商'),formatter: Table.api.formatter.label},
+                        {field: 'proxy.nickname', title: __('代理商'),formatter: Table.api.formatter.label},
                         {field: 'brand', title: __('卡品牌'),formatter: Table.api.formatter.label},
                         {field: 'rules', title: __('规律'),searchList: Object.keys(filters),formatter(a){
                             return a.join('<br>')
                             }},
-                        {field: 'info.describe', title: __('套餐信息'),operate: "like"},
+                        {field: 'info.describe', title: __('套餐信息'),operate: "like",formatter: Table.api.formatter.content,width: 300},
                         {field: 'amount_original', title: __('Amount_original'), operate:'BETWEEN'},
                         {field: 'amount_di', title: __('底价'), operate:'BETWEEN'},
                         {field: 'amount', title: __('Amount'), operate:'BETWEEN'},
@@ -88,9 +88,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false,formatter: Table.api.formatter.datetime},
                         {field: 'create_time', title: __('上架时间'), operate:'RANGE', addclass:'datetimerange', autocomplete:false,formatter: Table.api.formatter.datetime},
                         {field: 'sort', title: __('Sort'),operate: "BETWEEN"},
-                        {field: 'sort', title: __('预占通道'),operate: "="},
-                        {field: 'sort', title: __('预占用户ID'),operate: "="},
-                        {field: 'sort', title: __('上传用户'),operate: "="},
+                        {field: 'hold_chan', title: __('预占通道'),operate: "="},
+                        {field: 'hold_user', title: __('预占用户ID'),operate: "="},
+                        {field: 'proxy_id', title: __('上传用户'),operate: "="},
 
                         /*{field: 'name', title: __('Name')},
                         {field: 'type', title: __('Type'),formatter: Table.api.formatter.label,searchList:no_type},

+ 2 - 2
public/assets/js/require-table.js

@@ -652,8 +652,8 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
                     return html.join(' ');
                 },
                 content: function (value, row, index) {
-                    var width = this.width != undefined ? (this.width.match(/^\d+$/) ? this.width + "px" : this.width) : "250px";
-                    return "<div style='white-space: nowrap; text-overflow:ellipsis; overflow: hidden; max-width:" + width + ";'>" + value + "</div>";
+                    var width = this.width != undefined ? ((/^\d+$/.test(this.width)) ? this.width + "px" : this.width) : "250px";
+                    return "<div title='"+value+"' style='white-space: normal;word-wrap: break-word; text-overflow:ellipsis; overflow: hidden; max-width:" + width + ";'>" + value + "</div>";
                 },
                 status: function (value, row, index) {
                     var custom = {normal: 'success', hidden: 'gray', deleted: 'danger', locked: 'info'};