作者 lyh

gx

@@ -117,33 +117,4 @@ class LoginController extends BaseController @@ -117,33 +117,4 @@ class LoginController extends BaseController
117 $this->response('success',Code::SUCCESS,$str); 117 $this->response('success',Code::SUCCESS,$str);
118 } 118 }
119 119
120 - public function ceshi(){  
121 - $templateModel = new TemplateModule();  
122 - $imageModel = new Image();  
123 - $list = $templateModel->list([],'id',['image']);  
124 - $data = [];  
125 - foreach ($list as $v){  
126 - $v['image'] = basename($v['image']);  
127 - if(!isset($data[$v['image']])){  
128 - $info = $imageModel->read(['hash'=>$v['image']]);  
129 - if($info !== false){  
130 - $data[$v['image']] = $v['image'];  
131 - $param = [  
132 - 'size'=>$info['size'],  
133 - 'path'=>$info['path'],  
134 - 'hash'=>$info['hash'],  
135 - 'type'=>$info['type'],  
136 - 'mime'=>$info['mime'],  
137 - 'created_at'=>date('Y-m-d H:i:s'),  
138 - 'updated_at'=>date('Y-m-d H:i:s')  
139 - ];  
140 - var_dump("cp /www/wwwroot/develop.globalso.com/public/upload{$info['path']} /www/wwwroot/develop.globalso.com/public/uploads{$info['path']}");  
141 - die();  
142 - shell_exec("cp /www/wwwroot/develop.globalso.com/public/upload{$info['path']} /www/wwwroot/develop.globalso.com/public/uploads{$info['path']}");  
143 - $rs = DB::table('gl_images')->insert($param);  
144 - }  
145 - }  
146 - }  
147 - return 1;  
148 - }  
149 } 120 }
@@ -7,6 +7,7 @@ use App\Enums\Common\Code; @@ -7,6 +7,7 @@ use App\Enums\Common\Code;
7 use App\Http\Controllers\Bside\BaseController; 7 use App\Http\Controllers\Bside\BaseController;
8 use App\Http\Logic\Bside\Nav\NavLogic; 8 use App\Http\Logic\Bside\Nav\NavLogic;
9 use App\Http\Requests\Bside\Nav\NavRequest; 9 use App\Http\Requests\Bside\Nav\NavRequest;
  10 +use App\Models\BNav;
10 11
11 /** 12 /**
12 * 导航栏目 b端编辑 c端显示 13 * 导航栏目 b端编辑 c端显示
@@ -26,8 +27,17 @@ class NavController extends BaseController @@ -26,8 +27,17 @@ class NavController extends BaseController
26 * @author:dc 27 * @author:dc
27 * @time 2023/5/8 16:37 28 * @time 2023/5/8 16:37
28 */ 29 */
29 - public function index(){  
30 - return $this->success(NavLogic::instance()->list()); 30 + public function index(BNav $nav){
  31 + $lists = $nav->list($this->map);
  32 + $data = array();
  33 + foreach ($lists as $v){
  34 + $v = (array)$v;
  35 + if ($v['pid'] == 0) {
  36 + $v['sub'] = _get_child($v['id'], $lists);
  37 + $data[] = $v;
  38 + }
  39 + }
  40 + $this->response('success',Code::SUCCESS,$data);
31 } 41 }
32 42
33 43
@@ -23,24 +23,6 @@ class NavLogic extends BaseLogic @@ -23,24 +23,6 @@ class NavLogic extends BaseLogic
23 $this->model = new BNav(); 23 $this->model = new BNav();
24 } 24 }
25 25
26 - /**  
27 - * @return array  
28 - * @author:dc  
29 - * @time 2023/5/12 9:23  
30 - */  
31 - public function list(){  
32 - $where = [];  
33 - if(!empty($this->requestAll['location'])){  
34 - $where[] = ['location','=',$this->requestAll['location']];  
35 - }  
36 - $lists = $this->getList($where,['sort'=>'asc'],['*'],false);  
37 - $isTree = $this->requestAll['tree']??false;  
38 - if($isTree){  
39 - $lists = list_to_tree($lists);  
40 - }  
41 - return $lists;  
42 - }  
43 -  
44 26
45 public function navSave() 27 public function navSave()
46 { 28 {