作者 lyh

gx

... ... @@ -117,33 +117,4 @@ class LoginController extends BaseController
$this->response('success',Code::SUCCESS,$str);
}
public function ceshi(){
$templateModel = new TemplateModule();
$imageModel = new Image();
$list = $templateModel->list([],'id',['image']);
$data = [];
foreach ($list as $v){
$v['image'] = basename($v['image']);
if(!isset($data[$v['image']])){
$info = $imageModel->read(['hash'=>$v['image']]);
if($info !== false){
$data[$v['image']] = $v['image'];
$param = [
'size'=>$info['size'],
'path'=>$info['path'],
'hash'=>$info['hash'],
'type'=>$info['type'],
'mime'=>$info['mime'],
'created_at'=>date('Y-m-d H:i:s'),
'updated_at'=>date('Y-m-d H:i:s')
];
var_dump("cp /www/wwwroot/develop.globalso.com/public/upload{$info['path']} /www/wwwroot/develop.globalso.com/public/uploads{$info['path']}");
die();
shell_exec("cp /www/wwwroot/develop.globalso.com/public/upload{$info['path']} /www/wwwroot/develop.globalso.com/public/uploads{$info['path']}");
$rs = DB::table('gl_images')->insert($param);
}
}
}
return 1;
}
}
... ...
... ... @@ -7,6 +7,7 @@ use App\Enums\Common\Code;
use App\Http\Controllers\Bside\BaseController;
use App\Http\Logic\Bside\Nav\NavLogic;
use App\Http\Requests\Bside\Nav\NavRequest;
use App\Models\BNav;
/**
* 导航栏目 b端编辑 c端显示
... ... @@ -26,8 +27,17 @@ class NavController extends BaseController
* @author:dc
* @time 2023/5/8 16:37
*/
public function index(){
return $this->success(NavLogic::instance()->list());
public function index(BNav $nav){
$lists = $nav->list($this->map);
$data = array();
foreach ($lists as $v){
$v = (array)$v;
if ($v['pid'] == 0) {
$v['sub'] = _get_child($v['id'], $lists);
$data[] = $v;
}
}
$this->response('success',Code::SUCCESS,$data);
}
... ...
... ... @@ -23,24 +23,6 @@ class NavLogic extends BaseLogic
$this->model = new BNav();
}
/**
* @return array
* @author:dc
* @time 2023/5/12 9:23
*/
public function list(){
$where = [];
if(!empty($this->requestAll['location'])){
$where[] = ['location','=',$this->requestAll['location']];
}
$lists = $this->getList($where,['sort'=>'asc'],['*'],false);
$isTree = $this->requestAll['tree']??false;
if($isTree){
$lists = list_to_tree($lists);
}
return $lists;
}
public function navSave()
{
... ...