diff --git a/app/Common/function.php b/app/Common/function.php index e89110f..502a762 100644 --- a/app/Common/function.php +++ b/app/Common/function.php @@ -152,12 +152,12 @@ function get_front_url($param='') //搜索关键词页面 $url .= '/s'.$param['searchid']; } - else if($param['type'] == 'productlist') + else if($param['type'] == 'goodslist') { //商品列表页 $url .= '/product'.$param['catid']; } - else if($param['type'] == 'productdetail') + else if($param['type'] == 'goodsdetail') { //商品内容页 $url .= '/goods/'.$param['id']; @@ -196,12 +196,12 @@ function get_wap_front_url(array $param) //tags页面 $url .= '/s'.$param['searchid']; } - else if($param['type'] == 'productlist') + else if($param['type'] == 'goodslist') { //商品列表页 $url .= '/product'.$param['catid']; } - else if($param['type'] == 'productdetail') + else if($param['type'] == 'goodsdetail') { //商品内容页 $url .= '/goods/'.$param['id']; diff --git a/app/Http/Controllers/Api/QrcodeController.php b/app/Http/Controllers/Api/QrcodeController.php index 00d09d5..b9a1103 100644 --- a/app/Http/Controllers/Api/QrcodeController.php +++ b/app/Http/Controllers/Api/QrcodeController.php @@ -6,7 +6,7 @@ use Illuminate\Http\Request; use App\Common\ReturnData; use App\Common\Helper; -//二维码 +//二维码,如果输出乱码就转成base64输出 class QrcodeController extends CommonController { public function __construct() @@ -22,4 +22,17 @@ class QrcodeController extends CommonController return ''; } + + //二维码 + public function qrcode() + { + $url = $_REQUEST['url']; + + $url = str_replace("%26","&",$url); + $url = str_replace("%3F","?",$url); + $url = str_replace("%3D","=",$url); + + require_once base_path('resources/org/phpqrcode').'/phpqrcode.php'; + return \QRcode::png($url,false,"H",6); + } } \ No newline at end of file diff --git a/app/Http/Controllers/Home/IndexController.php b/app/Http/Controllers/Home/IndexController.php index 456a507..8dbed5d 100644 --- a/app/Http/Controllers/Home/IndexController.php +++ b/app/Http/Controllers/Home/IndexController.php @@ -184,22 +184,22 @@ class IndexController extends CommonController } //商品列表页 - public function productcat($cat, $page=0) + public function goodstype($cat, $page=0) { $pagenow = $page; if(empty($cat) || !preg_match('/[0-9]+/',$cat)){return redirect()->route('page404');} - $post = object_to_array(DB::table('product_type')->where('id', $cat)->first(), 1);if(empty($post)){return redirect()->route('page404');} + $post = object_to_array(DB::table('goods_type')->where('id', $cat)->first(), 1);if(empty($post)){return redirect()->route('page404');} $data['post'] = $post; $subcat=""; - $post2 = object_to_array(DB::table('product_type')->select('id')->where('pid', $cat)->get()); + $post2 = object_to_array(DB::table('goods_type')->select('id')->where('pid', $cat)->get()); if(!empty($post2)){foreach($post2 as $row){$subcat=$subcat."typeid=".$row["id"]." or ";}} $subcat=$subcat."typeid=".$cat; $data['sql'] = $subcat; - $counts = DB::table("product")->whereRaw($subcat)->count(); + $counts = DB::table("goods")->whereRaw($subcat)->count(); if($counts>sysconfig('CMS_MAXARC')){$counts=sysconfig('CMS_MAXARC');dd($counts);} $pagesize = sysconfig('CMS_PAGESIZE');$page=0; if($counts % $pagesize){//取总数据量除以每页数的余数 @@ -211,8 +211,8 @@ class IndexController extends CommonController $data['counts'] = $counts; $start = $page*$pagesize; - $data['posts'] = arclist(array("table"=>"product","sql"=>$subcat, "limit"=>"$start,$pagesize")); //获取列表 - $data['pagenav'] = get_listnav(array("counts"=>$counts,"pagesize"=>$pagesize,"pagenow"=>$page+1,"catid"=>$cat,"urltype"=>"product")); //获取分页列表 + $data['posts'] = arclist(array("table"=>"goods","sql"=>$subcat, "limit"=>"$start,$pagesize")); //获取列表 + $data['pagenav'] = get_listnav(array("counts"=>$counts,"pagesize"=>$pagesize,"pagenow"=>$page+1,"catid"=>$cat,"urltype"=>"goods")); //获取分页列表 if($post['templist']=='category2'){if(!empty($pagenow)){return redirect()->route('page404');}} @@ -220,11 +220,11 @@ class IndexController extends CommonController } //商品详情页 - public function product($id) + public function goods($id) { if(empty($id) || !preg_match('/[0-9]+/',$id)){return redirect()->route('page404');} - $post = object_to_array(DB::table('product')->where('id', $id)->first(), 1);if(empty($post)){return redirect()->route('page404');}$post['name'] = DB::table('product_type')->where('id', $post['typeid'])->value('name'); + $post = object_to_array(DB::table('goods')->where('id', $id)->first(), 1);if(empty($post)){return redirect()->route('page404');}$post['name'] = DB::table('goods_type')->where('id', $post['typeid'])->value('name'); if($post) { $cat = $post['typeid']; @@ -239,7 +239,7 @@ class IndexController extends CommonController return redirect()->route('page404'); } - $post = object_to_array(DB::table('product_type')->where('id', $cat)->first(), 1); + $post = object_to_array(DB::table('goods_type')->where('id', $cat)->first(), 1); return view('home.index.'.$post['temparticle'], $data); } diff --git a/resources/views/home/index/product.blade.php b/resources/views/home/index/goods.blade.php similarity index 83% rename from resources/views/home/index/product.blade.php rename to resources/views/home/index/goods.blade.php index 6d1b8d2..99e27e5 100644 --- a/resources/views/home/index/product.blade.php +++ b/resources/views/home/index/goods.blade.php @@ -3,11 +3,11 @@ @include('home.common.header')
@@ -18,8 +18,8 @@
@include('home.common.footer') \ No newline at end of file diff --git a/resources/views/home/index/productcat.blade.php b/resources/views/home/index/goodscat.blade.php similarity index 100% rename from resources/views/home/index/productcat.blade.php rename to resources/views/home/index/goodscat.blade.php diff --git a/resources/views/home/index/index.blade.php b/resources/views/home/index/index.blade.php index 75918fe..ce18262 100644 --- a/resources/views/home/index/index.blade.php +++ b/resources/views/home/index/index.blade.php @@ -77,7 +77,7 @@
-

案例中心/Case Show

+

案例中心 / Case Show

我们在这里展示了许多精美的案例,欢迎欣赏。


diff --git a/resources/views/home/index/test.blade.php b/resources/views/home/index/test.blade.php index 37d01f4..33bebab 100644 --- a/resources/views/home/index/test.blade.php +++ b/resources/views/home/index/test.blade.php @@ -3,6 +3,6 @@
{{ csrf_field() }} - +
\ No newline at end of file