qifengquan 1 year ago
parent
commit
37d2cde0b2

+ 3 - 1
application/admin/controller/user/authentication/Education.php

@@ -3,6 +3,7 @@
 namespace app\admin\controller\user\authentication;
 
 use app\common\controller\Backend;
+use app\common\model\Category;
 use app\common\model\SystemMessages;
 use app\common\model\User;
 use think\Db;
@@ -55,6 +56,7 @@ class Education extends Backend
         }
         [$where, $sort, $order, $offset, $limit] = $this->buildparams();
         $list = $this->model
+            ->with('educationCategory')
             ->where($where)
             ->whereIn('status','0,1,2')
             ->order($sort, $order)
@@ -73,7 +75,7 @@ class Education extends Backend
      */
     public function audit($ids = null)
     {
-        $row = $this->model->get($ids);
+        $row = $this->model->get($ids,['educationCategory']);
         if (!$row) {
             $this->error(__('No Results were found'));
         }

+ 1 - 1
application/admin/view/user/authentication/education/audit.html

@@ -9,7 +9,7 @@
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Education')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-education" class="form-control" name="row[education]" type="text" value="{$row.education|htmlentities}" disabled="disabled">
+            <input id="c-education" class="form-control" name="row[education]" type="text" value="{$row.educationCategory.name|htmlentities}" disabled="disabled">
         </div>
     </div>
     <div class="form-group">

+ 1 - 1
public/assets/js/backend/user/authentication/education.js

@@ -29,7 +29,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {checkbox: true},
                         {field: 'id', title: __('Id')},
                         // {field: 'uid', title: __('Uid')},
-                        {field: 'education', title: __('Education'), operate: 'LIKE'},
+                        {field: 'educationCategory.name', title: __('Education'), operate: 'LIKE'},
                         {field: 'school', title: __('School'), operate: 'LIKE'},
                         {field: 'authentication_method', title: __('Authentication_method'), operate: 'LIKE'},
                         {field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},