From 9fcc3537e0fc87b5efcc919c30824f2b03c7901e Mon Sep 17 00:00:00 2001 From: Fanli2 <374861669@qq.com> Date: Mon, 14 Sep 2020 14:50:51 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=9F=E5=88=97=EF=BC=8C=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E7=9B=91=E5=90=AC=EF=BC=8C=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 2 +- .gitignore | 27 +- API文档.html | 4 +- README.md | 4 +- README.txt | 2 +- app/Common/function.php | 26 +- app/Console/Commands/SendEmail.php | 36 + app/Console/Commands/UnpayOrderSetInvalid.php | 38 + app/Console/Kernel.php | 22 +- app/Events/Event.php | 8 + app/Events/OrderShipped.php | 25 + .../Controllers/Admin/AdminController.php | 4 +- .../Controllers/Admin/AdminRoleController.php | 2 +- .../Controllers/Admin/ArticleController.php | 412 +- app/Http/Controllers/Admin/BaseController.php | 90 + .../Controllers/Admin/BonusController.php | 2 +- .../Controllers/Admin/CategoryController.php | 2 +- .../Controllers/Admin/CommonController.php | 128 +- .../Controllers/Admin/FeedbackController.php | 2 +- .../Admin/FriendlinkController.php | 2 +- .../Admin/GoodsBrandController.php | 3 +- .../Controllers/Admin/GoodsController.php | 7 +- .../Controllers/Admin/GoodstypeController.php | 3 +- .../Controllers/Admin/GuestbookController.php | 3 +- .../Controllers/Admin/IndexController.php | 6 +- .../Controllers/Admin/KeywordController.php | 3 +- .../Controllers/Admin/KuaidiController.php | 2 +- app/Http/Controllers/Admin/LogController.php | 117 + .../Controllers/Admin/LoginController.php | 25 +- app/Http/Controllers/Admin/MenuController.php | 2 +- .../Controllers/Admin/OrderController.php | 2 +- app/Http/Controllers/Admin/PageController.php | 2 +- .../Controllers/Admin/SearchController.php | 2 +- .../Admin/SearchwordController.php | 2 +- .../Controllers/Admin/SlideController.php | 2 +- .../Controllers/Admin/SysconfigController.php | 2 +- app/Http/Controllers/Admin/TagController.php | 2 +- app/Http/Controllers/Admin/UserController.php | 2 +- .../Controllers/Admin/UserRankController.php | 2 +- .../Admin/UserWithdrawController.php | 2 +- .../Admin/WeixinMenuController.php | 2 +- .../Controllers/Api/ArctypeController.php | 2 +- .../Controllers/Api/ArticleController.php | 2 +- app/Http/Controllers/Api/BaseController.php | 10 + app/Http/Controllers/Api/BonusController.php | 2 +- app/Http/Controllers/Api/CartController.php | 2 +- .../Api/CollectGoodsController.php | 2 +- .../Controllers/Api/CommentController.php | 2 +- app/Http/Controllers/Api/CommonController.php | 32 + .../Controllers/Api/FeedBackController.php | 2 +- .../Controllers/Api/GoodsBrandController.php | 2 +- app/Http/Controllers/Api/GoodsController.php | 2 +- .../Api/GoodsSearchwordController.php | 2 +- .../Controllers/Api/GoodsTypeController.php | 2 +- app/Http/Controllers/Api/ImageController.php | 2 +- app/Http/Controllers/Api/IndexController.php | 2 +- app/Http/Controllers/Api/NotifyController.php | 2 +- app/Http/Controllers/Api/OrderController.php | 2 +- app/Http/Controllers/Api/PageController.php | 2 +- .../Controllers/Api/PaymentController.php | 2 +- .../Api/PaymentNotifyController.php | 2 +- app/Http/Controllers/Api/QrcodeController.php | 2 +- app/Http/Controllers/Api/RegionController.php | 2 +- app/Http/Controllers/Api/SlideController.php | 2 +- .../Controllers/Api/UserAddressController.php | 2 +- .../Controllers/Api/UserBonusController.php | 2 +- app/Http/Controllers/Api/UserController.php | 2 +- .../Api/UserGoodsHistoryController.php | 2 +- .../Controllers/Api/UserMessageController.php | 2 +- .../Controllers/Api/UserMoneyController.php | 2 +- .../Controllers/Api/UserPointController.php | 2 +- .../Api/UserRechargeController.php | 2 +- .../Api/UserWithdrawController.php | 2 +- .../Controllers/Api/VerifyCodeController.php | 2 +- app/Http/Controllers/Controller.php | 72 +- .../Controllers/Home/ArticleController.php | 114 + app/Http/Controllers/Home/BaseController.php | 11 + .../Controllers/Home/CommonController.php | 35 + app/Http/Controllers/Home/GoodsController.php | 107 + app/Http/Controllers/Home/IndexController.php | 698 +-- .../Home/IndexController企业.php | 530 +- app/Http/Controllers/Home/PageController.php | 43 + .../Controllers/Home/SearchController.php | 526 ++ app/Http/Controllers/Home/TagController.php | 526 ++ app/Http/Controllers/Home/TestController.php | 317 +- .../Controllers/Wap/ArticleController.php | 126 + app/Http/Controllers/Wap/BaseController.php | 11 + app/Http/Controllers/Wap/CommonController.php | 33 + app/Http/Controllers/Wap/GoodsController.php | 108 + app/Http/Controllers/Wap/IndexController.php | 515 +- app/Http/Controllers/Wap/PageController.php | 42 + .../Controllers/Weixin/AddressController.php | 105 +- .../Controllers/Weixin/ArticleController.php | 98 +- .../Controllers/Weixin/BaseController.php | 14 + .../Controllers/Weixin/BonusController.php | 2 +- .../Controllers/Weixin/CartController.php | 2 +- .../Weixin/CollectGoodsController.php | 2 +- .../Controllers/Weixin/CommonController.php | 78 +- .../Controllers/Weixin/FeedbackController.php | 11 +- .../Weixin/GoodsBrandController.php | 37 +- .../Controllers/Weixin/GoodsController.php | 176 +- .../Controllers/Weixin/IndexController.php | 399 +- .../Controllers/Weixin/OrderController.php | 316 +- .../Controllers/Weixin/UserController.php | 814 +-- .../Controllers/Weixin/WxPayController.php | 25 +- app/Http/Logic/LogLogic.php | 153 + app/Http/Middleware/CheckLogin.php | 20 +- app/Http/Middleware/Sign.php | 15 +- app/Http/Middleware/WxLogin.php | 17 +- app/Http/Model/Access.php | 8 +- app/Http/Model/Admin.php | 8 +- app/Http/Model/AdminRole.php | 8 +- app/Http/Model/Arctype.php | 8 +- app/Http/Model/Article.php | 8 +- app/Http/Model/Bonus.php | 8 +- app/Http/Model/Cart.php | 8 +- app/Http/Model/CollectGoods.php | 8 +- app/Http/Model/Comment.php | 8 +- app/Http/Model/FeedBack.php | 8 +- app/Http/Model/Friendlink.php | 8 +- app/Http/Model/Goods.php | 8 +- app/Http/Model/GoodsBrand.php | 8 +- app/Http/Model/GoodsImg.php | 8 +- app/Http/Model/GoodsSearchword.php | 8 +- app/Http/Model/GoodsType.php | 8 +- app/Http/Model/Guestbook.php | 8 +- app/Http/Model/Jobs.php | 164 + app/Http/Model/Keyword.php | 8 +- app/Http/Model/Kuaidi.php | 8 +- app/Http/Model/Log.php | 223 + app/Http/Model/Menu.php | 206 +- app/Http/Model/Order.php | 8 +- app/Http/Model/OrderGoods.php | 8 +- app/Http/Model/Page.php | 8 +- app/Http/Model/Payment.php | 8 +- app/Http/Model/Region.php | 8 +- app/Http/Model/Searchword.php | 8 +- app/Http/Model/Slide.php | 8 +- app/Http/Model/SmsLog.php | 8 +- app/Http/Model/Sysconfig.php | 8 +- app/Http/Model/Tagindex.php | 8 +- app/Http/Model/Taglist.php | 8 +- app/Http/Model/User.php | 8 +- app/Http/Model/UserAddress.php | 8 +- app/Http/Model/UserBonus.php | 8 +- app/Http/Model/UserGoodsHistory.php | 8 +- app/Http/Model/UserMessage.php | 8 +- app/Http/Model/UserMoney.php | 8 +- app/Http/Model/UserPoint.php | 8 +- app/Http/Model/UserRecharge.php | 8 +- app/Http/Model/UserRole.php | 8 +- app/Http/Model/UserWithdraw.php | 8 +- app/Http/Model/VerifyCode.php | 8 +- app/Http/Model/WeixinMenu.php | 8 +- app/Http/Requests/AdminRequest.php | 14 +- app/Http/Requests/LogRequest.php | 108 + app/Jobs/Example.php | 61 + app/Jobs/Job.php | 21 + app/Listeners/.gitkeep | 0 app/Listeners/SendShipmentNotification.php | 31 + .../SendShipmentNotificationQueue.php | 37 + app/Providers/EventServiceProvider.php | 5 + composer.json | 11 +- composer.lock | 4549 ----------------- config/queue.php | 4 +- lqycms.sql | 119 +- .../views/admin/UserWithdraw/add.blade.php | 64 - .../views/admin/UserWithdraw/edit.blade.php | 67 - resources/views/admin/admin/edit.blade.php | 2 +- resources/views/admin/admin/edit222.blade.php | 58 - resources/views/admin/admin/index.blade.php | 4 +- resources/views/admin/common/header.blade.php | 2 +- resources/views/admin/index/index.blade.php | 2 +- resources/views/admin/log/index.blade.php | 50 + .../home/{index => article}/detail.blade.php | 0 .../index.blade.php} | 0 .../brand_list.blade.php} | 4 +- .../detail.blade.php} | 0 .../index.blade.php} | 0 resources/views/home/index/index.blade.php | 10 +- .../page.blade.php => page/detail.blade.php} | 0 .../views/home企业/index/test.blade.php | 2 +- .../wap/{index => article}/detail.blade.php | 0 .../index.blade.php} | 0 resources/views/wap/common/header.blade.php | 8 +- .../detail.blade.php} | 0 .../index.blade.php} | 0 resources/views/wap/index/category2.blade.php | 57 - .../page.blade.php => page/detail.blade.php} | 0 resources/views/weixin/index/test.blade.php | 2 +- routes/web.php | 40 +- 191 files changed, 5925 insertions(+), 7569 deletions(-) create mode 100644 app/Console/Commands/SendEmail.php create mode 100644 app/Console/Commands/UnpayOrderSetInvalid.php create mode 100644 app/Events/Event.php create mode 100644 app/Events/OrderShipped.php create mode 100644 app/Http/Controllers/Admin/BaseController.php create mode 100644 app/Http/Controllers/Admin/LogController.php create mode 100644 app/Http/Controllers/Api/BaseController.php create mode 100644 app/Http/Controllers/Home/ArticleController.php create mode 100644 app/Http/Controllers/Home/BaseController.php create mode 100644 app/Http/Controllers/Home/GoodsController.php create mode 100644 app/Http/Controllers/Home/PageController.php create mode 100644 app/Http/Controllers/Home/SearchController.php create mode 100644 app/Http/Controllers/Home/TagController.php create mode 100644 app/Http/Controllers/Wap/ArticleController.php create mode 100644 app/Http/Controllers/Wap/BaseController.php create mode 100644 app/Http/Controllers/Wap/GoodsController.php create mode 100644 app/Http/Controllers/Wap/PageController.php create mode 100644 app/Http/Controllers/Weixin/BaseController.php create mode 100644 app/Http/Logic/LogLogic.php create mode 100644 app/Http/Model/Jobs.php create mode 100644 app/Http/Model/Log.php create mode 100644 app/Http/Requests/LogRequest.php create mode 100644 app/Jobs/Example.php create mode 100644 app/Jobs/Job.php create mode 100644 app/Listeners/.gitkeep create mode 100644 app/Listeners/SendShipmentNotification.php create mode 100644 app/Listeners/SendShipmentNotificationQueue.php delete mode 100644 composer.lock delete mode 100644 resources/views/admin/UserWithdraw/add.blade.php delete mode 100644 resources/views/admin/UserWithdraw/edit.blade.php delete mode 100644 resources/views/admin/admin/edit222.blade.php create mode 100644 resources/views/admin/log/index.blade.php rename resources/views/home/{index => article}/detail.blade.php (100%) rename resources/views/home/{index/arclist.blade.php => article/index.blade.php} (100%) rename resources/views/home/{index/brandList.blade.php => goods/brand_list.blade.php} (94%) rename resources/views/home/{index/goods.blade.php => goods/detail.blade.php} (100%) rename resources/views/home/{index/goodslist.blade.php => goods/index.blade.php} (100%) rename resources/views/home/{index/page.blade.php => page/detail.blade.php} (100%) rename resources/views/wap/{index => article}/detail.blade.php (100%) rename resources/views/wap/{index/category.blade.php => article/index.blade.php} (100%) rename resources/views/wap/{index/product.blade.php => goods/detail.blade.php} (100%) rename resources/views/wap/{index/productcat.blade.php => goods/index.blade.php} (100%) delete mode 100644 resources/views/wap/index/category2.blade.php rename resources/views/wap/{index/page.blade.php => page/detail.blade.php} (100%) diff --git a/.env.example b/.env.example index 740cabd..a7ac333 100644 --- a/.env.example +++ b/.env.example @@ -6,7 +6,7 @@ APP_LOG_LEVEL=debug APP_URL=http://www.lqycms.com APP_DOMAIN=www.lqycms.com APP_SUBDOMAIN=m.lqycms.com -APP_API_URL=http://www.lqycms.com/dataapi +APP_API_URL=http://www.lqycms.com/api APP_WEIXIN_URL=http://www.lqycms.com/weixin DB_CONNECTION=mysql diff --git a/.gitignore b/.gitignore index ab03834..6777458 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,18 @@ -/node_modules -/public/hot -/public/storage -/storage -/vendor -/public/uploads -/.idea -/.vagrant Homestead.json Homestead.yaml -npm-debug.log + +public/uploads +.idea +.vagrant +.git +node_modules +.svn +build +.project +.settings +release +composer.lock +*.log +vendor +.vscode .env -/.svn -/build -/.project \ No newline at end of file diff --git a/API文档.html b/API文档.html index a12a1c7..082aff6 100644 --- a/API文档.html +++ b/API文档.html @@ -5382,7 +5382,7 @@ api_url - http://www.lqycms.com/dataapi + http://www.lqycms.com/api
线上环境
@@ -5399,7 +5399,7 @@ - +
api_urlhttp://www.lqycms.com/dataapihttp://www.lqycms.com/api
diff --git a/README.md b/README.md index 3889ac5..ea6940b 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ WAP端 2、PHP+Mysql -3、后台登录:http://www.lqycms.com/fladmin/login,账号:admin888,密码:admin +3、后台登录:http://www.lqycms.com/fladmin/login,账号:admin888,密码:123456 4、恢复后台默认账号密码:http://www.lqycms.com/fladmin/recoverpwd @@ -95,7 +95,7 @@ php composer.phar install php artisan key:generate -4、 登录后台:http://www.lqycms.com/fladmin/login,账号:admin888,密码:admin +4、 登录后台:http://www.lqycms.com/fladmin/login,账号:admin888,密码:123456 顶部按钮,更新缓存 diff --git a/README.txt b/README.txt index 543cca1..749f2e2 100644 --- a/README.txt +++ b/README.txt @@ -27,7 +27,7 @@ echo hello > .env php composer.phar install php artisan key:generate -4 ¼̨->ť»棺/fladmin/login.php˺ţadmin888룺admin +4 ¼̨->ť»棺/fladmin/login.php˺ţadmin888룺123456 ע diff --git a/app/Common/function.php b/app/Common/function.php index e8ed61e..653540d 100644 --- a/app/Common/function.php +++ b/app/Common/function.php @@ -1044,22 +1044,20 @@ function dir_delete($dir) //对象转数组 function object_to_array($object, $get=0) { - $res = ''; - if(!empty($object)) - { - if($get==0) - { - foreach($object as $key=>$value) - { - $res[$key] = (array)$value; - } - } - elseif($get==1) - { - $res = (array)$object; + $res = []; + if(empty($object)) { + return $res; + } + + if ($get==0) { + foreach ($object as $key=>$value) { + $res[$key] = (array)$value; } } - + elseif ($get==1) { + $res = (array)$object; + } + return $res; } diff --git a/app/Console/Commands/SendEmail.php b/app/Console/Commands/SendEmail.php new file mode 100644 index 0000000..f821cb6 --- /dev/null +++ b/app/Console/Commands/SendEmail.php @@ -0,0 +1,36 @@ +argument('user'); + + // 获取指定选项 + // $user_id = $this->option('user'); + } +} \ No newline at end of file diff --git a/app/Console/Commands/UnpayOrderSetInvalid.php b/app/Console/Commands/UnpayOrderSetInvalid.php new file mode 100644 index 0000000..1edb79d --- /dev/null +++ b/app/Console/Commands/UnpayOrderSetInvalid.php @@ -0,0 +1,38 @@ +where([['order_status', '=', 0], ['is_delete', '=', 0], ['add_time', '<', (time() - $timeout)]])->update(['order_status' => 2]); + Log::info('订单24小时未支付,设为无效订单:操作成功'); + } +} \ No newline at end of file diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 622e774..ceb97c0 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -2,30 +2,36 @@ namespace App\Console; +use DB; +use Log; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; class Kernel extends ConsoleKernel { - /** - * The Artisan commands provided by your application. - * + /** + * 应用提供的Artisan命令 + * * @var array */ protected $commands = [ - // + Commands\UnpayOrderSetInvalid::class, + Commands\SendEmail::class, ]; - /** - * Define the application's command schedule. + /** + * 定义应用的命令调度 * * @param \Illuminate\Console\Scheduling\Schedule $schedule * @return void */ protected function schedule(Schedule $schedule) { - // $schedule->command('inspire') - // ->hourly(); + Log::info('----Schedule----'); + // 使用 command 方法通过命令名或类来调度一个 Artisan 命令 + // $schedule->command('unpay_order_set_invalid')->hourly(); + // 使用 exec 命令可用于发送命令到操作系统 + // $schedule->exec('node /home/forge/script.js')->daily(); } /** diff --git a/app/Events/Event.php b/app/Events/Event.php new file mode 100644 index 0000000..ba2f888 --- /dev/null +++ b/app/Events/Event.php @@ -0,0 +1,8 @@ +order_id = $order_id; + \Log::info('----OrderShipped Event Init----'); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/Admin/AdminController.php b/app/Http/Controllers/Admin/AdminController.php index 75c03e9..5c1298f 100644 --- a/app/Http/Controllers/Admin/AdminController.php +++ b/app/Http/Controllers/Admin/AdminController.php @@ -7,7 +7,7 @@ use Illuminate\Http\Request; use App\Http\Logic\AdminLogic; use App\Http\Model\Admin; -class AdminController extends CommonController +class AdminController extends BaseController { public function __construct() { @@ -25,7 +25,7 @@ class AdminController extends CommonController $where = function ($query) use ($res) { if(isset($_REQUEST["keyword"])) { - $query->where('username', 'like', '%'.$_REQUEST['keyword'].'%'); + $query->where('name', 'like', '%'.$_REQUEST['keyword'].'%'); } if(isset($_REQUEST["role_id"])) diff --git a/app/Http/Controllers/Admin/AdminRoleController.php b/app/Http/Controllers/Admin/AdminRoleController.php index 9c8458b..251722b 100644 --- a/app/Http/Controllers/Admin/AdminRoleController.php +++ b/app/Http/Controllers/Admin/AdminRoleController.php @@ -7,7 +7,7 @@ use Illuminate\Http\Request; use App\Http\Logic\AdminRoleLogic; use App\Http\Model\AdminRole; -class AdminRoleController extends CommonController +class AdminRoleController extends BaseController { public function __construct() { diff --git a/app/Http/Controllers/Admin/ArticleController.php b/app/Http/Controllers/Admin/ArticleController.php index 03f1216..2d9a963 100644 --- a/app/Http/Controllers/Admin/ArticleController.php +++ b/app/Http/Controllers/Admin/ArticleController.php @@ -1,55 +1,53 @@ where('title', 'like', '%'.$_REQUEST['keyword'].'%'); - } - - if(isset($_REQUEST["typeid"]) && $_REQUEST["typeid"]!=0) - { - $query->where('typeid', $_REQUEST["typeid"]); - } - - if(isset($_REQUEST["id"])) - { - $query->where('typeid', $_REQUEST["id"]); - } - - if(isset($_REQUEST["ischeck"])) - { - $query->where('ischeck', $_REQUEST["ischeck"]); //未审核过的文章 - } + $res = ''; + $where = function ($query) use ($res) { + if (isset($_REQUEST["keyword"])) { + $query->where('title', 'like', '%' . $_REQUEST['keyword'] . '%'); + } + + if (isset($_REQUEST["typeid"]) && $_REQUEST["typeid"] != 0) { + $query->where('typeid', $_REQUEST["typeid"]); + } + + if (isset($_REQUEST["id"])) { + $query->where('typeid', $_REQUEST["id"]); + } + + if (isset($_REQUEST["ischeck"])) { + $query->where('ischeck', $_REQUEST["ischeck"]); //未审核过的文章 + } }; - + $posts = $this->getLogic()->getPaginate($where, array('id', 'desc')); - + $data['posts'] = $posts; - - return view('admin.article.index', $data); - + + return view('admin.article.index', $data); + //if(!empty($_GET["id"])){$id = $_GET["id"];}else {$id="";}if(preg_match('/[0-9]*/',$id)){}else{exit;} - + /* if(!empty($id)){$map['typeid']=$id;} $Article = M("Article")->field('id')->where($map); $counts = $Article->count(); @@ -70,202 +68,228 @@ class ArticleController extends CommonController $this->previouspage = $previouspage; $this->id = $id; $this->posts = $Article; */ - + //echo '
';
         //print_r($Article);
         //return $this->fetch();
     }
-    
+
     public function add()
     {
-		$data = '';
-		if(!empty($_REQUEST["catid"])){$data['catid'] = $_REQUEST["catid"];}else{$data['catid'] = 0;}
-		
+		$data['catid'] = 0;
+        if (isset($_REQUEST["catid"]) && $_REQUEST["catid"] > 0) {
+            $data['catid'] = $_REQUEST["catid"];
+        }
+
         return view('admin.article.add', $data);
     }
-    
+
     public function doadd()
     {
-        $litpic="";if(!empty($_POST["litpic"])){$litpic = $_POST["litpic"];}else{$_POST['litpic']="";} //缩略图
-        if(empty($_POST["description"])){if(!empty($_POST["body"])){$_POST['description']=cut_str($_POST["body"]);}} //description
-        $content="";if(!empty($_POST["body"])){$content = $_POST["body"];}
-        $_POST['user_id'] = $_SESSION['admin_user_info']['id']; // 发布者id
-        
-		//关键词
-        if(!empty($_POST["keywords"]))
-		{
-			$_POST['keywords']=str_replace(",",",",$_POST["keywords"]);
-		}
-		else
-		{
-			if(!empty($_POST["title"]))
-			{
-				$title=$_POST["title"];
-				$title=str_replace(",","",$title);
-				$title=str_replace(",","",$title);
-				$_POST['keywords']=get_keywords($title);//标题分词
-			}
-		}
-		
-		if(isset($_POST["dellink"]) && $_POST["dellink"]==1 && !empty($content)){$content=replacelinks($content,array(sysconfig('CMS_BASEHOST')));} //删除非站内链接
-		$_POST['body']=$content;
-		
-		//提取第一个图片为缩略图
-		if(isset($_POST["autolitpic"]) && $_POST["autolitpic"] && empty($litpic))
-		{
-			if(getfirstpic($content))
-			{
-				//获取文章内容的第一张图片
-				$imagepath = '.'.getfirstpic($content);
-				
-				//获取后缀名
-				preg_match_all ("/\/(.+)\.(gif|jpg|jpeg|bmp|png)$/iU",$imagepath,$out, PREG_PATTERN_ORDER);
-				
-				$saveimage='./uploads/'.date('Y/m',time()).'/'.basename($imagepath,'.'.$out[2][0]).'-lp.'.$out[2][0];
-				
-				//生成缩略图,按照原图的比例生成一个最大为240*180的缩略图
-				\Intervention\Image\Facades\Image::make($imagepath)->resize(sysconfig('CMS_IMGWIDTH'), sysconfig('CMS_IMGHEIGHT'))->save($saveimage);
-				
-				//缩略图路径
-				$_POST['litpic']='/uploads/'.date('Y/m',time()).'/'.basename($imagepath,'.'.$out[2][0]).'-lp.'.$out[2][0];
-			}
-		}
-
-		$res = $this->getLogic()->add($_POST);
-		if($res['code']==ReturnData::SUCCESS)
-		{
-			success_jump($res['msg'], route('admin_article'));
-		}
-		else
-		{
-			error_jump($res['msg']);
-		}
+        $litpic = "";
+        if (!empty($_POST["litpic"])) {
+            $litpic = $_POST["litpic"];
+        } else {
+            $_POST['litpic'] = "";
+        } //缩略图
+        if (empty($_POST["description"])) {
+            if (!empty($_POST["body"])) {
+                $_POST['description'] = cut_str($_POST["body"]);
+            }
+        } //description
+        $content = "";
+        if (!empty($_POST["body"])) {
+            $content = $_POST["body"];
+        }
+        $_POST['user_id'] = $_SESSION['admin_info']['id']; // 发布者id
+
+        //关键词
+        if (!empty($_POST["keywords"])) {
+            $_POST['keywords'] = str_replace(",", ",", $_POST["keywords"]);
+        } else {
+            if (!empty($_POST["title"])) {
+                $title = $_POST["title"];
+                $title = str_replace(",", "", $title);
+                $title = str_replace(",", "", $title);
+                $_POST['keywords'] = get_keywords($title);//标题分词
+            }
+        }
+
+        if (isset($_POST["dellink"]) && $_POST["dellink"] == 1 && !empty($content)) {
+            $content = replacelinks($content, array(sysconfig('CMS_BASEHOST')));
+        } //删除非站内链接
+        $_POST['body'] = $content;
+
+        //提取第一个图片为缩略图
+        if (isset($_POST["autolitpic"]) && $_POST["autolitpic"] && empty($litpic)) {
+            if (getfirstpic($content)) {
+                //获取文章内容的第一张图片
+                $imagepath = '.' . getfirstpic($content);
+
+                //获取后缀名
+                preg_match_all("/\/(.+)\.(gif|jpg|jpeg|bmp|png)$/iU", $imagepath, $out, PREG_PATTERN_ORDER);
+
+                $saveimage = './uploads/' . date('Y/m', time()) . '/' . basename($imagepath, '.' . $out[2][0]) . '-lp.' . $out[2][0];
+
+                //生成缩略图,按照原图的比例生成一个最大为240*180的缩略图
+                \Intervention\Image\Facades\Image::make($imagepath)->resize(sysconfig('CMS_IMGWIDTH'), sysconfig('CMS_IMGHEIGHT'))->save($saveimage);
+
+                //缩略图路径
+                $_POST['litpic'] = '/uploads/' . date('Y/m', time()) . '/' . basename($imagepath, '.' . $out[2][0]) . '-lp.' . $out[2][0];
+            }
+        }
+
+        $res = $this->getLogic()->add($_POST);
+        if ($res['code'] == ReturnData::SUCCESS) {
+            success_jump($res['msg'], route('admin_article'));
+        } else {
+            error_jump($res['msg']);
+        }
     }
-    
+
     public function edit()
     {
-        if(!empty($_GET["id"])){$id = $_GET["id"];}else {$id="";}if(preg_match('/[0-9]*/',$id)){}else{exit;}
-        
-		$data['id'] = $id;
-		$data['post'] = object_to_array($this->getLogic()->getOne(['id'=>$id]), 1);
-        
+        if (!empty($_GET["id"])) {
+            $id = $_GET["id"];
+        } else {
+            $id = "";
+        }
+        if (preg_match('/[0-9]*/', $id)) {
+        } else {
+            exit;
+        }
+
+        $data['id'] = $id;
+        $data['post'] = object_to_array($this->getLogic()->getOne(['id' => $id]), 1);
+
         return view('admin.article.edit', $data);
     }
-    
+
     public function doedit()
     {
-        if(!empty($_POST["id"])){$id = $_POST["id"];unset($_POST["id"]);}else{$id="";exit;}
-        $litpic="";if(!empty($_POST["litpic"])){$litpic = $_POST["litpic"];}else{$_POST['litpic']="";} //缩略图
-        if(empty($_POST["description"])){if(!empty($_POST["body"])){$_POST['description']=cut_str($_POST["body"]);}} //description
-        $content="";if(!empty($_POST["body"])){$content = $_POST["body"];}
-        
-		if(!empty($_POST["keywords"]))
-		{
-			$_POST['keywords']=str_replace(",",",",$_POST["keywords"]);
-		}
-		else
-		{
-			if(!empty($_POST["title"]))
-			{
-				$title=$_POST["title"];
-				$title=str_replace(",","",$title);
-				$title=str_replace(",","",$title);
-				$_POST['keywords']=get_keywords($title);//标题分词
-			}
-		}
-		
-		if(isset($_POST["dellink"]) && $_POST["dellink"]==1 && !empty($content)){$content=replacelinks($content,array(CMS_BASEHOST));} //删除非站内链接
-		$_POST['body']=$content;
-		
-		//提取第一个图片为缩略图
-		if(isset($_POST["autolitpic"]) && $_POST["autolitpic"] && empty($litpic))
-		{
-			if(getfirstpic($content))
-			{
-				//获取文章内容的第一张图片
-				$imagepath = '.'.getfirstpic($content);
-				
-				//获取后缀名
-				preg_match_all ("/\/(.+)\.(gif|jpg|jpeg|bmp|png)$/iU",$imagepath,$out, PREG_PATTERN_ORDER);
-				
-				$saveimage='./uploads/'.date('Y/m',time()).'/'.basename($imagepath,'.'.$out[2][0]).'-lp.'.$out[2][0];
-				
-				//生成缩略图,按照原图的比例生成一个最大为240*180的缩略图
-				\Intervention\Image\Facades\Image::make($imagepath)->resize(sysconfig('CMS_IMGWIDTH'), sysconfig('CMS_IMGHEIGHT'))->save($saveimage);
-				
-				//缩略图路径
-				$_POST['litpic']='/uploads/'.date('Y/m',time()).'/'.basename($imagepath,'.'.$out[2][0]).'-lp.'.$out[2][0];
-			}
-		}
-
-		$res = $this->getLogic()->edit($_POST,array('id'=>$id));
-		if($res['code']==ReturnData::SUCCESS)
-		{
-			success_jump($res['msg'], route('admin_article'));
-		}
-		else
-		{
-			error_jump($res['msg']);
-		}
+        if (!empty($_POST["id"])) {
+            $id = $_POST["id"];
+            unset($_POST["id"]);
+        } else {
+            $id = "";
+            exit;
+        }
+        $litpic = "";
+        if (!empty($_POST["litpic"])) {
+            $litpic = $_POST["litpic"];
+        } else {
+            $_POST['litpic'] = "";
+        } //缩略图
+        if (empty($_POST["description"])) {
+            if (!empty($_POST["body"])) {
+                $_POST['description'] = cut_str($_POST["body"]);
+            }
+        } //description
+        $content = "";
+        if (!empty($_POST["body"])) {
+            $content = $_POST["body"];
+        }
+
+        if (!empty($_POST["keywords"])) {
+            $_POST['keywords'] = str_replace(",", ",", $_POST["keywords"]);
+        } else {
+            if (!empty($_POST["title"])) {
+                $title = $_POST["title"];
+                $title = str_replace(",", "", $title);
+                $title = str_replace(",", "", $title);
+                $_POST['keywords'] = get_keywords($title);//标题分词
+            }
+        }
+
+        if (isset($_POST["dellink"]) && $_POST["dellink"] == 1 && !empty($content)) {
+            $content = replacelinks($content, array(CMS_BASEHOST));
+        } //删除非站内链接
+        $_POST['body'] = $content;
+
+        //提取第一个图片为缩略图
+        if (isset($_POST["autolitpic"]) && $_POST["autolitpic"] && empty($litpic)) {
+            if (getfirstpic($content)) {
+                //获取文章内容的第一张图片
+                $imagepath = '.' . getfirstpic($content);
+
+                //获取后缀名
+                preg_match_all("/\/(.+)\.(gif|jpg|jpeg|bmp|png)$/iU", $imagepath, $out, PREG_PATTERN_ORDER);
+
+                $saveimage = './uploads/' . date('Y/m', time()) . '/' . basename($imagepath, '.' . $out[2][0]) . '-lp.' . $out[2][0];
+
+                //生成缩略图,按照原图的比例生成一个最大为240*180的缩略图
+                \Intervention\Image\Facades\Image::make($imagepath)->resize(sysconfig('CMS_IMGWIDTH'), sysconfig('CMS_IMGHEIGHT'))->save($saveimage);
+
+                //缩略图路径
+                $_POST['litpic'] = '/uploads/' . date('Y/m', time()) . '/' . basename($imagepath, '.' . $out[2][0]) . '-lp.' . $out[2][0];
+            }
+        }
+
+        $res = $this->getLogic()->edit($_POST, array('id' => $id));
+        if ($res['code'] == ReturnData::SUCCESS) {
+            success_jump($res['msg'], route('admin_article'));
+        } else {
+            error_jump($res['msg']);
+        }
     }
-    
-	//删除文章
+
+    //删除文章
     public function del()
     {
-		if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump("删除失败!请重新提交");}
-		
-		if(DB::table("article")->whereIn("id", explode(',', $id))->delete())
-        {
+        if (!empty($_GET["id"])) {
+            $id = $_GET["id"];
+        } else {
+            error_jump("删除失败!请重新提交");
+        }
+
+        if (DB::table("article")->whereIn("id", explode(',', $id))->delete()) {
             success_jump("$id ,删除成功");
+        } else {
+            error_jump("$id ,删除失败!请重新提交");
         }
-		else
-		{
-			error_jump("$id ,删除失败!请重新提交");
-		}
     }
-    
-	
-	//重复文章列表
+
+
+    //重复文章列表
     public function repetarc()
     {
-		$data['posts'] = object_to_array(DB::table('article')->select(DB::raw('title,count(*) AS count'))->orderBy('count', 'desc')->groupBy('title')->having('count', '>', 1)->get());
-		
+        $data['posts'] = object_to_array(DB::table('article')->select(DB::raw('title,count(*) AS count'))->orderBy('count', 'desc')->groupBy('title')->having('count', '>', 1)->get());
+
         return view('admin.article.repetarc', $data);
     }
-	
-	//推荐文章
-	public function recommendarc()
+
+    //推荐文章
+    public function recommendarc()
     {
-		if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump("您访问的页面不存在或已被删除");} //if(preg_match('/[0-9]*/',$id)){}else{exit;}
-		
-		$data['tuijian'] = 1;
-		
-        if(DB::table("article")->whereIn("id", explode(',', $id))->update($data))
-        {
-			success_jump("$id ,推荐成功");
+        if (!empty($_GET["id"])) {
+            $id = $_GET["id"];
+        } else {
+            error_jump("您访问的页面不存在或已被删除");
+        } //if(preg_match('/[0-9]*/',$id)){}else{exit;}
+
+        $data['tuijian'] = 1;
+
+        if (DB::table("article")->whereIn("id", explode(',', $id))->update($data)) {
+            success_jump("$id ,推荐成功");
+        } else {
+            error_jump("$id ,推荐失败!请重新提交");
         }
-		else
-		{
-			error_jump("$id ,推荐失败!请重新提交");
-		}
     }
-    
-	//检测重复文章数量
+
+    //检测重复文章数量
     public function articleexists()
     {
-		$res = '';
-		$where = function ($query) use ($res) {
-			if(isset($_REQUEST["title"]))
-			{
-				$query->where('title', $_REQUEST["title"]);
-			}
-			
-			if(isset($_REQUEST["id"]))
-			{
-				$query->where('id', '<>', $_REQUEST["id"]);
-			}
+        $res = '';
+        $where = function ($query) use ($res) {
+            if (isset($_REQUEST["title"])) {
+                $query->where('title', $_REQUEST["title"]);
+            }
+
+            if (isset($_REQUEST["id"])) {
+                $query->where('id', '<>', $_REQUEST["id"]);
+            }
         };
-		
+
         return DB::table("article")->where($where)->count();
     }
 }
\ No newline at end of file
diff --git a/app/Http/Controllers/Admin/BaseController.php b/app/Http/Controllers/Admin/BaseController.php
new file mode 100644
index 0000000..b316690
--- /dev/null
+++ b/app/Http/Controllers/Admin/BaseController.php
@@ -0,0 +1,90 @@
+admin_info = $_SESSION['admin_info'];
+        } else {
+            header("Location:" . route('page404'));
+            exit();
+        }
+
+        //判断是否拥有权限
+        if ($_SESSION['admin_info']['role_id'] <> 1) {
+            $uncheck = array('admin_jump', 'admin', 'admin_index_upconfig', 'admin_index_upcache', 'admin_welcome');
+
+            if (in_array(\Route::currentRouteName(), $uncheck)) {
+
+            } else {
+                $menu_id = DB::table('menu')->where('action', \Route::currentRouteName())->value('id');
+                $check = DB::table('access')->where(['role_id' => $_SESSION['admin_info']['role_id'], 'menu_id' => $menu_id])->first();
+
+                if (!$check) {
+                    error_jump('你没有权限访问,请联系管理员', route('admin'));
+                }
+            }
+        }
+        parent::__construct();
+    }
+
+    /**
+     * 获取分页数据及分页导航
+     * @param string $modelname 模块名与数据库表名对应
+     * @param array $where 查询条件
+     * @param string $orderby 查询排序
+     * @param string $field 要返回数据的字段
+     * @param int $listRows 每页数量,默认30条
+     *
+     * @return 格式化后输出的数据。内容格式为:
+     *     - "code"                 (string):代码
+     *     - "info"                 (string):信息提示
+     *
+     *     - "result" array
+     *
+     *     - "img_list"             (array) :图片队列,默认8张
+     *     - "img_title"            (string):车图名称
+     *     - "img_url"              (string):车图片url地址
+     *     - "car_name"             (string):车名称
+     */
+    public function pageList($modelname, $where = '', $orderby = '', $field = '*', $listRows = 30)
+    {
+        $model = \DB::table($modelname);
+
+        //查询条件
+        if (!empty($where)) {
+            $model = $model->where($where);
+        }
+
+        //排序
+        if ($orderby != '') {
+            if ($orderby == 'rand()') {
+                $model = $model->orderBy(\DB::raw('rand()'));
+            } else {
+                if (count($orderby) == count($orderby, 1)) {
+                    $model = $model->orderBy($orderby[0], $orderby[1]);
+                } else {
+                    foreach ($orderby as $row) {
+                        $model = $model->orderBy($row[0], $row[1]);
+                    }
+                }
+            }
+        } else {
+            $model = $model->orderBy('id', 'desc');
+        }
+
+        //要返回的字段
+        if ($field != '*') {
+            $model = $model->select(\DB::raw($field));
+        }
+
+        return $model->paginate($listRows);
+    }
+
+}
diff --git a/app/Http/Controllers/Admin/BonusController.php b/app/Http/Controllers/Admin/BonusController.php
index ef8056b..eeaf23b 100644
--- a/app/Http/Controllers/Admin/BonusController.php
+++ b/app/Http/Controllers/Admin/BonusController.php
@@ -7,7 +7,7 @@ use Illuminate\Http\Request;
 use App\Http\Logic\BonusLogic;
 use App\Http\Model\Bonus;
 
-class BonusController extends CommonController
+class BonusController extends BaseController
 {
     public function __construct()
     {
diff --git a/app/Http/Controllers/Admin/CategoryController.php b/app/Http/Controllers/Admin/CategoryController.php
index a036cd2..71a8b20 100644
--- a/app/Http/Controllers/Admin/CategoryController.php
+++ b/app/Http/Controllers/Admin/CategoryController.php
@@ -4,7 +4,7 @@ use DB;
 use App\Common\ReturnData;
 use Illuminate\Http\Request;
 
-class CategoryController extends CommonController
+class CategoryController extends BaseController
 {
     public function __construct()
     {
diff --git a/app/Http/Controllers/Admin/CommonController.php b/app/Http/Controllers/Admin/CommonController.php
index d24d33e..a57a9a7 100644
--- a/app/Http/Controllers/Admin/CommonController.php
+++ b/app/Http/Controllers/Admin/CommonController.php
@@ -1,4 +1,5 @@
 user_info = $_SESSION['admin_user_info'];
-		}
-        else
-        {
-            header("Location:".route('page404'));
-			exit();
-        }
-		
-		//判断是否拥有权限
-		if($_SESSION['admin_user_info']['role_id'] <> 1)
-		{
-			$uncheck = array('admin_jump','admin','admin_index_upconfig','admin_index_upcache','admin_welcome');
 
-			if(in_array(\Route::currentRouteName(), $uncheck))
-			{
-				
-			}
-			else
-			{
-				$menu_id = DB::table('menu')->where('action', \Route::currentRouteName())->value('id');
-				$check = DB::table('access')->where(['role_id' => $_SESSION['admin_user_info']['role_id'], 'menu_id' => $menu_id])->first();
-				
-				if(!$check)
-				{
-					error_jump('你没有权限访问,请联系管理员', route('admin'));
-				}
-			}
-        }
+		// 添加管理员操作记录
+		$this->operation_log_add();
     }
-	
+
     /**
      * 获取分页数据及分页导航
      * @param string $modelname 模块名与数据库表名对应
-     * @param array  $where     查询条件
-     * @param string $orderby   查询排序
-     * @param string $field     要返回数据的字段
-     * @param int    $listRows  每页数量,默认30条
-     * 
+     * @param array $where 查询条件
+     * @param string $orderby 查询排序
+     * @param string $field 要返回数据的字段
+     * @param int $listRows 每页数量,默认30条
+     *
      * @return 格式化后输出的数据。内容格式为:
      *     - "code"                 (string):代码
      *     - "info"                 (string):信息提示
-     * 
+     *
      *     - "result" array
-     * 
+     *
      *     - "img_list"             (array) :图片队列,默认8张
      *     - "img_title"            (string):车图名称
      *     - "img_url"              (string):车图片url地址
@@ -67,40 +39,54 @@ class CommonController extends Controller
     public function pageList($modelname, $where = '', $orderby = '', $field = '*', $listRows = 30)
     {
         $model = \DB::table($modelname);
-		
-		//查询条件
-        if(!empty($where)){$model = $model->where($where);}
-		
-		//排序
-        if($orderby!='')
-		{
-            if($orderby == 'rand()')
-            {
+
+        //查询条件
+        if (!empty($where)) {
+            $model = $model->where($where);
+        }
+
+        //排序
+        if ($orderby != '') {
+            if ($orderby == 'rand()') {
                 $model = $model->orderBy(\DB::raw('rand()'));
+            } else {
+                if (count($orderby) == count($orderby, 1)) {
+                    $model = $model->orderBy($orderby[0], $orderby[1]);
+                } else {
+                    foreach ($orderby as $row) {
+                        $model = $model->orderBy($row[0], $row[1]);
+                    }
+                }
             }
-            else
-            {
-    			if(count($orderby) == count($orderby, 1))
-    			{
-    				$model = $model->orderBy($orderby[0], $orderby[1]);
-    			}
-    			else
-    			{
-    				foreach($orderby as $row)
-    				{
-    					$model = $model->orderBy($row[0], $row[1]);
-    				}
-    			}
-            }
-		}
-        else
-        {
+        } else {
             $model = $model->orderBy('id', 'desc');
         }
-		
-		//要返回的字段
-        if($field!='*'){$model = $model->select(\DB::raw($field));}
-        
+
+        //要返回的字段
+        if ($field != '*') {
+            $model = $model->select(\DB::raw($field));
+        }
+
         return $model->paginate($listRows);
     }
+
+	// 添加管理员操作记录
+	public function operation_log_add()
+    {
+		$time = time();
+		// 记录操作
+        if ($this->admin_info) {
+            $data['login_id'] = $this->admin_info['id'];
+            $data['login_name'] = $this->admin_info['name'];
+        }
+        $data['type'] = 1;
+        $data['ip'] = request()->ip();
+        $data['url'] = mb_strcut(request()->url(), 0, 255, 'UTF-8');
+        $data['http_method'] = request()->method();
+        $data['domain_name'] = mb_strcut($_SERVER['SERVER_NAME'], 0, 60, 'UTF-8');
+        if ($data['http_method'] != 'GET') { $data['content'] = mb_strcut(json_encode(request()->toArray(), JSON_UNESCAPED_SLASHES), 0, 255, 'UTF-8'); }
+		if (!empty($_SERVER['HTTP_REFERER'])) { $data['http_referer'] = mb_strcut($_SERVER['HTTP_REFERER'], 0, 255, 'UTF-8'); }
+        $data['add_time'] = $time;
+        logic('Log')->add($data);
+    }
 }
diff --git a/app/Http/Controllers/Admin/FeedbackController.php b/app/Http/Controllers/Admin/FeedbackController.php
index 5de2090..c334e1e 100644
--- a/app/Http/Controllers/Admin/FeedbackController.php
+++ b/app/Http/Controllers/Admin/FeedbackController.php
@@ -7,7 +7,7 @@ use Illuminate\Http\Request;
 use App\Http\Logic\FeedbackLogic;
 use App\Http\Model\Feedback;
 
-class FeedbackController extends CommonController
+class FeedbackController extends BaseController
 {
     public function __construct()
     {
diff --git a/app/Http/Controllers/Admin/FriendlinkController.php b/app/Http/Controllers/Admin/FriendlinkController.php
index a5796ff..9038a87 100644
--- a/app/Http/Controllers/Admin/FriendlinkController.php
+++ b/app/Http/Controllers/Admin/FriendlinkController.php
@@ -7,7 +7,7 @@ use Illuminate\Http\Request;
 use App\Http\Logic\FriendlinkLogic;
 use App\Http\Model\Friendlink;
 
-class FriendlinkController extends CommonController
+class FriendlinkController extends BaseController
 {
     public function __construct()
     {
diff --git a/app/Http/Controllers/Admin/GoodsBrandController.php b/app/Http/Controllers/Admin/GoodsBrandController.php
index c142fc5..0821cea 100644
--- a/app/Http/Controllers/Admin/GoodsBrandController.php
+++ b/app/Http/Controllers/Admin/GoodsBrandController.php
@@ -1,10 +1,9 @@
 where('login_name', 'like', '%' . $_REQUEST['keyword'] . '%')->orWhere('ip', 'like', '%' . $_REQUEST['keyword'] . '%')->orWhere('url', 'like', '%' . $_REQUEST['keyword'] . '%')->orWhere('content', 'like', '%' . $_REQUEST['keyword'] . '%');
+			}
+			//用户ID
+			if (isset($_REQUEST['login_id'])) {
+				$query->where('login_id', $_REQUEST["login_id"]);
+			}
+			//IP
+			if (isset($_REQUEST['ip'])) {
+				$query->where('ip', $_REQUEST["ip"]);
+			}
+			//模块
+			if (isset($_REQUEST['type']) && $_REQUEST['type'] !== '') {
+				$query->where('type', $_REQUEST["type"]);
+			}
+			//请求方式
+			if (isset($_REQUEST['http_method'])) {
+				$query->where('http_method', $_REQUEST["http_method"]);
+			}
+        };
+
+        $list = $this->getLogic()->getPaginate($where, array('id', 'desc'));
+        $data['list'] = $list;
+        return view('admin.log.index', $data);
+    }
+
+    public function add(Request $request)
+    {
+        return view('admin.log.add');
+    }
+
+    public function doadd(Request $request)
+    {
+        if (Helper::isPostRequest()) {
+            $res = $this->getLogic()->add($_POST);
+            if ($res['code'] == ReturnData::SUCCESS) {
+                success_jump($res['msg'], route('admin_slide'));
+            }
+
+            error_jump($res['msg']);
+        }
+    }
+
+    public function edit(Request $request)
+    {
+        if (!checkIsNumber($request->input('id', null))) {
+            error_jump('参数错误');
+        }
+        $id = $request->input('id');
+
+        $data['id'] = $where['id'] = $id;
+        $data['post'] = $this->getLogic()->getOne($where);
+
+        return view('admin.log.edit', $data);
+    }
+
+    public function doedit(Request $request)
+    {
+        if (!checkIsNumber($request->input('id', null))) {
+            error_jump('参数错误');
+        }
+        $id = $request->input('id');
+
+        if (Helper::isPostRequest()) {
+            $where['id'] = $id;
+            $res = $this->getLogic()->edit($_POST, $where);
+            if ($res['code'] == ReturnData::SUCCESS) {
+                success_jump($res['msg'], route('admin_slide'));
+            }
+
+            error_jump($res['msg']);
+        }
+    }
+
+    public function del(Request $request)
+    {
+        if (!checkIsNumber($request->input('id', null))) {
+            error_jump('参数错误');
+        }
+        $id = $request->input('id');
+
+        $where['id'] = $id;
+        $res = $this->getLogic()->del($where);
+        if ($res['code'] == ReturnData::SUCCESS) {
+            success_jump($res['msg']);
+        }
+
+        error_jump($res['msg']);
+    }
+}
\ No newline at end of file
diff --git a/app/Http/Controllers/Admin/LoginController.php b/app/Http/Controllers/Admin/LoginController.php
index 21e00c1..52ca716 100644
--- a/app/Http/Controllers/Admin/LoginController.php
+++ b/app/Http/Controllers/Admin/LoginController.php
@@ -1,12 +1,11 @@
 where(array('username' => $username, 'pwd' => $pwd))->orWhere(function ($query) use ($username, $pwd) {
+        $admin_user = DB::table('admin')->where(array('name' => $username, 'pwd' => $pwd))->orWhere(function ($query) use ($username, $pwd) {
             $query->where('email', '=', $username)->where('pwd', '=', $pwd);
         })->first();
 		
         if($admin_user)
         {
-			$admin_user_info = object_to_array($admin_user, 1);
-			$admin_user_info['rolename'] = DB::table('admin_role')->where(array('id'=>$admin_user->role_id))->value('name');
+			$admin_info = object_to_array($admin_user, 1);
+			$admin_info['rolename'] = DB::table('admin_role')->where(array('id'=>$admin_user->role_id))->value('name');
 			
-			$_SESSION['admin_user_info'] = $admin_user_info;
+			$_SESSION['admin_info'] = $admin_info;
 			
-			DB::table('admin')->where(array('id'=>$admin_user->role_id))->update(array('logintime' => time()));
+			DB::table('admin')->where(array('id'=>$admin_user->id))->update(array('login_time' => time()));
 			
 			return redirect()->route('admin');
         }
@@ -66,7 +65,7 @@ class LoginController extends BaseController
     //密码恢复
     public function recoverpwd()
     {
-        $data["username"] = "admin888";
+        $data["name"] = "admin888";
         $data["pwd"] = "21232f297a57a5a743894a0e4a801fc3";
         
         if(DB::table('admin')->where('id', 1)->update($data))
@@ -82,17 +81,17 @@ class LoginController extends BaseController
      */
     public function userexists()
     {
-		$map['username'] = "";
-        if(isset($_POST["username"]) && !empty($_POST["username"]))
+		$where['name'] = "";
+        if(isset($_POST["name"]) && !empty($_POST["name"]))
         {
-            $map['username'] = $_POST["username"];
+            $where['name'] = $_POST["name"];
         }
 		else
 		{
 			return 0;
 		}
         
-        return DB::table("admin")->where($map)->count();
+        return DB::table("admin")->where($where)->count();
     }
 	
 	//测试
diff --git a/app/Http/Controllers/Admin/MenuController.php b/app/Http/Controllers/Admin/MenuController.php
index 855acc2..f833bd1 100644
--- a/app/Http/Controllers/Admin/MenuController.php
+++ b/app/Http/Controllers/Admin/MenuController.php
@@ -4,7 +4,7 @@ namespace App\Http\Controllers\Admin;
 use App\Http\Controllers\Admin\CommonController;
 use DB;
 
-class MenuController extends CommonController
+class MenuController extends BaseController
 {
     public function __construct()
     {
diff --git a/app/Http/Controllers/Admin/OrderController.php b/app/Http/Controllers/Admin/OrderController.php
index d4e3171..835bd6e 100644
--- a/app/Http/Controllers/Admin/OrderController.php
+++ b/app/Http/Controllers/Admin/OrderController.php
@@ -10,7 +10,7 @@ use DB;
 use App\Common\ReturnData;
 use Illuminate\Http\Request;
 
-class OrderController extends CommonController
+class OrderController extends BaseController
 {
     public function __construct()
     {
diff --git a/app/Http/Controllers/Admin/PageController.php b/app/Http/Controllers/Admin/PageController.php
index ac61267..c713825 100644
--- a/app/Http/Controllers/Admin/PageController.php
+++ b/app/Http/Controllers/Admin/PageController.php
@@ -4,7 +4,7 @@ namespace App\Http\Controllers\Admin;
 use App\Http\Controllers\Admin\CommonController;
 use DB;
 
-class PageController extends CommonController
+class PageController extends BaseController
 {
     public function __construct()
     {
diff --git a/app/Http/Controllers/Admin/SearchController.php b/app/Http/Controllers/Admin/SearchController.php
index 84d1b7b..c7f9304 100644
--- a/app/Http/Controllers/Admin/SearchController.php
+++ b/app/Http/Controllers/Admin/SearchController.php
@@ -1,7 +1,7 @@
 operation_log_add();
+    }
+
+	// 添加操作记录
+    public function operation_log_add($login_info = [])
+    {
+        $time = time();
+        // 记录操作
+        if ($login_info) {
+            $data['login_id'] = $login_info['id'];
+            $data['login_name'] = $login_info['user_name'];
+        }
+        $data['type'] = 3;
+        $data['ip'] = request()->ip();
+        $data['url'] = mb_strcut(request()->url(), 0, 255, 'UTF-8');
+        $data['http_method'] = request()->method();
+        $data['domain_name'] = mb_strcut($_SERVER['SERVER_NAME'], 0, 60, 'UTF-8');
+        if ($data['http_method'] != 'GET') {
+            $data['content'] = mb_strcut(json_encode(request()->toArray(), JSON_UNESCAPED_SLASHES), 0, 255, 'UTF-8');
+        }
+        if (!empty($_SERVER['HTTP_REFERER'])) {
+            $data['http_referer'] = mb_strcut($_SERVER['HTTP_REFERER'], 0, 255, 'UTF-8');
+        }
+        $data['add_time'] = $time;
+        logic('Log')->add($data);
     }
 }
diff --git a/app/Http/Controllers/Api/FeedBackController.php b/app/Http/Controllers/Api/FeedBackController.php
index b7fc0c7..e94f824 100644
--- a/app/Http/Controllers/Api/FeedBackController.php
+++ b/app/Http/Controllers/Api/FeedBackController.php
@@ -9,7 +9,7 @@ use App\Common\Token;
 use App\Http\Model\FeedBack;
 use App\Http\Logic\FeedBackLogic;
 
-class FeedBackController extends CommonController
+class FeedBackController extends BaseController
 {
     public function __construct()
     {
diff --git a/app/Http/Controllers/Api/GoodsBrandController.php b/app/Http/Controllers/Api/GoodsBrandController.php
index 8118294..75ff4e3 100644
--- a/app/Http/Controllers/Api/GoodsBrandController.php
+++ b/app/Http/Controllers/Api/GoodsBrandController.php
@@ -9,7 +9,7 @@ use App\Common\Token;
 use App\Http\Model\GoodsBrand;
 use App\Http\Logic\GoodsBrandLogic;
 
-class GoodsBrandController extends CommonController
+class GoodsBrandController extends BaseController
 {
     public function __construct()
     {
diff --git a/app/Http/Controllers/Api/GoodsController.php b/app/Http/Controllers/Api/GoodsController.php
index 1646d8b..73a18c0 100644
--- a/app/Http/Controllers/Api/GoodsController.php
+++ b/app/Http/Controllers/Api/GoodsController.php
@@ -10,7 +10,7 @@ use App\Http\Model\Goods;
 use App\Http\Logic\GoodsLogic;
 use App\Http\Logic\GoodsSearchwordLogic;
 
-class GoodsController extends CommonController
+class GoodsController extends BaseController
 {
     public function __construct()
     {
diff --git a/app/Http/Controllers/Api/GoodsSearchwordController.php b/app/Http/Controllers/Api/GoodsSearchwordController.php
index fa1de5c..f5fde5c 100644
--- a/app/Http/Controllers/Api/GoodsSearchwordController.php
+++ b/app/Http/Controllers/Api/GoodsSearchwordController.php
@@ -9,7 +9,7 @@ use App\Common\Token;
 use App\Http\Model\GoodsSearchword;
 use App\Http\Logic\GoodsSearchwordLogic;
 
-class GoodsSearchwordController extends CommonController
+class GoodsSearchwordController extends BaseController
 {
     public function __construct()
     {
diff --git a/app/Http/Controllers/Api/GoodsTypeController.php b/app/Http/Controllers/Api/GoodsTypeController.php
index dd76b71..c34cce9 100644
--- a/app/Http/Controllers/Api/GoodsTypeController.php
+++ b/app/Http/Controllers/Api/GoodsTypeController.php
@@ -9,7 +9,7 @@ use App\Common\Token;
 use App\Http\Model\GoodsType;
 use App\Http\Logic\GoodsTypeLogic;
 
-class GoodsTypeController extends CommonController
+class GoodsTypeController extends BaseController
 {
     public function __construct()
     {
diff --git a/app/Http/Controllers/Api/ImageController.php b/app/Http/Controllers/Api/ImageController.php
index 1eafbbd..3ff1ba8 100644
--- a/app/Http/Controllers/Api/ImageController.php
+++ b/app/Http/Controllers/Api/ImageController.php
@@ -5,7 +5,7 @@ use Illuminate\Http\Request;
 use App\Common\ReturnData;
 use App\Common\Helper;
 
-class ImageController extends CommonController
+class ImageController extends BaseController
 {
     public $path;
     
diff --git a/app/Http/Controllers/Api/IndexController.php b/app/Http/Controllers/Api/IndexController.php
index c4a005f..7911293 100644
--- a/app/Http/Controllers/Api/IndexController.php
+++ b/app/Http/Controllers/Api/IndexController.php
@@ -6,7 +6,7 @@ use Illuminate\Http\Request;
 use App\Common\ReturnData;
 use App\Common\Token;
 
-class IndexController extends CommonController
+class IndexController extends BaseController
 {
     public function __construct()
     {
diff --git a/app/Http/Controllers/Api/NotifyController.php b/app/Http/Controllers/Api/NotifyController.php
index 628b407..09a9169 100644
--- a/app/Http/Controllers/Api/NotifyController.php
+++ b/app/Http/Controllers/Api/NotifyController.php
@@ -6,7 +6,7 @@ use Illuminate\Http\Request;
 use App\Common\ReturnData;
 use App\Common\Helper;
 
-class NotifyController extends CommonController
+class NotifyController extends BaseController
 {
     public function __construct()
     {
diff --git a/app/Http/Controllers/Api/OrderController.php b/app/Http/Controllers/Api/OrderController.php
index 2c33638..cd0f527 100644
--- a/app/Http/Controllers/Api/OrderController.php
+++ b/app/Http/Controllers/Api/OrderController.php
@@ -9,7 +9,7 @@ use App\Common\Token;
 use App\Http\Model\Order;
 use App\Http\Logic\OrderLogic;
 
-class OrderController extends CommonController
+class OrderController extends BaseController
 {
     public function __construct()
     {
diff --git a/app/Http/Controllers/Api/PageController.php b/app/Http/Controllers/Api/PageController.php
index a051ea2..805fe27 100644
--- a/app/Http/Controllers/Api/PageController.php
+++ b/app/Http/Controllers/Api/PageController.php
@@ -9,7 +9,7 @@ use App\Common\Token;
 use App\Http\Model\Page;
 use App\Http\Logic\PageLogic;
 
-class PageController extends CommonController
+class PageController extends BaseController
 {
     public function __construct()
     {
diff --git a/app/Http/Controllers/Api/PaymentController.php b/app/Http/Controllers/Api/PaymentController.php
index 14471fe..821fa64 100644
--- a/app/Http/Controllers/Api/PaymentController.php
+++ b/app/Http/Controllers/Api/PaymentController.php
@@ -9,7 +9,7 @@ use App\Common\Token;
 use App\Http\Model\Payment;
 use App\Http\Logic\PaymentLogic;
 
-class PaymentController extends CommonController
+class PaymentController extends BaseController
 {
     public function __construct()
     {
diff --git a/app/Http/Controllers/Api/PaymentNotifyController.php b/app/Http/Controllers/Api/PaymentNotifyController.php
index f81c711..a93f694 100644
--- a/app/Http/Controllers/Api/PaymentNotifyController.php
+++ b/app/Http/Controllers/Api/PaymentNotifyController.php
@@ -7,7 +7,7 @@ use App\Common\ReturnData;
 use App\Common\Token;
 use App\Http\Model\UserMoney;
 
-class PaymentNotifyController extends CommonController
+class PaymentNotifyController extends BaseController
 {
     public function __construct()
     {
diff --git a/app/Http/Controllers/Api/QrcodeController.php b/app/Http/Controllers/Api/QrcodeController.php
index d66d38d..65d9ed0 100644
--- a/app/Http/Controllers/Api/QrcodeController.php
+++ b/app/Http/Controllers/Api/QrcodeController.php
@@ -5,7 +5,7 @@ use App\Common\ReturnData;
 use App\Common\Helper;
 
 //二维码,如果输出乱码就转成base64输出
-class QrcodeController extends CommonController
+class QrcodeController extends BaseController
 {
     public function __construct()
     {
diff --git a/app/Http/Controllers/Api/RegionController.php b/app/Http/Controllers/Api/RegionController.php
index a113c86..cd1bf08 100644
--- a/app/Http/Controllers/Api/RegionController.php
+++ b/app/Http/Controllers/Api/RegionController.php
@@ -9,7 +9,7 @@ use App\Common\Token;
 use App\Http\Model\Region;
 use App\Http\Logic\RegionLogic;
 
-class RegionController extends CommonController
+class RegionController extends BaseController
 {
     public function __construct()
     {
diff --git a/app/Http/Controllers/Api/SlideController.php b/app/Http/Controllers/Api/SlideController.php
index c414c9a..ecf3c3b 100644
--- a/app/Http/Controllers/Api/SlideController.php
+++ b/app/Http/Controllers/Api/SlideController.php
@@ -9,7 +9,7 @@ use App\Common\Token;
 use App\Http\Model\Slide;
 use App\Http\Logic\SlideLogic;
 
-class SlideController extends CommonController
+class SlideController extends BaseController
 {
     public function __construct()
     {
diff --git a/app/Http/Controllers/Api/UserAddressController.php b/app/Http/Controllers/Api/UserAddressController.php
index a1a3922..9206a73 100644
--- a/app/Http/Controllers/Api/UserAddressController.php
+++ b/app/Http/Controllers/Api/UserAddressController.php
@@ -9,7 +9,7 @@ use App\Common\Token;
 use App\Http\Model\UserAddress;
 use App\Http\Logic\UserAddressLogic;
 
-class UserAddressController extends CommonController
+class UserAddressController extends BaseController
 {
     public function __construct()
     {
diff --git a/app/Http/Controllers/Api/UserBonusController.php b/app/Http/Controllers/Api/UserBonusController.php
index 9815285..8117f24 100644
--- a/app/Http/Controllers/Api/UserBonusController.php
+++ b/app/Http/Controllers/Api/UserBonusController.php
@@ -9,7 +9,7 @@ use App\Common\Token;
 use App\Http\Model\UserBonus;
 use App\Http\Logic\UserBonusLogic;
 
-class UserBonusController extends CommonController
+class UserBonusController extends BaseController
 {
     public function __construct()
     {
diff --git a/app/Http/Controllers/Api/UserController.php b/app/Http/Controllers/Api/UserController.php
index 930508a..5aa58b9 100644
--- a/app/Http/Controllers/Api/UserController.php
+++ b/app/Http/Controllers/Api/UserController.php
@@ -9,7 +9,7 @@ use App\Common\Token;
 use App\Http\Model\User;
 use App\Http\Logic\UserLogic;
 
-class UserController extends CommonController
+class UserController extends BaseController
 {
     public function __construct()
     {
diff --git a/app/Http/Controllers/Api/UserGoodsHistoryController.php b/app/Http/Controllers/Api/UserGoodsHistoryController.php
index f0aebc7..78102aa 100644
--- a/app/Http/Controllers/Api/UserGoodsHistoryController.php
+++ b/app/Http/Controllers/Api/UserGoodsHistoryController.php
@@ -10,7 +10,7 @@ use App\Http\Model\UserGoodsHistory;
 use App\Http\Logic\UserGoodsHistoryLogic;
 
 //我的足迹
-class UserGoodsHistoryController extends CommonController
+class UserGoodsHistoryController extends BaseController
 {
     public function __construct()
     {
diff --git a/app/Http/Controllers/Api/UserMessageController.php b/app/Http/Controllers/Api/UserMessageController.php
index f3ac81b..9434d06 100644
--- a/app/Http/Controllers/Api/UserMessageController.php
+++ b/app/Http/Controllers/Api/UserMessageController.php
@@ -9,7 +9,7 @@ use App\Common\Token;
 use App\Http\Model\UserMessage;
 use App\Http\Logic\UserMessageLogic;
 
-class UserMessageController extends CommonController
+class UserMessageController extends BaseController
 {
     public function __construct()
     {
diff --git a/app/Http/Controllers/Api/UserMoneyController.php b/app/Http/Controllers/Api/UserMoneyController.php
index 52eb87b..711c012 100644
--- a/app/Http/Controllers/Api/UserMoneyController.php
+++ b/app/Http/Controllers/Api/UserMoneyController.php
@@ -10,7 +10,7 @@ use App\Http\Model\UserMoney;
 use App\Http\Logic\UserMoneyLogic;
 
 //余额明细
-class UserMoneyController extends CommonController
+class UserMoneyController extends BaseController
 {
     public function __construct()
     {
diff --git a/app/Http/Controllers/Api/UserPointController.php b/app/Http/Controllers/Api/UserPointController.php
index 7659847..e86e595 100644
--- a/app/Http/Controllers/Api/UserPointController.php
+++ b/app/Http/Controllers/Api/UserPointController.php
@@ -9,7 +9,7 @@ use App\Common\Token;
 use App\Http\Model\UserPoint;
 use App\Http\Logic\UserPointLogic;
 
-class UserPointController extends CommonController
+class UserPointController extends BaseController
 {
     public function __construct()
     {
diff --git a/app/Http/Controllers/Api/UserRechargeController.php b/app/Http/Controllers/Api/UserRechargeController.php
index e2a6f74..8e4e323 100644
--- a/app/Http/Controllers/Api/UserRechargeController.php
+++ b/app/Http/Controllers/Api/UserRechargeController.php
@@ -9,7 +9,7 @@ use App\Common\Token;
 use App\Http\Model\UserRecharge;
 use App\Http\Logic\UserRechargeLogic;
 
-class UserRechargeController extends CommonController
+class UserRechargeController extends BaseController
 {
     public function __construct()
     {
diff --git a/app/Http/Controllers/Api/UserWithdrawController.php b/app/Http/Controllers/Api/UserWithdrawController.php
index 4398889..530aa21 100644
--- a/app/Http/Controllers/Api/UserWithdrawController.php
+++ b/app/Http/Controllers/Api/UserWithdrawController.php
@@ -9,7 +9,7 @@ use App\Common\Token;
 use App\Http\Model\UserWithdraw;
 use App\Http\Logic\UserWithdrawLogic;
 
-class UserWithdrawController extends CommonController
+class UserWithdrawController extends BaseController
 {
     public function __construct()
     {
diff --git a/app/Http/Controllers/Api/VerifyCodeController.php b/app/Http/Controllers/Api/VerifyCodeController.php
index ded4554..44708a7 100644
--- a/app/Http/Controllers/Api/VerifyCodeController.php
+++ b/app/Http/Controllers/Api/VerifyCodeController.php
@@ -9,7 +9,7 @@ use App\Common\Token;
 use App\Http\Model\VerifyCode;
 use App\Http\Logic\VerifyCodeLogic;
 
-class VerifyCodeController extends CommonController
+class VerifyCodeController extends BaseController
 {
     public function __construct()
     {
diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php
index 29614ad..0758188 100644
--- a/app/Http/Controllers/Controller.php
+++ b/app/Http/Controllers/Controller.php
@@ -1,47 +1,47 @@
 getActionName();
-		list($class, $method) = explode('@', $action);
-		
-		return ['controller' => $class, 'method' => $method];
-	}
+     * 获取当前控制器名
+     *
+     * @return string
+     */
+    public function getCurrentControllerName()
+    {
+        return self::getCurrentAction()['controller'];
+    }
+
+    /**
+     * 获取当前方法名
+     *
+     * @return string
+     */
+    public function getCurrentMethodName()
+    {
+        return self::getCurrentAction()['method'];
+    }
+
+    /**
+     * 获取当前控制器与方法
+     *
+     * @return array
+     */
+    public function getCurrentAction()
+    {
+        $action = \Route::current()->getActionName();
+        list($class, $method) = explode('@', $action);
+
+        return ['controller' => $class, 'method' => $method];
+    }
 }
diff --git a/app/Http/Controllers/Home/ArticleController.php b/app/Http/Controllers/Home/ArticleController.php
new file mode 100644
index 0000000..e91ba0b
--- /dev/null
+++ b/app/Http/Controllers/Home/ArticleController.php
@@ -0,0 +1,114 @@
+input('typeid', null) != null) {
+            $postdata = array(
+                'id' => $request->input('typeid')
+            );
+            $url = env('APP_API_URL') . "/arctype_detail";
+            $arctype_detail = curl_request($url, $postdata, 'GET');
+            $data['post'] = $arctype_detail['data'];
+        }
+
+        if (isset($_REQUEST['page'])) {
+            $offset = ($_REQUEST['page'] - 1) * $pagesize;
+        }
+
+        //文章列表
+        $postdata2 = array(
+            'limit' => $pagesize,
+            'offset' => $offset
+        );
+        if ($request->input('typeid', null) != null) {
+            $postdata2['typeid'] = $request->input('typeid');
+        }
+
+        $url = env('APP_API_URL') . "/article_list";
+        $res = curl_request($url, $postdata2, 'GET');
+        $data['list'] = $res['data']['list'];
+
+        $data['totalpage'] = ceil($res['data']['count'] / $pagesize);
+
+        if (isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax'] == 1) {
+            $html = '';
+
+            if ($res['data']['list']) {
+                foreach ($res['data']['list'] as $k => $v) {
+                    $html .= '
'; + if (!empty($v['litpic'])) { + $html .= ' $v['id'], "catid" => $v['typeid'], "type" => 'content')) . '">' . $v['title'] . ''; + } + $html .= ' $v['id'], "catid" => $v['typeid'], "type" => 'content')) . '">' . $v['title'] . '

' . mb_strcut($v['description'], 0, 150, 'UTF-8') . '..

'; + $html .= '
'; + $taglist = taglist($v['id']); + if ($taglist) { + foreach ($taglist as $row) { + $html .= ' $row['id'], "type" => 'tags')) . '">' . $row['tag'] . ''; + } + } + $html .= '' . date("m-d H:i", $v['pubdate']) . '' . $v['click'] . '人阅读
'; + } + } + + exit(json_encode($html)); + } + + return view('home.article.index', $data); + } + + //文章详情页 + public function detail($id) + { + if (empty($id) || !preg_match('/[0-9]+/', $id)) { + return redirect()->route('page404'); + } + + $post = cache("detailid$id"); + if (!$post) { + $post = object_to_array(DB::table('article')->where('id', $id)->first(), 1); + if (empty($post)) { + return redirect()->route('page404'); + } + $post['name'] = DB::table('arctype')->where('id', $post['typeid'])->value('name'); + cache(["detailid$id" => $post], \Carbon\Carbon::now()->addMinutes(2592000)); + } + if (!$post) { + return redirect()->route('page404'); + } + $cat = $post['typeid']; + $post['body'] = ReplaceKeyword($post['body']); + if (!empty($post['writer'])) { + $post['writertitle'] = $post['title'] . ' ' . $post['writer']; + } + + $data['post'] = $post; + $data['pre'] = get_article_prenext(array('aid' => $post["id"], 'typeid' => $post["typeid"], 'type' => "pre")); + + $post = cache("catid$cat"); + if (!$post) { + $post = object_to_array(DB::table('arctype')->where('id', $cat)->first(), 1); + cache(["catid$cat" => $post], \Carbon\Carbon::now()->addMinutes(2592000)); + } + + return view('home.article.detail', $data); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/Home/BaseController.php b/app/Http/Controllers/Home/BaseController.php new file mode 100644 index 0000000..13036f4 --- /dev/null +++ b/app/Http/Controllers/Home/BaseController.php @@ -0,0 +1,11 @@ +operation_log_add(); + } + + // 添加操作记录 + public function operation_log_add($login_info = []) + { + $time = time(); + // 记录操作 + if ($login_info) { + $data['login_id'] = $login_info['id']; + $data['login_name'] = $login_info['user_name']; + } + $data['type'] = 2; + $data['ip'] = request()->ip(); + $data['url'] = mb_strcut(request()->url(), 0, 255, 'UTF-8'); + $data['http_method'] = request()->method(); + $data['domain_name'] = mb_strcut($_SERVER['SERVER_NAME'], 0, 60, 'UTF-8'); + if ($data['http_method'] != 'GET') { + $data['content'] = mb_strcut(json_encode(request()->toArray(), JSON_UNESCAPED_SLASHES), 0, 255, 'UTF-8'); + } + if (!empty($_SERVER['HTTP_REFERER'])) { + $data['http_referer'] = mb_strcut($_SERVER['HTTP_REFERER'], 0, 255, 'UTF-8'); + } + $data['add_time'] = $time; + logic('Log')->add($data); } } \ No newline at end of file diff --git a/app/Http/Controllers/Home/GoodsController.php b/app/Http/Controllers/Home/GoodsController.php new file mode 100644 index 0000000..f376ec7 --- /dev/null +++ b/app/Http/Controllers/Home/GoodsController.php @@ -0,0 +1,107 @@ +input('typeid', null) != null) { + $postdata['typeid'] = $request->input('typeid'); + } + if ($request->input('orderby', null) != null) { + $postdata['orderby'] = $request->input('orderby'); + } + if ($request->input('tuijian', null) != null) { + $postdata['tuijian'] = $request->input('tuijian'); + } + + $pagesize = 15; + $offset = 0; + if (isset($_REQUEST['page'])) { + $offset = ($_REQUEST['page'] - 1) * $pagesize; + } + + //商品列表 + $postdata['limit'] = $pagesize; + $postdata['offset'] = $offset; + $url = env('APP_API_URL') . "/goods_list"; + $res = curl_request($url, $postdata, 'GET'); + $data['list'] = $res['data']['list']; + + $data['totalpage'] = ceil($res['data']['count'] / $pagesize); + + if (isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax'] == 1) { + $html = ''; + + if ($res['data']['list']) { + foreach ($res['data']['list'] as $k => $v) { + $html .= '
  • ' . $v['title'] . ''; + $html .= '

    ' . $v['title'] . '

    '; + $html .= '

    库存(' . $v['goods_number'] . ') ' . $v['description'] . '

    '; + $html .= '
    ¥' . ceil($v['price']) . '
    '; + $html .= '
    ¥' . $v['market_price'] . ' 包邮
    ' . $v['sale'] . ' 件已付款
  • '; + + /* if($v['is_promote_goods']>0) + { + $html .= 'Hot'; + } + + $html .= $v['title'].'

    '.$v['price'].''.$v['sale'].'人付款
    '; + $html .= ''; */ + } + } + + exit(json_encode($html)); + } + + //商品分类列表 + $postdata = array( + 'pid' => 0, + 'limit' => 15, + 'offset' => 0 + ); + $url = env('APP_API_URL') . "/goodstype_list"; + $res = curl_request($url, $postdata, 'GET'); + $data['goodstype_list'] = $res['data']['list']; + + return view('home.goods.index', $data); + } + + // 商品详情页 + public function detail($id) + { + if (empty($id) || !preg_match('/[0-9]+/', $id)) { + return redirect()->route('page404'); + } + + $where['id'] = $id; + $where['status'] = 0; + $data['post'] = logic('Goods')->getOne($where); + if (!$data['post']) { + return redirect()->route('page404'); + } + + $data['tj_list'] = DB::table('goods')->where(['tuijian' => 1, 'status' => 0])->orderBy('id', 'desc')->get(); + + return view('home.goods.detail', $data); + } + + //商品列表页 + public function brand_list(Request $request) + { + $data['brand_list'] = object_to_array(DB::table('goods_brand')->where(['status' => 0])->take(30)->orderBy('listorder', 'asc')->get()); + + return view('home.index.brandList', $data); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/Home/IndexController.php b/app/Http/Controllers/Home/IndexController.php index f81bc41..e3921bf 100644 --- a/app/Http/Controllers/Home/IndexController.php +++ b/app/Http/Controllers/Home/IndexController.php @@ -1,61 +1,61 @@ 1, 'status' => 0, - 'limit' => 6, + 'limit' => 6, 'offset' => 0 - ); - $url = env('APP_API_URL')."/goods_list"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/goods_list"; + $res = curl_request($url, $postdata, 'GET'); $data['tjlist'] = $res['data']['list']; - + //商品列表 $pagesize = 15; $offset = 0; - if(isset($_REQUEST['page'])){$offset = ($_REQUEST['page']-1)*$pagesize;} - + if (isset($_REQUEST['page'])) { + $offset = ($_REQUEST['page'] - 1) * $pagesize; + } + $postdata = array( 'status' => 0, - 'limit' => $pagesize, + 'limit' => $pagesize, 'offset' => $offset - ); - $url = env('APP_API_URL')."/goods_list"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/goods_list"; + $res = curl_request($url, $postdata, 'GET'); $data['list'] = $res['data']['list']; - - $data['totalpage'] = ceil($res['data']['count']/$pagesize); - - if(isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax']==1) - { - $html = ''; - - if($res['data']['list']) - { - foreach($res['data']['list'] as $k => $v) - { - $html .= '
  • '.$v['title'].''; - $html .= '

    '.$v['title'].'

    '; - $html .= '

    库存('.$v['goods_number'].') '.$v['description'].'

    '; - $html .= '
    ¥'.ceil($v['price']).'
    '; - $html .= '
    ¥'.$v['market_price'].' 包邮
    '.$v['sale'].' 件已付款
  • '; - + + $data['totalpage'] = ceil($res['data']['count'] / $pagesize); + + if (isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax'] == 1) { + $html = ''; + + if ($res['data']['list']) { + foreach ($res['data']['list'] as $k => $v) { + $html .= '
  • ' . $v['title'] . ''; + $html .= '

    ' . $v['title'] . '

    '; + $html .= '

    库存(' . $v['goods_number'] . ') ' . $v['description'] . '

    '; + $html .= '
    ¥' . ceil($v['price']) . '
    '; + $html .= '
    ¥' . $v['market_price'] . ' 包邮
    ' . $v['sale'] . ' 件已付款
  • '; + /* if($v['is_promote_goods']>0) { $html .= 'Hot'; @@ -65,67 +65,72 @@ class IndexController extends CommonController $html .= ''; */ } } - - exit(json_encode($html)); - } - + + exit(json_encode($html)); + } + //商品分类列表 $postdata = array( - 'pid' => 0, - 'limit' => 15, + 'pid' => 0, + 'limit' => 15, 'offset' => 0 - ); - $url = env('APP_API_URL')."/goodstype_list"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/goodstype_list"; + $res = curl_request($url, $postdata, 'GET'); $data['goodstype_list'] = $res['data']['list']; - + //banner轮播图 $postdata = array( - 'type' => 0, - 'limit' => 5, + 'type' => 0, + 'limit' => 5, 'offset' => 0 - ); - $url = env('APP_API_URL')."/slide_list"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/slide_list"; + $res = curl_request($url, $postdata, 'GET'); $data['slide_list'] = $res['data']['list']; - - return view('home.index.index',$data); + + return view('home.index.index', $data); } - - //商品列表页 + + //商品列表页 public function goodslist(Request $request) - { - if($request->input('typeid', null) != null){$postdata['typeid'] = $request->input('typeid');} - if($request->input('orderby', null) != null){$postdata['orderby'] = $request->input('orderby');} - if($request->input('tuijian', null) != null){$postdata['tuijian'] = $request->input('tuijian');} - + { + if ($request->input('typeid', null) != null) { + $postdata['typeid'] = $request->input('typeid'); + } + if ($request->input('orderby', null) != null) { + $postdata['orderby'] = $request->input('orderby'); + } + if ($request->input('tuijian', null) != null) { + $postdata['tuijian'] = $request->input('tuijian'); + } + $pagesize = 15; $offset = 0; - if(isset($_REQUEST['page'])){$offset = ($_REQUEST['page']-1)*$pagesize;} - + if (isset($_REQUEST['page'])) { + $offset = ($_REQUEST['page'] - 1) * $pagesize; + } + //商品列表 $postdata['limit'] = $pagesize; $postdata['offset'] = $offset; - $url = env('APP_API_URL')."/goods_list"; - $res = curl_request($url,$postdata,'GET'); + $url = env('APP_API_URL') . "/goods_list"; + $res = curl_request($url, $postdata, 'GET'); $data['list'] = $res['data']['list']; - - $data['totalpage'] = ceil($res['data']['count']/$pagesize); - - if(isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax']==1) - { - $html = ''; - - if($res['data']['list']) - { - foreach($res['data']['list'] as $k => $v) - { - $html .= '
  • '.$v['title'].''; - $html .= '

    '.$v['title'].'

    '; - $html .= '

    库存('.$v['goods_number'].') '.$v['description'].'

    '; - $html .= '
    ¥'.ceil($v['price']).'
    '; - $html .= '
    ¥'.$v['market_price'].' 包邮
    '.$v['sale'].' 件已付款
  • '; - + + $data['totalpage'] = ceil($res['data']['count'] / $pagesize); + + if (isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax'] == 1) { + $html = ''; + + if ($res['data']['list']) { + foreach ($res['data']['list'] as $k => $v) { + $html .= '
  • ' . $v['title'] . ''; + $html .= '

    ' . $v['title'] . '

    '; + $html .= '

    库存(' . $v['goods_number'] . ') ' . $v['description'] . '

    '; + $html .= '
    ¥' . ceil($v['price']) . '
    '; + $html .= '
    ¥' . $v['market_price'] . ' 包邮
    ' . $v['sale'] . ' 件已付款
  • '; + /* if($v['is_promote_goods']>0) { $html .= 'Hot'; @@ -135,352 +140,387 @@ class IndexController extends CommonController $html .= ''; */ } } - - exit(json_encode($html)); - } - + + exit(json_encode($html)); + } + //商品分类列表 $postdata = array( - 'pid' => 0, - 'limit' => 15, + 'pid' => 0, + 'limit' => 15, 'offset' => 0 - ); - $url = env('APP_API_URL')."/goodstype_list"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/goodstype_list"; + $res = curl_request($url, $postdata, 'GET'); $data['goodstype_list'] = $res['data']['list']; - - return view('home.index.goodslist', $data); - } - + + return view('home.index.goodslist', $data); + } + //商品详情页 public function goods($id) - { - if(empty($id) || !preg_match('/[0-9]+/',$id)){return redirect()->route('page404');} - + { + if (empty($id) || !preg_match('/[0-9]+/', $id)) { + return redirect()->route('page404'); + } + $where['id'] = $id; $where['status'] = 0; $data['post'] = logic('Goods')->getOne($where); - if(!$data['post']){return redirect()->route('page404');} - - $data['tj_list'] = DB::table('goods')->where(['tuijian'=>1,'status'=>0])->orderBy('id', 'desc')->get(); - + if (!$data['post']) { + return redirect()->route('page404'); + } + + $data['tj_list'] = DB::table('goods')->where(['tuijian' => 1, 'status' => 0])->orderBy('id', 'desc')->get(); + return view('home.index.goods', $data); } - + //商品列表页 public function brandList(Request $request) - { - $data['brand_list'] = object_to_array(DB::table('goods_brand')->where(['status'=>0])->take(30)->orderBy('listorder','asc')->get()); - + { + $data['brand_list'] = object_to_array(DB::table('goods_brand')->where(['status' => 0])->take(30)->orderBy('listorder', 'asc')->get()); + return view('home.index.brandList', $data); } - + //网址组装 - public function listpageurl($http_host,$query_string,$page=0) - { + public function listpageurl($http_host, $query_string, $page = 0) + { $res = ''; - foreach(explode("&",$query_string) as $row) - { - if($row) - { - $canshu = explode("=",$row); + foreach (explode("&", $query_string) as $row) { + if ($row) { + $canshu = explode("=", $row); $res[$canshu[0]] = $canshu[1]; } } - - if(isset($res['page'])) - { + + if (isset($res['page'])) { unset($res['page']); } - - if($page==1 || $page==0){}else{$res['page'] = $page;} - - if($res){$res = $http_host.'?'.http_build_query($res);} - + + if ($page == 1 || $page == 0) { + } else { + $res['page'] = $page; + } + + if ($res) { + $res = $http_host . '?' . http_build_query($res); + } + return $res; } - + //列表页 public function category(Request $request) - { + { $pagesize = 10; $offset = 0; - + //文章分类 $postdata = array( - 'id' => $cat - ); - $url = env('APP_API_URL')."/arctype_detail"; - $arctype_detail = curl_request($url,$postdata,'GET'); + 'id' => $cat + ); + $url = env('APP_API_URL') . "/arctype_detail"; + $arctype_detail = curl_request($url, $postdata, 'GET'); $data['post'] = $arctype_detail['data']; dd($data['post']); - if(isset($_REQUEST['page'])){$offset = ($_REQUEST['page']-1)*$pagesize;} - + if (isset($_REQUEST['page'])) { + $offset = ($_REQUEST['page'] - 1) * $pagesize; + } + //文章列表 $postdata2['limit'] = $limit; $postdata2['offset'] = $offset; - if($request->input('typeid', null) != null){$postdata2['typeid'] = $request->input('typeid');} - - $url = env('APP_API_URL')."/article_list"; - $res = curl_request($url,$postdata2,'GET'); + if ($request->input('typeid', null) != null) { + $postdata2['typeid'] = $request->input('typeid'); + } + + $url = env('APP_API_URL') . "/article_list"; + $res = curl_request($url, $postdata2, 'GET'); $data['list'] = $res['data']['list']; - - $data['totalpage'] = ceil($res['data']['count']/$pagesize); - - if(isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax']==1) - { - $html = ''; - - if($res['data']['list']) - { - foreach($res['data']['list'] as $k => $v) - { - $html .= '
  • '.$v['title'].'

    '.$v['pubdate'].'

  • '; + + $data['totalpage'] = ceil($res['data']['count'] / $pagesize); + + if (isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax'] == 1) { + $html = ''; + + if ($res['data']['list']) { + foreach ($res['data']['list'] as $k => $v) { + $html .= '
  • ' . $v['title'] . '

    ' . $v['pubdate'] . '

  • '; } } - - exit(json_encode($html)); - } - - return view('home.index.'.$data['post']['templist'], $data); - } - + + exit(json_encode($html)); + } + + return view('home.index.' . $data['post']['templist'], $data); + } + //文章列表页 public function arclist(Request $request) { $pagesize = 10; $offset = 0; - + //文章分类 - if($request->input('typeid', null) != null) - { + if ($request->input('typeid', null) != null) { $postdata = array( - 'id' => $request->input('typeid') + 'id' => $request->input('typeid') ); - $url = env('APP_API_URL')."/arctype_detail"; - $arctype_detail = curl_request($url,$postdata,'GET'); + $url = env('APP_API_URL') . "/arctype_detail"; + $arctype_detail = curl_request($url, $postdata, 'GET'); $data['post'] = $arctype_detail['data']; } - - if(isset($_REQUEST['page'])){$offset = ($_REQUEST['page']-1)*$pagesize;} - + + if (isset($_REQUEST['page'])) { + $offset = ($_REQUEST['page'] - 1) * $pagesize; + } + //文章列表 $postdata2 = array( - 'limit' => $pagesize, + 'limit' => $pagesize, 'offset' => $offset - ); - if($request->input('typeid', null) != null){$postdata2['typeid'] = $request->input('typeid');} - - $url = env('APP_API_URL')."/article_list"; - $res = curl_request($url,$postdata2,'GET'); + ); + if ($request->input('typeid', null) != null) { + $postdata2['typeid'] = $request->input('typeid'); + } + + $url = env('APP_API_URL') . "/article_list"; + $res = curl_request($url, $postdata2, 'GET'); $data['list'] = $res['data']['list']; - - $data['totalpage'] = ceil($res['data']['count']/$pagesize); - - if(isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax']==1) - { - $html = ''; - - if($res['data']['list']) - { - foreach($res['data']['list'] as $k => $v) - { + + $data['totalpage'] = ceil($res['data']['count'] / $pagesize); + + if (isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax'] == 1) { + $html = ''; + + if ($res['data']['list']) { + foreach ($res['data']['list'] as $k => $v) { $html .= '
    '; - if(!empty($v['litpic'])) - { - $html .= '$v['id'],"catid"=>$v['typeid'],"type"=>'content')).'">'.$v['title'].''; + if (!empty($v['litpic'])) { + $html .= ' $v['id'], "catid" => $v['typeid'], "type" => 'content')) . '">' . $v['title'] . ''; } - $html .= '$v['id'],"catid"=>$v['typeid'],"type"=>'content')).'">'.$v['title'].'

    '.mb_strcut($v['description'],0,150,'UTF-8').'..

    '; + $html .= ' $v['id'], "catid" => $v['typeid'], "type" => 'content')) . '">' . $v['title'] . '

    ' . mb_strcut($v['description'], 0, 150, 'UTF-8') . '..

    '; $html .= '
    '; - $taglist=taglist($v['id']); - if($taglist) - { - foreach($taglist as $row) - { - $html .= '$row['id'],"type"=>'tags')).'">'.$row['tag'].''; + $taglist = taglist($v['id']); + if ($taglist) { + foreach ($taglist as $row) { + $html .= ' $row['id'], "type" => 'tags')) . '">' . $row['tag'] . ''; } } - $html .= ''.date("m-d H:i",$v['pubdate']).''.$v['click'].'人阅读
    '; + $html .= '' . date("m-d H:i", $v['pubdate']) . '' . $v['click'] . '人阅读
    '; } } - - exit(json_encode($html)); - } - - return view('home.index.arclist', $data); - } - + + exit(json_encode($html)); + } + + return view('home.index.arclist', $data); + } + //文章详情页 public function detail($id) - { - if(empty($id) || !preg_match('/[0-9]+/',$id)){return redirect()->route('page404');} - - if(cache("detailid$id")){$post = cache("detailid$id");}else{$post = object_to_array(DB::table('article')->where('id', $id)->first(), 1);if(empty($post)){return redirect()->route('page404');}$post['name'] = DB::table('arctype')->where('id', $post['typeid'])->value('name');cache(["detailid$id"=>$post], \Carbon\Carbon::now()->addMinutes(2592000));} - if($post) - { - $cat = $post['typeid']; - $post['body'] = ReplaceKeyword($post['body']); - if(!empty($post['writer'])){$post['writertitle']=$post['title'].' '.$post['writer'];} - - $data['post'] = $post; - $data['pre'] = get_article_prenext(array('aid'=>$post["id"],'typeid'=>$post["typeid"],'type'=>"pre")); + { + if (empty($id) || !preg_match('/[0-9]+/', $id)) { + return redirect()->route('page404'); } - else - { + + if (cache("detailid$id")) { + $post = cache("detailid$id"); + } else { + $post = object_to_array(DB::table('article')->where('id', $id)->first(), 1); + if (empty($post)) { + return redirect()->route('page404'); + } + $post['name'] = DB::table('arctype')->where('id', $post['typeid'])->value('name'); + cache(["detailid$id" => $post], \Carbon\Carbon::now()->addMinutes(2592000)); + } + if ($post) { + $cat = $post['typeid']; + $post['body'] = ReplaceKeyword($post['body']); + if (!empty($post['writer'])) { + $post['writertitle'] = $post['title'] . ' ' . $post['writer']; + } + + $data['post'] = $post; + $data['pre'] = get_article_prenext(array('aid' => $post["id"], 'typeid' => $post["typeid"], 'type' => "pre")); + } else { return redirect()->route('page404'); } - - if(cache("catid$cat")){$post=cache("catid$cat");}else{$post = object_to_array(DB::table('arctype')->where('id', $cat)->first(), 1);cache(["catid$cat"=>$post], \Carbon\Carbon::now()->addMinutes(2592000));} - - return view('home.index.'.$post['temparticle'], $data); + + if (cache("catid$cat")) { + $post = cache("catid$cat"); + } else { + $post = object_to_array(DB::table('arctype')->where('id', $cat)->first(), 1); + cache(["catid$cat" => $post], \Carbon\Carbon::now()->addMinutes(2592000)); + } + + return view('home.index.' . $post['temparticle'], $data); } - + //标签详情页,共有3种显示方式,1正常列表,2列表显示文章,3显示描述 - public function tag($tag, $page=0) - { + public function tag($tag, $page = 0) + { $pagenow = $page; - - if(empty($tag) || !preg_match('/[0-9]+/',$tag)){return redirect()->route('page404');} - - $post = object_to_array(DB::table('tagindex')->where('id',$tag)->first(), 1); + + if (empty($tag) || !preg_match('/[0-9]+/', $tag)) { + return redirect()->route('page404'); + } + + $post = object_to_array(DB::table('tagindex')->where('id', $tag)->first(), 1); $data['post'] = $post; - - $counts=DB::table("taglist")->where('tid',$tag)->count('aid'); - if($counts>sysconfig('CMS_MAXARC')){$counts=sysconfig('CMS_MAXARC');} - $pagesize=sysconfig('CMS_PAGESIZE');$page=0; - if($counts % $pagesize){//取总数据量除以每页数的余数 - $pages = intval($counts/$pagesize) + 1; //如果有余数,则页数等于总数据量除以每页数的结果取整再加一,如果没有余数,则页数等于总数据量除以每页数的结果 - }else{$pages = $counts/$pagesize;} - if(!empty($pagenow)){if($pagenow==1 || $pagenow>$pages){return redirect()->route('page404');}$page = $pagenow-1;$nextpage=$pagenow+1;$previouspage=$pagenow-1;}else{$page = 0;$nextpage=2;$previouspage=0;} - $data['page'] = $page; - $data['pages'] = $pages; - $data['counts'] = $counts; - $start=$page*$pagesize; - - $posts=object_to_array(DB::table("taglist")->where('tid',$tag)->orderBy('aid', 'desc')->skip($start)->take($pagesize)->get()); - foreach($posts as $row) - { - $aid[] = $row["aid"]; - } - $aid = isset($aid)?implode(',',$aid):""; - - if($aid!="") - { - if($post['template']=='tag2') - { - $data['posts'] = arclist(array("sql"=>"id in ($aid)","orderby"=>['id', 'desc'],"row"=>"$pagesize","field"=>"title,body")); //获取列表 - } - else - { - $data['posts'] = arclist(array("sql"=>"id in ($aid)","orderby"=>['id', 'desc'],"row"=>"$pagesize")); //获取列表 + + $counts = DB::table("taglist")->where('tid', $tag)->count('aid'); + if ($counts > sysconfig('CMS_MAXARC')) { + $counts = sysconfig('CMS_MAXARC'); + } + $pagesize = sysconfig('CMS_PAGESIZE'); + $page = 0; + if ($counts % $pagesize) {//取总数据量除以每页数的余数 + $pages = intval($counts / $pagesize) + 1; //如果有余数,则页数等于总数据量除以每页数的结果取整再加一,如果没有余数,则页数等于总数据量除以每页数的结果 + } else { + $pages = $counts / $pagesize; + } + if (!empty($pagenow)) { + if ($pagenow == 1 || $pagenow > $pages) { + return redirect()->route('page404'); } + $page = $pagenow - 1; + $nextpage = $pagenow + 1; + $previouspage = $pagenow - 1; + } else { + $page = 0; + $nextpage = 2; + $previouspage = 0; + } + $data['page'] = $page; + $data['pages'] = $pages; + $data['counts'] = $counts; + $start = $page * $pagesize; + + $posts = object_to_array(DB::table("taglist")->where('tid', $tag)->orderBy('aid', 'desc')->skip($start)->take($pagesize)->get()); + foreach ($posts as $row) { + $aid[] = $row["aid"]; } - else - { + $aid = isset($aid) ? implode(',', $aid) : ""; + + if ($aid != "") { + if ($post['template'] == 'tag2') { + $data['posts'] = arclist(array("sql" => "id in ($aid)", "orderby" => ['id', 'desc'], "row" => "$pagesize", "field" => "title,body")); //获取列表 + } else { + $data['posts'] = arclist(array("sql" => "id in ($aid)", "orderby" => ['id', 'desc'], "row" => "$pagesize")); //获取列表 + } + } else { $data['posts'] = ''; //获取列表 } - - $data['pagenav'] = get_listnav(array("counts"=>$counts,"pagesize"=>$pagesize,"pagenow"=>$page+1,"catid"=>$tag,"urltype"=>"tag")); //获取分页列表 - - if($post['template']=='tag2' || $post['template']=='tag3'){if(!empty($pagenow)){return redirect()->route('page404');}} - - return view('home.index.'.$post['template'], $data); + + $data['pagenav'] = get_listnav(array("counts" => $counts, "pagesize" => $pagesize, "pagenow" => $page + 1, "catid" => $tag, "urltype" => "tag")); //获取分页列表 + + if ($post['template'] == 'tag2' || $post['template'] == 'tag3') { + if (!empty($pagenow)) { + return redirect()->route('page404'); + } + } + + return view('home.index.' . $post['template'], $data); } - - //标签页 + + //标签页 public function tags() - { - return view('home.index.tags'); + { + return view('home.index.tags'); } - + //搜索页 - public function search($keyword) - { - if(empty($keyword)) - { - echo '请输入正确的关键词';exit; - } - - if(strstr($keyword,"&")) exit; - - $data['posts']= object_to_array(DB::table("article")->where("title", "like", "%$keyword%")->orderBy('id', 'desc')->take(30)->get()); - $data['keyword']= $keyword; - - return view('home.index.search', $data); + public function search($keyword) + { + if (empty($keyword)) { + echo '请输入正确的关键词'; + exit; + } + + if (strstr($keyword, "&")) exit; + + $data['posts'] = object_to_array(DB::table("article")->where("title", "like", "%$keyword%")->orderBy('id', 'desc')->take(30)->get()); + $data['keyword'] = $keyword; + + return view('home.index.search', $data); } - + //单页面 public function page($id) - { - $data = []; - - if(!empty($id) && preg_match('/[a-z0-9]+/',$id)) - { - $map['filename']=$id; - if(cache("pageid$id")){$post=cache("pageid$id");}else{$post = object_to_array(DB::table('page')->where($map)->first(), 1);cache("pageid$id", $post, 2592000);cache(["pageid$id"=>$post], \Carbon\Carbon::now()->addMinutes(2592000));} - - if($post) - { - $data['post'] = $post; + { + $data = []; + + if (!empty($id) && preg_match('/[a-z0-9]+/', $id)) { + $map['filename'] = $id; + if (cache("pageid$id")) { + $post = cache("pageid$id"); + } else { + $post = object_to_array(DB::table('page')->where($map)->first(), 1); + cache("pageid$id", $post, 2592000); + cache(["pageid$id" => $post], \Carbon\Carbon::now()->addMinutes(2592000)); } - else - { + + if ($post) { + $data['post'] = $post; + } else { return redirect()->route('page404'); } - - } - else - { + + } else { return redirect()->route('page404'); } - - $data['posts'] = object_to_array(DB::table('page')->orderBy(\DB::raw('rand()'))->take(5)->get()); - - return view('home.index.'.$post['template'], $data); + + $data['posts'] = object_to_array(DB::table('page')->orderBy(\DB::raw('rand()'))->take(5)->get()); + + return view('home.index.' . $post['template'], $data); } - - //sitemap页面 + + //sitemap页面 public function sitemap() { - return view('home.index.sitemap'); + return view('home.index.sitemap'); + } + + //404页面 + public function page404() + { + return view('home.404'); } - - //404页面 - public function page404() - { - return view('home.404'); - } - + //验证消息的确来自微信服务器 public function checksignature() - { - $signature = $_GET["signature"]; - $timestamp = $_GET["timestamp"]; - $nonce = $_GET["nonce"]; - $echoStr = $_GET["echostr"]; - - $token = 'fanli'; - $tmpArr = array($token, $timestamp, $nonce); - sort($tmpArr, SORT_STRING); - $tmpStr = implode( $tmpArr ); - $tmpStr = sha1( $tmpStr ); - - if( $tmpStr == $signature ){ - exit($echoStr); - }else{ - return false; - } - } - + { + $signature = $_GET["signature"]; + $timestamp = $_GET["timestamp"]; + $nonce = $_GET["nonce"]; + $echoStr = $_GET["echostr"]; + + $token = 'fanli'; + $tmpArr = array($token, $timestamp, $nonce); + sort($tmpArr, SORT_STRING); + $tmpStr = implode($tmpArr); + $tmpStr = sha1($tmpStr); + + if ($tmpStr == $signature) { + exit($echoStr); + } else { + return false; + } + } + //测试页面 - public function test() - {return view('home.index.test'); + public function test() + { + return view('home.index.test'); //return base_path('resources/org'); //$qrcode = new \SimpleSoftwareIO\QrCode\BaconQrCodeGenerator; //return $qrcode->size(500)->generate('Make a qrcode without Laravel!'); //return ''; - //set_exception_handler('myException'); - //return uniqid(); - //return \App\Common\Helper::formatPrice(1.2346); + //set_exception_handler('myException'); + //return uniqid(); + //return \App\Common\Helper::formatPrice(1.2346); } } \ No newline at end of file diff --git a/app/Http/Controllers/Home/IndexController企业.php b/app/Http/Controllers/Home/IndexController企业.php index f68253f..793657f 100644 --- a/app/Http/Controllers/Home/IndexController企业.php +++ b/app/Http/Controllers/Home/IndexController企业.php @@ -1,276 +1,378 @@ where($where)->select('id','title','price','litpic','description','shipping_fee','market_price','goods_number','sale')->take(30)->orderBy('pubdate','desc')->get()); - $data['goods_type_list'] = object_to_array(DB::table('goods_type')->where(['pid'=>0,'status'=>1])->select('id','name')->take(30)->orderBy('listorder','asc')->get()); - $data['slide_list'] = object_to_array(DB::table('slide')->where(['group_id'=>0,'type'=>0,'is_show'=>0])->take(30)->orderBy('listorder','asc')->get()); - $data['ztad_list'] = object_to_array(DB::table('slide')->where(['group_id'=>1,'type'=>0,'is_show'=>0])->take(30)->orderBy('listorder','asc')->get()); - - return view('home.index.index',$data); + $data['goods_list'] = object_to_array(DB::table('goods')->where($where)->select('id', 'title', 'price', 'litpic', 'description', 'shipping_fee', 'market_price', 'goods_number', 'sale')->take(30)->orderBy('pubdate', 'desc')->get()); + $data['goods_type_list'] = object_to_array(DB::table('goods_type')->where(['pid' => 0, 'status' => 1])->select('id', 'name')->take(30)->orderBy('listorder', 'asc')->get()); + $data['slide_list'] = object_to_array(DB::table('slide')->where(['group_id' => 0, 'type' => 0, 'is_show' => 0])->take(30)->orderBy('listorder', 'asc')->get()); + $data['ztad_list'] = object_to_array(DB::table('slide')->where(['group_id' => 1, 'type' => 0, 'is_show' => 0])->take(30)->orderBy('listorder', 'asc')->get()); + + return view('home.index.index', $data); } - + //列表页 - public function category($cat, $page=0) - { + public function category($cat, $page = 0) + { $pagenow = $page; - - if(empty($cat) || !preg_match('/[0-9]+/',$cat)){return redirect()->route('page404');} - - if(cache("catid$cat")){$post = cache("catid$cat");}else{$post = object_to_array(DB::table('arctype')->where('id', $cat)->first(), 1);if(empty($post)){return redirect()->route('page404');} cache(["catid$cat"=>$post], \Carbon\Carbon::now()->addMinutes(2592000));} + + if (empty($cat) || !preg_match('/[0-9]+/', $cat)) { + return redirect()->route('page404'); + } + + if (cache("catid$cat")) { + $post = cache("catid$cat"); + } else { + $post = object_to_array(DB::table('arctype')->where('id', $cat)->first(), 1); + if (empty($post)) { + return redirect()->route('page404'); + } + cache(["catid$cat" => $post], \Carbon\Carbon::now()->addMinutes(2592000)); + } $data['post'] = $post; - - $subcat="";$sql=""; - $post2 = object_to_array(DB::table('arctype')->select('id')->where('pid', $cat)->get()); - if(!empty($post2)){foreach($post2 as $row){$subcat=$subcat."typeid=".$row["id"]." or ";}} - $subcat=$subcat."typeid=".$cat; - $sql=$subcat." or typeid2 in (".$cat.")";//echo $subcat2;exit; - $data['sql'] = $sql; - - $counts = DB::table("article")->whereRaw($sql)->count(); - if($counts>sysconfig('CMS_MAXARC')){$counts=sysconfig('CMS_MAXARC');dd($counts);} - $pagesize = sysconfig('CMS_PAGESIZE');$page=0; - if($counts % $pagesize){//取总数据量除以每页数的余数 - $pages = intval($counts/$pagesize) + 1; //如果有余数,则页数等于总数据量除以每页数的结果取整再加一,如果没有余数,则页数等于总数据量除以每页数的结果 - }else{$pages = $counts/$pagesize;} - if(!empty($pagenow)){if($pagenow==1 || $pagenow>$pages){return redirect()->route('page404');}$page = $pagenow-1;$nextpage=$pagenow+1;$previouspage=$pagenow-1;}else{$page = 0;$nextpage=2;$previouspage=0;} - $data['page'] = $page; - $data['pages'] = $pages; - $data['counts'] = $counts; - $start = $page*$pagesize; - - $data['posts'] = arclist(array("sql"=>$sql, "limit"=>"$start,$pagesize")); //获取列表 - $data['pagenav'] = get_listnav(array("counts"=>$counts,"pagesize"=>$pagesize,"pagenow"=>$page+1,"catid"=>$cat)); //获取分页列表 - - if($post['templist']=='category2'){if(!empty($pagenow)){return redirect()->route('page404');}} - - return view('home.index.'.$post['templist'], $data); - } - + + $subcat = ""; + $sql = ""; + $post2 = object_to_array(DB::table('arctype')->select('id')->where('pid', $cat)->get()); + if (!empty($post2)) { + foreach ($post2 as $row) { + $subcat = $subcat . "typeid=" . $row["id"] . " or "; + } + } + $subcat = $subcat . "typeid=" . $cat; + $sql = $subcat . " or typeid2 in (" . $cat . ")";//echo $subcat2;exit; + $data['sql'] = $sql; + + $counts = DB::table("article")->whereRaw($sql)->count(); + if ($counts > sysconfig('CMS_MAXARC')) { + $counts = sysconfig('CMS_MAXARC'); + dd($counts); + } + $pagesize = sysconfig('CMS_PAGESIZE'); + $page = 0; + if ($counts % $pagesize) {//取总数据量除以每页数的余数 + $pages = intval($counts / $pagesize) + 1; //如果有余数,则页数等于总数据量除以每页数的结果取整再加一,如果没有余数,则页数等于总数据量除以每页数的结果 + } else { + $pages = $counts / $pagesize; + } + if (!empty($pagenow)) { + if ($pagenow == 1 || $pagenow > $pages) { + return redirect()->route('page404'); + } + $page = $pagenow - 1; + $nextpage = $pagenow + 1; + $previouspage = $pagenow - 1; + } else { + $page = 0; + $nextpage = 2; + $previouspage = 0; + } + $data['page'] = $page; + $data['pages'] = $pages; + $data['counts'] = $counts; + $start = $page * $pagesize; + + $data['posts'] = arclist(array("sql" => $sql, "limit" => "$start,$pagesize")); //获取列表 + $data['pagenav'] = get_listnav(array("counts" => $counts, "pagesize" => $pagesize, "pagenow" => $page + 1, "catid" => $cat)); //获取分页列表 + + if ($post['templist'] == 'category2') { + if (!empty($pagenow)) { + return redirect()->route('page404'); + } + } + + return view('home.index.' . $post['templist'], $data); + } + //文章详情页 public function detail($id) - { - if(empty($id) || !preg_match('/[0-9]+/',$id)){return redirect()->route('page404');} - - if(cache("detailid$id")){$post = cache("detailid$id");}else{$post = object_to_array(DB::table('article')->where('id', $id)->first(), 1);if(empty($post)){return redirect()->route('page404');}$post['name'] = DB::table('arctype')->where('id', $post['typeid'])->value('name');cache(["detailid$id"=>$post], \Carbon\Carbon::now()->addMinutes(2592000));} - if($post) - { - $cat = $post['typeid']; - $post['body'] = ReplaceKeyword($post['body']); - if(!empty($post['writer'])){$post['writertitle']=$post['title'].' '.$post['writer'];} - - $data['post'] = $post; - $data['pre'] = get_article_prenext(array('aid'=>$post["id"],'typeid'=>$post["typeid"],'type'=>"pre")); + { + if (empty($id) || !preg_match('/[0-9]+/', $id)) { + return redirect()->route('page404'); + } + + if (cache("detailid$id")) { + $post = cache("detailid$id"); + } else { + $post = object_to_array(DB::table('article')->where('id', $id)->first(), 1); + if (empty($post)) { + return redirect()->route('page404'); + } + $post['name'] = DB::table('arctype')->where('id', $post['typeid'])->value('name'); + cache(["detailid$id" => $post], \Carbon\Carbon::now()->addMinutes(2592000)); } - else - { + if ($post) { + $cat = $post['typeid']; + $post['body'] = ReplaceKeyword($post['body']); + if (!empty($post['writer'])) { + $post['writertitle'] = $post['title'] . ' ' . $post['writer']; + } + + $data['post'] = $post; + $data['pre'] = get_article_prenext(array('aid' => $post["id"], 'typeid' => $post["typeid"], 'type' => "pre")); + } else { return redirect()->route('page404'); } - - if(cache("catid$cat")){$post=cache("catid$cat");}else{$post = object_to_array(DB::table('arctype')->where('id', $cat)->first(), 1);cache(["catid$cat"=>$post], \Carbon\Carbon::now()->addMinutes(2592000));} - - return view('home.index.'.$post['temparticle'], $data); + + if (cache("catid$cat")) { + $post = cache("catid$cat"); + } else { + $post = object_to_array(DB::table('arctype')->where('id', $cat)->first(), 1); + cache(["catid$cat" => $post], \Carbon\Carbon::now()->addMinutes(2592000)); + } + + return view('home.index.' . $post['temparticle'], $data); } - + //标签详情页,共有3种显示方式,1正常列表,2列表显示文章,3显示描述 - public function tag($tag, $page=0) - { + public function tag($tag, $page = 0) + { $pagenow = $page; - - if(empty($tag) || !preg_match('/[0-9]+/',$tag)){return redirect()->route('page404');} - - $post = object_to_array(DB::table('tagindex')->where('id',$tag)->first(), 1); + + if (empty($tag) || !preg_match('/[0-9]+/', $tag)) { + return redirect()->route('page404'); + } + + $post = object_to_array(DB::table('tagindex')->where('id', $tag)->first(), 1); $data['post'] = $post; - - $counts=DB::table("taglist")->where('tid',$tag)->count('aid'); - if($counts>sysconfig('CMS_MAXARC')){$counts=sysconfig('CMS_MAXARC');} - $pagesize=sysconfig('CMS_PAGESIZE');$page=0; - if($counts % $pagesize){//取总数据量除以每页数的余数 - $pages = intval($counts/$pagesize) + 1; //如果有余数,则页数等于总数据量除以每页数的结果取整再加一,如果没有余数,则页数等于总数据量除以每页数的结果 - }else{$pages = $counts/$pagesize;} - if(!empty($pagenow)){if($pagenow==1 || $pagenow>$pages){return redirect()->route('page404');}$page = $pagenow-1;$nextpage=$pagenow+1;$previouspage=$pagenow-1;}else{$page = 0;$nextpage=2;$previouspage=0;} - $data['page'] = $page; - $data['pages'] = $pages; - $data['counts'] = $counts; - $start=$page*$pagesize; - - $posts=object_to_array(DB::table("taglist")->where('tid',$tag)->orderBy('aid', 'desc')->skip($start)->take($pagesize)->get()); - foreach($posts as $row) - { - $aid[] = $row["aid"]; - } - $aid = isset($aid)?implode(',',$aid):""; - - if($aid!="") - { - if($post['template']=='tag2') - { - $data['posts'] = arclist(array("sql"=>"id in ($aid)","orderby"=>['id', 'desc'],"row"=>"$pagesize","field"=>"title,body")); //获取列表 - } - else - { - $data['posts'] = arclist(array("sql"=>"id in ($aid)","orderby"=>['id', 'desc'],"row"=>"$pagesize")); //获取列表 + + $counts = DB::table("taglist")->where('tid', $tag)->count('aid'); + if ($counts > sysconfig('CMS_MAXARC')) { + $counts = sysconfig('CMS_MAXARC'); + } + $pagesize = sysconfig('CMS_PAGESIZE'); + $page = 0; + if ($counts % $pagesize) {//取总数据量除以每页数的余数 + $pages = intval($counts / $pagesize) + 1; //如果有余数,则页数等于总数据量除以每页数的结果取整再加一,如果没有余数,则页数等于总数据量除以每页数的结果 + } else { + $pages = $counts / $pagesize; + } + if (!empty($pagenow)) { + if ($pagenow == 1 || $pagenow > $pages) { + return redirect()->route('page404'); } + $page = $pagenow - 1; + $nextpage = $pagenow + 1; + $previouspage = $pagenow - 1; + } else { + $page = 0; + $nextpage = 2; + $previouspage = 0; } - else - { + $data['page'] = $page; + $data['pages'] = $pages; + $data['counts'] = $counts; + $start = $page * $pagesize; + + $posts = object_to_array(DB::table("taglist")->where('tid', $tag)->orderBy('aid', 'desc')->skip($start)->take($pagesize)->get()); + foreach ($posts as $row) { + $aid[] = $row["aid"]; + } + $aid = isset($aid) ? implode(',', $aid) : ""; + + if ($aid != "") { + if ($post['template'] == 'tag2') { + $data['posts'] = arclist(array("sql" => "id in ($aid)", "orderby" => ['id', 'desc'], "row" => "$pagesize", "field" => "title,body")); //获取列表 + } else { + $data['posts'] = arclist(array("sql" => "id in ($aid)", "orderby" => ['id', 'desc'], "row" => "$pagesize")); //获取列表 + } + } else { $data['posts'] = ''; //获取列表 } - - $data['pagenav'] = get_listnav(array("counts"=>$counts,"pagesize"=>$pagesize,"pagenow"=>$page+1,"catid"=>$tag,"urltype"=>"tag")); //获取分页列表 - - if($post['template']=='tag2' || $post['template']=='tag3'){if(!empty($pagenow)){return redirect()->route('page404');}} - - return view('home.index.'.$post['template'], $data); + + $data['pagenav'] = get_listnav(array("counts" => $counts, "pagesize" => $pagesize, "pagenow" => $page + 1, "catid" => $tag, "urltype" => "tag")); //获取分页列表 + + if ($post['template'] == 'tag2' || $post['template'] == 'tag3') { + if (!empty($pagenow)) { + return redirect()->route('page404'); + } + } + + return view('home.index.' . $post['template'], $data); } - - //标签页 + + //标签页 public function tags() - { - return view('home.index.tags'); + { + return view('home.index.tags'); } - + //搜索页 - public function search($keyword) - { - if(empty($keyword)) - { - echo '请输入正确的关键词';exit; - } - - if(strstr($keyword,"&")) exit; - - $data['posts']= object_to_array(DB::table("article")->where("title", "like", "%$keyword%")->orderBy('id', 'desc')->take(30)->get()); - $data['keyword']= $keyword; - - return view('home.index.search', $data); + public function search($keyword) + { + if (empty($keyword)) { + echo '请输入正确的关键词'; + exit; + } + + if (strstr($keyword, "&")) exit; + + $data['posts'] = object_to_array(DB::table("article")->where("title", "like", "%$keyword%")->orderBy('id', 'desc')->take(30)->get()); + $data['keyword'] = $keyword; + + return view('home.index.search', $data); } - + //单页面 public function page($id) - { - $data = []; - - if(!empty($id) && preg_match('/[a-z0-9]+/',$id)) - { - $map['filename']=$id; - if(cache("pageid$id")){$post=cache("pageid$id");}else{$post = object_to_array(DB::table('page')->where($map)->first(), 1);cache("pageid$id", $post, 2592000);cache(["pageid$id"=>$post], \Carbon\Carbon::now()->addMinutes(2592000));} - - if($post) - { - $data['post'] = $post; + { + $data = []; + + if (!empty($id) && preg_match('/[a-z0-9]+/', $id)) { + $map['filename'] = $id; + if (cache("pageid$id")) { + $post = cache("pageid$id"); + } else { + $post = object_to_array(DB::table('page')->where($map)->first(), 1); + cache("pageid$id", $post, 2592000); + cache(["pageid$id" => $post], \Carbon\Carbon::now()->addMinutes(2592000)); } - else - { + + if ($post) { + $data['post'] = $post; + } else { return redirect()->route('page404'); } - - } - else - { + + } else { return redirect()->route('page404'); } - - $data['posts'] = object_to_array(DB::table('page')->orderBy(\DB::raw('rand()'))->take(5)->get()); - - return view('home.index.'.$post['template'], $data); + + $data['posts'] = object_to_array(DB::table('page')->orderBy(\DB::raw('rand()'))->take(5)->get()); + + return view('home.index.' . $post['template'], $data); } - - //商品列表页 - public function goodstype($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('goods_type')->where('id', $cat)->first(), 1);if(empty($post)){return redirect()->route('page404');} + + if (empty($cat) || !preg_match('/[0-9]+/', $cat)) { + 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('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("goods")->whereRaw($subcat)->count(); - if($counts>sysconfig('CMS_MAXARC')){$counts=sysconfig('CMS_MAXARC');dd($counts);} - $pagesize = sysconfig('CMS_PAGESIZE');$page=0; - if($counts % $pagesize){//取总数据量除以每页数的余数 - $pages = intval($counts/$pagesize) + 1; //如果有余数,则页数等于总数据量除以每页数的结果取整再加一,如果没有余数,则页数等于总数据量除以每页数的结果 - }else{$pages = $counts/$pagesize;} - if(!empty($pagenow)){if($pagenow==1 || $pagenow>$pages){return redirect()->route('page404');}$page = $pagenow-1;$nextpage=$pagenow+1;$previouspage=$pagenow-1;}else{$page = 0;$nextpage=2;$previouspage=0;} - $data['page'] = $page; - $data['pages'] = $pages; - $data['counts'] = $counts; - $start = $page*$pagesize; - - $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');}} - - return view('home.index.'.$post['templist'], $data); - } - + + $subcat = ""; + $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("goods")->whereRaw($subcat)->count(); + if ($counts > sysconfig('CMS_MAXARC')) { + $counts = sysconfig('CMS_MAXARC'); + dd($counts); + } + $pagesize = sysconfig('CMS_PAGESIZE'); + $page = 0; + if ($counts % $pagesize) {//取总数据量除以每页数的余数 + $pages = intval($counts / $pagesize) + 1; //如果有余数,则页数等于总数据量除以每页数的结果取整再加一,如果没有余数,则页数等于总数据量除以每页数的结果 + } else { + $pages = $counts / $pagesize; + } + if (!empty($pagenow)) { + if ($pagenow == 1 || $pagenow > $pages) { + return redirect()->route('page404'); + } + $page = $pagenow - 1; + $nextpage = $pagenow + 1; + $previouspage = $pagenow - 1; + } else { + $page = 0; + $nextpage = 2; + $previouspage = 0; + } + $data['page'] = $page; + $data['pages'] = $pages; + $data['counts'] = $counts; + $start = $page * $pagesize; + + $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'); + } + } + + return view('home.index.' . $post['templist'], $data); + } + //商品详情页 public function goods($id) - { - if(empty($id) || !preg_match('/[0-9]+/',$id)){return redirect()->route('page404');} - - $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']; - if(!empty($post['writer'])){$post['writertitle']=$post['title'].' '.$post['writer'];} - - $data['post'] = $post; - $data['pre'] = get_article_prenext(array('aid'=>$post["id"],'typeid'=>$post["typeid"],'type'=>"pre")); + { + if (empty($id) || !preg_match('/[0-9]+/', $id)) { + return redirect()->route('page404'); + } + + $post = object_to_array(DB::table('goods')->where('id', $id)->first(), 1); + if (empty($post)) { + return redirect()->route('page404'); } - else - { + $post['name'] = DB::table('goods_type')->where('id', $post['typeid'])->value('name'); + if ($post) { + $cat = $post['typeid']; + if (!empty($post['writer'])) { + $post['writertitle'] = $post['title'] . ' ' . $post['writer']; + } + + $data['post'] = $post; + $data['pre'] = get_article_prenext(array('aid' => $post["id"], 'typeid' => $post["typeid"], 'type' => "pre")); + } else { return redirect()->route('page404'); } - - $post = object_to_array(DB::table('goods_type')->where('id', $cat)->first(), 1); - + + $post = object_to_array(DB::table('goods_type')->where('id', $cat)->first(), 1); + return view('home.index.goods', $data); } - - //sitemap页面 + + //sitemap页面 public function sitemap() { - return view('home.index.sitemap'); + return view('home.index.sitemap'); } - - //404页面 - public function page404() - { - return view('home.404'); - } - + + //404页面 + public function page404() + { + return view('home.404'); + } + //测试页面 - public function test() - {return view('home.index.test'); + public function test() + { + return view('home.index.test'); //return base_path('resources/org'); //$qrcode = new \SimpleSoftwareIO\QrCode\BaconQrCodeGenerator; //return $qrcode->size(500)->generate('Make a qrcode without Laravel!'); //return ''; - //set_exception_handler('myException'); - //return uniqid(); - //return \App\Common\Helper::formatPrice(1.2346); + //set_exception_handler('myException'); + //return uniqid(); + //return \App\Common\Helper::formatPrice(1.2346); } } \ No newline at end of file diff --git a/app/Http/Controllers/Home/PageController.php b/app/Http/Controllers/Home/PageController.php new file mode 100644 index 0000000..7dcefd2 --- /dev/null +++ b/app/Http/Controllers/Home/PageController.php @@ -0,0 +1,43 @@ +where($map)->first(), 1); + //cache("pageid$id", $post, 2592000); + cache(["pageid$id" => $post], \Carbon\Carbon::now()->addMinutes(2592000)); + } + + if (!$post) { + return redirect()->route('page404'); + } + $data['post'] = $post; + } else { + return redirect()->route('page404'); + } + + $data['posts'] = object_to_array(DB::table('page')->orderBy(\DB::raw('rand()'))->take(5)->get()); + + return view('home.page.detail', $data); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/Home/SearchController.php b/app/Http/Controllers/Home/SearchController.php new file mode 100644 index 0000000..e3921bf --- /dev/null +++ b/app/Http/Controllers/Home/SearchController.php @@ -0,0 +1,526 @@ + 1, + 'status' => 0, + 'limit' => 6, + 'offset' => 0 + ); + $url = env('APP_API_URL') . "/goods_list"; + $res = curl_request($url, $postdata, 'GET'); + $data['tjlist'] = $res['data']['list']; + + //商品列表 + $pagesize = 15; + $offset = 0; + if (isset($_REQUEST['page'])) { + $offset = ($_REQUEST['page'] - 1) * $pagesize; + } + + $postdata = array( + 'status' => 0, + 'limit' => $pagesize, + 'offset' => $offset + ); + $url = env('APP_API_URL') . "/goods_list"; + $res = curl_request($url, $postdata, 'GET'); + $data['list'] = $res['data']['list']; + + $data['totalpage'] = ceil($res['data']['count'] / $pagesize); + + if (isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax'] == 1) { + $html = ''; + + if ($res['data']['list']) { + foreach ($res['data']['list'] as $k => $v) { + $html .= '
  • ' . $v['title'] . ''; + $html .= '

    ' . $v['title'] . '

    '; + $html .= '

    库存(' . $v['goods_number'] . ') ' . $v['description'] . '

    '; + $html .= '
    ¥' . ceil($v['price']) . '
    '; + $html .= '
    ¥' . $v['market_price'] . ' 包邮
    ' . $v['sale'] . ' 件已付款
  • '; + + /* if($v['is_promote_goods']>0) + { + $html .= 'Hot'; + } + + $html .= $v['title'].'

    '.$v['price'].''.$v['sale'].'人付款
    '; + $html .= ''; */ + } + } + + exit(json_encode($html)); + } + + //商品分类列表 + $postdata = array( + 'pid' => 0, + 'limit' => 15, + 'offset' => 0 + ); + $url = env('APP_API_URL') . "/goodstype_list"; + $res = curl_request($url, $postdata, 'GET'); + $data['goodstype_list'] = $res['data']['list']; + + //banner轮播图 + $postdata = array( + 'type' => 0, + 'limit' => 5, + 'offset' => 0 + ); + $url = env('APP_API_URL') . "/slide_list"; + $res = curl_request($url, $postdata, 'GET'); + $data['slide_list'] = $res['data']['list']; + + return view('home.index.index', $data); + } + + //商品列表页 + public function goodslist(Request $request) + { + if ($request->input('typeid', null) != null) { + $postdata['typeid'] = $request->input('typeid'); + } + if ($request->input('orderby', null) != null) { + $postdata['orderby'] = $request->input('orderby'); + } + if ($request->input('tuijian', null) != null) { + $postdata['tuijian'] = $request->input('tuijian'); + } + + $pagesize = 15; + $offset = 0; + if (isset($_REQUEST['page'])) { + $offset = ($_REQUEST['page'] - 1) * $pagesize; + } + + //商品列表 + $postdata['limit'] = $pagesize; + $postdata['offset'] = $offset; + $url = env('APP_API_URL') . "/goods_list"; + $res = curl_request($url, $postdata, 'GET'); + $data['list'] = $res['data']['list']; + + $data['totalpage'] = ceil($res['data']['count'] / $pagesize); + + if (isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax'] == 1) { + $html = ''; + + if ($res['data']['list']) { + foreach ($res['data']['list'] as $k => $v) { + $html .= '
  • ' . $v['title'] . ''; + $html .= '

    ' . $v['title'] . '

    '; + $html .= '

    库存(' . $v['goods_number'] . ') ' . $v['description'] . '

    '; + $html .= '
    ¥' . ceil($v['price']) . '
    '; + $html .= '
    ¥' . $v['market_price'] . ' 包邮
    ' . $v['sale'] . ' 件已付款
  • '; + + /* if($v['is_promote_goods']>0) + { + $html .= 'Hot'; + } + + $html .= $v['title'].'

    '.$v['price'].''.$v['sale'].'人付款
    '; + $html .= ''; */ + } + } + + exit(json_encode($html)); + } + + //商品分类列表 + $postdata = array( + 'pid' => 0, + 'limit' => 15, + 'offset' => 0 + ); + $url = env('APP_API_URL') . "/goodstype_list"; + $res = curl_request($url, $postdata, 'GET'); + $data['goodstype_list'] = $res['data']['list']; + + return view('home.index.goodslist', $data); + } + + //商品详情页 + public function goods($id) + { + if (empty($id) || !preg_match('/[0-9]+/', $id)) { + return redirect()->route('page404'); + } + + $where['id'] = $id; + $where['status'] = 0; + $data['post'] = logic('Goods')->getOne($where); + if (!$data['post']) { + return redirect()->route('page404'); + } + + $data['tj_list'] = DB::table('goods')->where(['tuijian' => 1, 'status' => 0])->orderBy('id', 'desc')->get(); + + return view('home.index.goods', $data); + } + + //商品列表页 + public function brandList(Request $request) + { + $data['brand_list'] = object_to_array(DB::table('goods_brand')->where(['status' => 0])->take(30)->orderBy('listorder', 'asc')->get()); + + return view('home.index.brandList', $data); + } + + //网址组装 + public function listpageurl($http_host, $query_string, $page = 0) + { + $res = ''; + foreach (explode("&", $query_string) as $row) { + if ($row) { + $canshu = explode("=", $row); + $res[$canshu[0]] = $canshu[1]; + } + } + + if (isset($res['page'])) { + unset($res['page']); + } + + if ($page == 1 || $page == 0) { + } else { + $res['page'] = $page; + } + + if ($res) { + $res = $http_host . '?' . http_build_query($res); + } + + return $res; + } + + //列表页 + public function category(Request $request) + { + $pagesize = 10; + $offset = 0; + + //文章分类 + $postdata = array( + 'id' => $cat + ); + $url = env('APP_API_URL') . "/arctype_detail"; + $arctype_detail = curl_request($url, $postdata, 'GET'); + $data['post'] = $arctype_detail['data']; + dd($data['post']); + if (isset($_REQUEST['page'])) { + $offset = ($_REQUEST['page'] - 1) * $pagesize; + } + + //文章列表 + $postdata2['limit'] = $limit; + $postdata2['offset'] = $offset; + if ($request->input('typeid', null) != null) { + $postdata2['typeid'] = $request->input('typeid'); + } + + $url = env('APP_API_URL') . "/article_list"; + $res = curl_request($url, $postdata2, 'GET'); + $data['list'] = $res['data']['list']; + + $data['totalpage'] = ceil($res['data']['count'] / $pagesize); + + if (isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax'] == 1) { + $html = ''; + + if ($res['data']['list']) { + foreach ($res['data']['list'] as $k => $v) { + $html .= '
  • ' . $v['title'] . '

    ' . $v['pubdate'] . '

  • '; + } + } + + exit(json_encode($html)); + } + + return view('home.index.' . $data['post']['templist'], $data); + } + + //文章列表页 + public function arclist(Request $request) + { + $pagesize = 10; + $offset = 0; + + //文章分类 + if ($request->input('typeid', null) != null) { + $postdata = array( + 'id' => $request->input('typeid') + ); + $url = env('APP_API_URL') . "/arctype_detail"; + $arctype_detail = curl_request($url, $postdata, 'GET'); + $data['post'] = $arctype_detail['data']; + } + + if (isset($_REQUEST['page'])) { + $offset = ($_REQUEST['page'] - 1) * $pagesize; + } + + //文章列表 + $postdata2 = array( + 'limit' => $pagesize, + 'offset' => $offset + ); + if ($request->input('typeid', null) != null) { + $postdata2['typeid'] = $request->input('typeid'); + } + + $url = env('APP_API_URL') . "/article_list"; + $res = curl_request($url, $postdata2, 'GET'); + $data['list'] = $res['data']['list']; + + $data['totalpage'] = ceil($res['data']['count'] / $pagesize); + + if (isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax'] == 1) { + $html = ''; + + if ($res['data']['list']) { + foreach ($res['data']['list'] as $k => $v) { + $html .= '
    '; + if (!empty($v['litpic'])) { + $html .= ' $v['id'], "catid" => $v['typeid'], "type" => 'content')) . '">' . $v['title'] . ''; + } + $html .= ' $v['id'], "catid" => $v['typeid'], "type" => 'content')) . '">' . $v['title'] . '

    ' . mb_strcut($v['description'], 0, 150, 'UTF-8') . '..

    '; + $html .= '
    '; + $taglist = taglist($v['id']); + if ($taglist) { + foreach ($taglist as $row) { + $html .= ' $row['id'], "type" => 'tags')) . '">' . $row['tag'] . ''; + } + } + $html .= '' . date("m-d H:i", $v['pubdate']) . '' . $v['click'] . '人阅读
    '; + } + } + + exit(json_encode($html)); + } + + return view('home.index.arclist', $data); + } + + //文章详情页 + public function detail($id) + { + if (empty($id) || !preg_match('/[0-9]+/', $id)) { + return redirect()->route('page404'); + } + + if (cache("detailid$id")) { + $post = cache("detailid$id"); + } else { + $post = object_to_array(DB::table('article')->where('id', $id)->first(), 1); + if (empty($post)) { + return redirect()->route('page404'); + } + $post['name'] = DB::table('arctype')->where('id', $post['typeid'])->value('name'); + cache(["detailid$id" => $post], \Carbon\Carbon::now()->addMinutes(2592000)); + } + if ($post) { + $cat = $post['typeid']; + $post['body'] = ReplaceKeyword($post['body']); + if (!empty($post['writer'])) { + $post['writertitle'] = $post['title'] . ' ' . $post['writer']; + } + + $data['post'] = $post; + $data['pre'] = get_article_prenext(array('aid' => $post["id"], 'typeid' => $post["typeid"], 'type' => "pre")); + } else { + return redirect()->route('page404'); + } + + if (cache("catid$cat")) { + $post = cache("catid$cat"); + } else { + $post = object_to_array(DB::table('arctype')->where('id', $cat)->first(), 1); + cache(["catid$cat" => $post], \Carbon\Carbon::now()->addMinutes(2592000)); + } + + return view('home.index.' . $post['temparticle'], $data); + } + + //标签详情页,共有3种显示方式,1正常列表,2列表显示文章,3显示描述 + public function tag($tag, $page = 0) + { + $pagenow = $page; + + if (empty($tag) || !preg_match('/[0-9]+/', $tag)) { + return redirect()->route('page404'); + } + + $post = object_to_array(DB::table('tagindex')->where('id', $tag)->first(), 1); + $data['post'] = $post; + + $counts = DB::table("taglist")->where('tid', $tag)->count('aid'); + if ($counts > sysconfig('CMS_MAXARC')) { + $counts = sysconfig('CMS_MAXARC'); + } + $pagesize = sysconfig('CMS_PAGESIZE'); + $page = 0; + if ($counts % $pagesize) {//取总数据量除以每页数的余数 + $pages = intval($counts / $pagesize) + 1; //如果有余数,则页数等于总数据量除以每页数的结果取整再加一,如果没有余数,则页数等于总数据量除以每页数的结果 + } else { + $pages = $counts / $pagesize; + } + if (!empty($pagenow)) { + if ($pagenow == 1 || $pagenow > $pages) { + return redirect()->route('page404'); + } + $page = $pagenow - 1; + $nextpage = $pagenow + 1; + $previouspage = $pagenow - 1; + } else { + $page = 0; + $nextpage = 2; + $previouspage = 0; + } + $data['page'] = $page; + $data['pages'] = $pages; + $data['counts'] = $counts; + $start = $page * $pagesize; + + $posts = object_to_array(DB::table("taglist")->where('tid', $tag)->orderBy('aid', 'desc')->skip($start)->take($pagesize)->get()); + foreach ($posts as $row) { + $aid[] = $row["aid"]; + } + $aid = isset($aid) ? implode(',', $aid) : ""; + + if ($aid != "") { + if ($post['template'] == 'tag2') { + $data['posts'] = arclist(array("sql" => "id in ($aid)", "orderby" => ['id', 'desc'], "row" => "$pagesize", "field" => "title,body")); //获取列表 + } else { + $data['posts'] = arclist(array("sql" => "id in ($aid)", "orderby" => ['id', 'desc'], "row" => "$pagesize")); //获取列表 + } + } else { + $data['posts'] = ''; //获取列表 + } + + $data['pagenav'] = get_listnav(array("counts" => $counts, "pagesize" => $pagesize, "pagenow" => $page + 1, "catid" => $tag, "urltype" => "tag")); //获取分页列表 + + if ($post['template'] == 'tag2' || $post['template'] == 'tag3') { + if (!empty($pagenow)) { + return redirect()->route('page404'); + } + } + + return view('home.index.' . $post['template'], $data); + } + + //标签页 + public function tags() + { + return view('home.index.tags'); + } + + //搜索页 + public function search($keyword) + { + if (empty($keyword)) { + echo '请输入正确的关键词'; + exit; + } + + if (strstr($keyword, "&")) exit; + + $data['posts'] = object_to_array(DB::table("article")->where("title", "like", "%$keyword%")->orderBy('id', 'desc')->take(30)->get()); + $data['keyword'] = $keyword; + + return view('home.index.search', $data); + } + + //单页面 + public function page($id) + { + $data = []; + + if (!empty($id) && preg_match('/[a-z0-9]+/', $id)) { + $map['filename'] = $id; + if (cache("pageid$id")) { + $post = cache("pageid$id"); + } else { + $post = object_to_array(DB::table('page')->where($map)->first(), 1); + cache("pageid$id", $post, 2592000); + cache(["pageid$id" => $post], \Carbon\Carbon::now()->addMinutes(2592000)); + } + + if ($post) { + $data['post'] = $post; + } else { + return redirect()->route('page404'); + } + + } else { + return redirect()->route('page404'); + } + + $data['posts'] = object_to_array(DB::table('page')->orderBy(\DB::raw('rand()'))->take(5)->get()); + + return view('home.index.' . $post['template'], $data); + } + + //sitemap页面 + public function sitemap() + { + return view('home.index.sitemap'); + } + + //404页面 + public function page404() + { + return view('home.404'); + } + + //验证消息的确来自微信服务器 + public function checksignature() + { + $signature = $_GET["signature"]; + $timestamp = $_GET["timestamp"]; + $nonce = $_GET["nonce"]; + $echoStr = $_GET["echostr"]; + + $token = 'fanli'; + $tmpArr = array($token, $timestamp, $nonce); + sort($tmpArr, SORT_STRING); + $tmpStr = implode($tmpArr); + $tmpStr = sha1($tmpStr); + + if ($tmpStr == $signature) { + exit($echoStr); + } else { + return false; + } + } + + //测试页面 + public function test() + { + return view('home.index.test'); + //return base_path('resources/org'); + //$qrcode = new \SimpleSoftwareIO\QrCode\BaconQrCodeGenerator; + //return $qrcode->size(500)->generate('Make a qrcode without Laravel!'); + //return ''; + //set_exception_handler('myException'); + //return uniqid(); + //return \App\Common\Helper::formatPrice(1.2346); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/Home/TagController.php b/app/Http/Controllers/Home/TagController.php new file mode 100644 index 0000000..14483ff --- /dev/null +++ b/app/Http/Controllers/Home/TagController.php @@ -0,0 +1,526 @@ + 1, + 'status' => 0, + 'limit' => 6, + 'offset' => 0 + ); + $url = env('APP_API_URL') . "/goods_list"; + $res = curl_request($url, $postdata, 'GET'); + $data['tjlist'] = $res['data']['list']; + + //商品列表 + $pagesize = 15; + $offset = 0; + if (isset($_REQUEST['page'])) { + $offset = ($_REQUEST['page'] - 1) * $pagesize; + } + + $postdata = array( + 'status' => 0, + 'limit' => $pagesize, + 'offset' => $offset + ); + $url = env('APP_API_URL') . "/goods_list"; + $res = curl_request($url, $postdata, 'GET'); + $data['list'] = $res['data']['list']; + + $data['totalpage'] = ceil($res['data']['count'] / $pagesize); + + if (isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax'] == 1) { + $html = ''; + + if ($res['data']['list']) { + foreach ($res['data']['list'] as $k => $v) { + $html .= '
  • ' . $v['title'] . ''; + $html .= '

    ' . $v['title'] . '

    '; + $html .= '

    库存(' . $v['goods_number'] . ') ' . $v['description'] . '

    '; + $html .= '
    ¥' . ceil($v['price']) . '
    '; + $html .= '
    ¥' . $v['market_price'] . ' 包邮
    ' . $v['sale'] . ' 件已付款
  • '; + + /* if($v['is_promote_goods']>0) + { + $html .= 'Hot'; + } + + $html .= $v['title'].'

    '.$v['price'].''.$v['sale'].'人付款
    '; + $html .= ''; */ + } + } + + exit(json_encode($html)); + } + + //商品分类列表 + $postdata = array( + 'pid' => 0, + 'limit' => 15, + 'offset' => 0 + ); + $url = env('APP_API_URL') . "/goodstype_list"; + $res = curl_request($url, $postdata, 'GET'); + $data['goodstype_list'] = $res['data']['list']; + + //banner轮播图 + $postdata = array( + 'type' => 0, + 'limit' => 5, + 'offset' => 0 + ); + $url = env('APP_API_URL') . "/slide_list"; + $res = curl_request($url, $postdata, 'GET'); + $data['slide_list'] = $res['data']['list']; + + return view('home.index.index', $data); + } + + //商品列表页 + public function goodslist(Request $request) + { + if ($request->input('typeid', null) != null) { + $postdata['typeid'] = $request->input('typeid'); + } + if ($request->input('orderby', null) != null) { + $postdata['orderby'] = $request->input('orderby'); + } + if ($request->input('tuijian', null) != null) { + $postdata['tuijian'] = $request->input('tuijian'); + } + + $pagesize = 15; + $offset = 0; + if (isset($_REQUEST['page'])) { + $offset = ($_REQUEST['page'] - 1) * $pagesize; + } + + //商品列表 + $postdata['limit'] = $pagesize; + $postdata['offset'] = $offset; + $url = env('APP_API_URL') . "/goods_list"; + $res = curl_request($url, $postdata, 'GET'); + $data['list'] = $res['data']['list']; + + $data['totalpage'] = ceil($res['data']['count'] / $pagesize); + + if (isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax'] == 1) { + $html = ''; + + if ($res['data']['list']) { + foreach ($res['data']['list'] as $k => $v) { + $html .= '
  • ' . $v['title'] . ''; + $html .= '

    ' . $v['title'] . '

    '; + $html .= '

    库存(' . $v['goods_number'] . ') ' . $v['description'] . '

    '; + $html .= '
    ¥' . ceil($v['price']) . '
    '; + $html .= '
    ¥' . $v['market_price'] . ' 包邮
    ' . $v['sale'] . ' 件已付款
  • '; + + /* if($v['is_promote_goods']>0) + { + $html .= 'Hot'; + } + + $html .= $v['title'].'

    '.$v['price'].''.$v['sale'].'人付款
    '; + $html .= ''; */ + } + } + + exit(json_encode($html)); + } + + //商品分类列表 + $postdata = array( + 'pid' => 0, + 'limit' => 15, + 'offset' => 0 + ); + $url = env('APP_API_URL') . "/goodstype_list"; + $res = curl_request($url, $postdata, 'GET'); + $data['goodstype_list'] = $res['data']['list']; + + return view('home.index.goodslist', $data); + } + + //商品详情页 + public function goods($id) + { + if (empty($id) || !preg_match('/[0-9]+/', $id)) { + return redirect()->route('page404'); + } + + $where['id'] = $id; + $where['status'] = 0; + $data['post'] = logic('Goods')->getOne($where); + if (!$data['post']) { + return redirect()->route('page404'); + } + + $data['tj_list'] = DB::table('goods')->where(['tuijian' => 1, 'status' => 0])->orderBy('id', 'desc')->get(); + + return view('home.index.goods', $data); + } + + //商品列表页 + public function brandList(Request $request) + { + $data['brand_list'] = object_to_array(DB::table('goods_brand')->where(['status' => 0])->take(30)->orderBy('listorder', 'asc')->get()); + + return view('home.index.brandList', $data); + } + + //网址组装 + public function listpageurl($http_host, $query_string, $page = 0) + { + $res = ''; + foreach (explode("&", $query_string) as $row) { + if ($row) { + $canshu = explode("=", $row); + $res[$canshu[0]] = $canshu[1]; + } + } + + if (isset($res['page'])) { + unset($res['page']); + } + + if ($page == 1 || $page == 0) { + } else { + $res['page'] = $page; + } + + if ($res) { + $res = $http_host . '?' . http_build_query($res); + } + + return $res; + } + + //列表页 + public function category(Request $request) + { + $pagesize = 10; + $offset = 0; + + //文章分类 + $postdata = array( + 'id' => $cat + ); + $url = env('APP_API_URL') . "/arctype_detail"; + $arctype_detail = curl_request($url, $postdata, 'GET'); + $data['post'] = $arctype_detail['data']; + dd($data['post']); + if (isset($_REQUEST['page'])) { + $offset = ($_REQUEST['page'] - 1) * $pagesize; + } + + //文章列表 + $postdata2['limit'] = $limit; + $postdata2['offset'] = $offset; + if ($request->input('typeid', null) != null) { + $postdata2['typeid'] = $request->input('typeid'); + } + + $url = env('APP_API_URL') . "/article_list"; + $res = curl_request($url, $postdata2, 'GET'); + $data['list'] = $res['data']['list']; + + $data['totalpage'] = ceil($res['data']['count'] / $pagesize); + + if (isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax'] == 1) { + $html = ''; + + if ($res['data']['list']) { + foreach ($res['data']['list'] as $k => $v) { + $html .= '
  • ' . $v['title'] . '

    ' . $v['pubdate'] . '

  • '; + } + } + + exit(json_encode($html)); + } + + return view('home.index.' . $data['post']['templist'], $data); + } + + //文章列表页 + public function arclist(Request $request) + { + $pagesize = 10; + $offset = 0; + + //文章分类 + if ($request->input('typeid', null) != null) { + $postdata = array( + 'id' => $request->input('typeid') + ); + $url = env('APP_API_URL') . "/arctype_detail"; + $arctype_detail = curl_request($url, $postdata, 'GET'); + $data['post'] = $arctype_detail['data']; + } + + if (isset($_REQUEST['page'])) { + $offset = ($_REQUEST['page'] - 1) * $pagesize; + } + + //文章列表 + $postdata2 = array( + 'limit' => $pagesize, + 'offset' => $offset + ); + if ($request->input('typeid', null) != null) { + $postdata2['typeid'] = $request->input('typeid'); + } + + $url = env('APP_API_URL') . "/article_list"; + $res = curl_request($url, $postdata2, 'GET'); + $data['list'] = $res['data']['list']; + + $data['totalpage'] = ceil($res['data']['count'] / $pagesize); + + if (isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax'] == 1) { + $html = ''; + + if ($res['data']['list']) { + foreach ($res['data']['list'] as $k => $v) { + $html .= '
    '; + if (!empty($v['litpic'])) { + $html .= ' $v['id'], "catid" => $v['typeid'], "type" => 'content')) . '">' . $v['title'] . ''; + } + $html .= ' $v['id'], "catid" => $v['typeid'], "type" => 'content')) . '">' . $v['title'] . '

    ' . mb_strcut($v['description'], 0, 150, 'UTF-8') . '..

    '; + $html .= '
    '; + $taglist = taglist($v['id']); + if ($taglist) { + foreach ($taglist as $row) { + $html .= ' $row['id'], "type" => 'tags')) . '">' . $row['tag'] . ''; + } + } + $html .= '' . date("m-d H:i", $v['pubdate']) . '' . $v['click'] . '人阅读
    '; + } + } + + exit(json_encode($html)); + } + + return view('home.index.arclist', $data); + } + + //文章详情页 + public function detail($id) + { + if (empty($id) || !preg_match('/[0-9]+/', $id)) { + return redirect()->route('page404'); + } + + if (cache("detailid$id")) { + $post = cache("detailid$id"); + } else { + $post = object_to_array(DB::table('article')->where('id', $id)->first(), 1); + if (empty($post)) { + return redirect()->route('page404'); + } + $post['name'] = DB::table('arctype')->where('id', $post['typeid'])->value('name'); + cache(["detailid$id" => $post], \Carbon\Carbon::now()->addMinutes(2592000)); + } + if ($post) { + $cat = $post['typeid']; + $post['body'] = ReplaceKeyword($post['body']); + if (!empty($post['writer'])) { + $post['writertitle'] = $post['title'] . ' ' . $post['writer']; + } + + $data['post'] = $post; + $data['pre'] = get_article_prenext(array('aid' => $post["id"], 'typeid' => $post["typeid"], 'type' => "pre")); + } else { + return redirect()->route('page404'); + } + + if (cache("catid$cat")) { + $post = cache("catid$cat"); + } else { + $post = object_to_array(DB::table('arctype')->where('id', $cat)->first(), 1); + cache(["catid$cat" => $post], \Carbon\Carbon::now()->addMinutes(2592000)); + } + + return view('home.index.' . $post['temparticle'], $data); + } + + //标签详情页,共有3种显示方式,1正常列表,2列表显示文章,3显示描述 + public function tag($tag, $page = 0) + { + $pagenow = $page; + + if (empty($tag) || !preg_match('/[0-9]+/', $tag)) { + return redirect()->route('page404'); + } + + $post = object_to_array(DB::table('tagindex')->where('id', $tag)->first(), 1); + $data['post'] = $post; + + $counts = DB::table("taglist")->where('tid', $tag)->count('aid'); + if ($counts > sysconfig('CMS_MAXARC')) { + $counts = sysconfig('CMS_MAXARC'); + } + $pagesize = sysconfig('CMS_PAGESIZE'); + $page = 0; + if ($counts % $pagesize) {//取总数据量除以每页数的余数 + $pages = intval($counts / $pagesize) + 1; //如果有余数,则页数等于总数据量除以每页数的结果取整再加一,如果没有余数,则页数等于总数据量除以每页数的结果 + } else { + $pages = $counts / $pagesize; + } + if (!empty($pagenow)) { + if ($pagenow == 1 || $pagenow > $pages) { + return redirect()->route('page404'); + } + $page = $pagenow - 1; + $nextpage = $pagenow + 1; + $previouspage = $pagenow - 1; + } else { + $page = 0; + $nextpage = 2; + $previouspage = 0; + } + $data['page'] = $page; + $data['pages'] = $pages; + $data['counts'] = $counts; + $start = $page * $pagesize; + + $posts = object_to_array(DB::table("taglist")->where('tid', $tag)->orderBy('aid', 'desc')->skip($start)->take($pagesize)->get()); + foreach ($posts as $row) { + $aid[] = $row["aid"]; + } + $aid = isset($aid) ? implode(',', $aid) : ""; + + if ($aid != "") { + if ($post['template'] == 'tag2') { + $data['posts'] = arclist(array("sql" => "id in ($aid)", "orderby" => ['id', 'desc'], "row" => "$pagesize", "field" => "title,body")); //获取列表 + } else { + $data['posts'] = arclist(array("sql" => "id in ($aid)", "orderby" => ['id', 'desc'], "row" => "$pagesize")); //获取列表 + } + } else { + $data['posts'] = ''; //获取列表 + } + + $data['pagenav'] = get_listnav(array("counts" => $counts, "pagesize" => $pagesize, "pagenow" => $page + 1, "catid" => $tag, "urltype" => "tag")); //获取分页列表 + + if ($post['template'] == 'tag2' || $post['template'] == 'tag3') { + if (!empty($pagenow)) { + return redirect()->route('page404'); + } + } + + return view('home.index.' . $post['template'], $data); + } + + //标签页 + public function tags() + { + return view('home.index.tags'); + } + + //搜索页 + public function search($keyword) + { + if (empty($keyword)) { + echo '请输入正确的关键词'; + exit; + } + + if (strstr($keyword, "&")) exit; + + $data['posts'] = object_to_array(DB::table("article")->where("title", "like", "%$keyword%")->orderBy('id', 'desc')->take(30)->get()); + $data['keyword'] = $keyword; + + return view('home.index.search', $data); + } + + //单页面 + public function page($id) + { + $data = []; + + if (!empty($id) && preg_match('/[a-z0-9]+/', $id)) { + $map['filename'] = $id; + if (cache("pageid$id")) { + $post = cache("pageid$id"); + } else { + $post = object_to_array(DB::table('page')->where($map)->first(), 1); + cache("pageid$id", $post, 2592000); + cache(["pageid$id" => $post], \Carbon\Carbon::now()->addMinutes(2592000)); + } + + if ($post) { + $data['post'] = $post; + } else { + return redirect()->route('page404'); + } + + } else { + return redirect()->route('page404'); + } + + $data['posts'] = object_to_array(DB::table('page')->orderBy(\DB::raw('rand()'))->take(5)->get()); + + return view('home.index.' . $post['template'], $data); + } + + //sitemap页面 + public function sitemap() + { + return view('home.index.sitemap'); + } + + //404页面 + public function page404() + { + return view('home.404'); + } + + //验证消息的确来自微信服务器 + public function checksignature() + { + $signature = $_GET["signature"]; + $timestamp = $_GET["timestamp"]; + $nonce = $_GET["nonce"]; + $echoStr = $_GET["echostr"]; + + $token = 'fanli'; + $tmpArr = array($token, $timestamp, $nonce); + sort($tmpArr, SORT_STRING); + $tmpStr = implode($tmpArr); + $tmpStr = sha1($tmpStr); + + if ($tmpStr == $signature) { + exit($echoStr); + } else { + return false; + } + } + + //测试页面 + public function test() + { + return view('home.index.test'); + //return base_path('resources/org'); + //$qrcode = new \SimpleSoftwareIO\QrCode\BaconQrCodeGenerator; + //return $qrcode->size(500)->generate('Make a qrcode without Laravel!'); + //return ''; + //set_exception_handler('myException'); + //return uniqid(); + //return \App\Common\Helper::formatPrice(1.2346); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/Home/TestController.php b/app/Http/Controllers/Home/TestController.php index c95a634..cbc2e60 100644 --- a/app/Http/Controllers/Home/TestController.php +++ b/app/Http/Controllers/Home/TestController.php @@ -1,291 +1,62 @@ sheet('score', function($sheet) use ($cellData){ - $sheet->rows($cellData); - }); - - //第二个工作簿 - $excel->sheet('score', function($sheet) use ($cellData){ - $sheet->rows($cellData); - }); - })->export('xls'); - - //Excel文件导入功能 - $filePath = 'storage/'.iconv('UTF-8', 'GBK', '学生成绩').'.xls'; - \Excel::load($filePath, function($reader) { - $reader = $reader->getSheet(0); + { + //Excel文件导出功能,如果出现文件名中文乱码,iconv('UTF-8', 'GBK', '学生成绩') + /* $cellData = [ + ['学号','姓名','成绩'], + ['10001','AAAAA','99'], + ['10002','BBBBB','92'], + ['10003','CCCCC','95'], + ['10004','DDDDD','89'], + ['10005','EEEEE','96'], + ]; + \Excel::create('学生成绩',function($excel) use ($cellData){ + //第一个工作簿,score是工作簿的名称 + $excel->sheet('score', function($sheet) use ($cellData){ + $sheet->rows($cellData); + }); + + //第二个工作簿 + $excel->sheet('score', function($sheet) use ($cellData){ + $sheet->rows($cellData); + }); + })->export('xls'); + + //Excel文件导入功能 + $filePath = 'storage/'.iconv('UTF-8', 'GBK', '学生成绩').'.xls'; + \Excel::load($filePath, function($reader) { + $reader = $reader->getSheet(0); $res = $reader->toArray(); - dd($res); - }); */ - } - - //列表页 - public function category($cat, $page=0) - { - $pagenow = $page; - - if(empty($cat) || !preg_match('/[0-9]+/',$cat)){return redirect()->route('page404');} - - if(cache("catid$cat")){$post = cache("catid$cat");}else{$post = object_to_array(DB::table('arctype')->where('id', $cat)->first(), 1);if(empty($post)){return redirect()->route('page404');} cache(["catid$cat"=>$post], \Carbon\Carbon::now()->addMinutes(2592000));} - $data['post'] = $post; - - $subcat="";$sql=""; - $post2 = object_to_array(DB::table('arctype')->select('id')->where('pid', $cat)->get()); - if(!empty($post2)){foreach($post2 as $row){$subcat=$subcat."typeid=".$row["id"]." or ";}} - $subcat=$subcat."typeid=".$cat; - $sql=$subcat." or typeid2 in (".$cat.")";//echo $subcat2;exit; - $data['sql'] = $sql; - - $counts = DB::table("article")->whereRaw($sql)->count(); - if($counts>sysconfig('CMS_MAXARC')){$counts=sysconfig('CMS_MAXARC');dd($counts);} - $pagesize = sysconfig('CMS_PAGESIZE');$page=0; - if($counts % $pagesize){//取总数据量除以每页数的余数 - $pages = intval($counts/$pagesize) + 1; //如果有余数,则页数等于总数据量除以每页数的结果取整再加一,如果没有余数,则页数等于总数据量除以每页数的结果 - }else{$pages = $counts/$pagesize;} - if(!empty($pagenow)){if($pagenow==1 || $pagenow>$pages){return redirect()->route('page404');}$page = $pagenow-1;$nextpage=$pagenow+1;$previouspage=$pagenow-1;}else{$page = 0;$nextpage=2;$previouspage=0;} - $data['page'] = $page; - $data['pages'] = $pages; - $data['counts'] = $counts; - $start = $page*$pagesize; - - $data['posts'] = arclist(array("sql"=>$sql, "limit"=>"$start,$pagesize")); //获取列表 - $data['pagenav'] = get_listnav(array("counts"=>$counts,"pagesize"=>$pagesize,"pagenow"=>$page+1,"catid"=>$cat)); //获取分页列表 - - if($post['templist']=='category2'){if(!empty($pagenow)){return redirect()->route('page404');}} - - return view('home.index.'.$post['templist'], $data); - } - - //文章详情页 - public function detail($id) - { - if(empty($id) || !preg_match('/[0-9]+/',$id)){return redirect()->route('page404');} - - if(cache("detailid$id")){$post = cache("detailid$id");}else{$post = object_to_array(DB::table('article')->where('id', $id)->first(), 1);if(empty($post)){return redirect()->route('page404');}$post['name'] = DB::table('arctype')->where('id', $post['typeid'])->value('name');cache(["detailid$id"=>$post], \Carbon\Carbon::now()->addMinutes(2592000));} - if($post) - { - $cat = $post['typeid']; - $post['body'] = ReplaceKeyword($post['body']); - if(!empty($post['writer'])){$post['writertitle']=$post['title'].' '.$post['writer'];} - - $data['post'] = $post; - $data['pre'] = get_article_prenext(array('aid'=>$post["id"],'typeid'=>$post["typeid"],'type'=>"pre")); - } - else - { - return redirect()->route('page404'); - } - - if(cache("catid$cat")){$post=cache("catid$cat");}else{$post = object_to_array(DB::table('arctype')->where('id', $cat)->first(), 1);cache(["catid$cat"=>$post], \Carbon\Carbon::now()->addMinutes(2592000));} - - return view('home.index.'.$post['temparticle'], $data); - } - - //标签详情页,共有3种显示方式,1正常列表,2列表显示文章,3显示描述 - public function tag($tag, $page=0) - { - $pagenow = $page; - - if(empty($tag) || !preg_match('/[0-9]+/',$tag)){return redirect()->route('page404');} - - $post = object_to_array(DB::table('tagindex')->where('id',$tag)->first(), 1); - $data['post'] = $post; - - $counts=DB::table("taglist")->where('tid',$tag)->count('aid'); - if($counts>sysconfig('CMS_MAXARC')){$counts=sysconfig('CMS_MAXARC');} - $pagesize=sysconfig('CMS_PAGESIZE');$page=0; - if($counts % $pagesize){//取总数据量除以每页数的余数 - $pages = intval($counts/$pagesize) + 1; //如果有余数,则页数等于总数据量除以每页数的结果取整再加一,如果没有余数,则页数等于总数据量除以每页数的结果 - }else{$pages = $counts/$pagesize;} - if(!empty($pagenow)){if($pagenow==1 || $pagenow>$pages){return redirect()->route('page404');}$page = $pagenow-1;$nextpage=$pagenow+1;$previouspage=$pagenow-1;}else{$page = 0;$nextpage=2;$previouspage=0;} - $data['page'] = $page; - $data['pages'] = $pages; - $data['counts'] = $counts; - $start=$page*$pagesize; - - $posts=object_to_array(DB::table("taglist")->where('tid',$tag)->orderBy('aid', 'desc')->skip($start)->take($pagesize)->get()); - foreach($posts as $row) - { - $aid[] = $row["aid"]; - } - $aid = isset($aid)?implode(',',$aid):""; - - if($aid!="") - { - if($post['template']=='tag2') - { - $data['posts'] = arclist(array("sql"=>"id in ($aid)","orderby"=>['id', 'desc'],"row"=>"$pagesize","field"=>"title,body")); //获取列表 - } - else - { - $data['posts'] = arclist(array("sql"=>"id in ($aid)","orderby"=>['id', 'desc'],"row"=>"$pagesize")); //获取列表 - } - } - else - { - $data['posts'] = ''; //获取列表 - } - - $data['pagenav'] = get_listnav(array("counts"=>$counts,"pagesize"=>$pagesize,"pagenow"=>$page+1,"catid"=>$tag,"urltype"=>"tag")); //获取分页列表 - - if($post['template']=='tag2' || $post['template']=='tag3'){if(!empty($pagenow)){return redirect()->route('page404');}} - - return view('home.index.'.$post['template'], $data); + dd($res); + }); */ } - - //标签页 - public function tags() - { - return view('home.index.tags'); - } - - //搜索页 - public function search($keyword) - { - if(empty($keyword)) - { - echo '请输入正确的关键词';exit; - } - - if(strstr($keyword,"&")) exit; - - $data['posts']= object_to_array(DB::table("article")->where("title", "like", "%$keyword%")->orderBy('id', 'desc')->take(30)->get()); - $data['keyword']= $keyword; - - return view('home.index.search', $data); - } - - //单页面 - public function page($id) - { - $data = []; - - if(!empty($id) && preg_match('/[a-z0-9]+/',$id)) - { - $map['filename']=$id; - if(cache("pageid$id")){$post=cache("pageid$id");}else{$post = object_to_array(DB::table('page')->where($map)->first(), 1);cache("pageid$id", $post, 2592000);cache(["pageid$id"=>$post], \Carbon\Carbon::now()->addMinutes(2592000));} - - if($post) - { - $data['post'] = $post; - } - else - { - return redirect()->route('page404'); - } - - } - else - { - return redirect()->route('page404'); - } - - $data['posts'] = object_to_array(DB::table('page')->orderBy(\DB::raw('rand()'))->take(5)->get()); - - return view('home.index.'.$post['template'], $data); - } - - //商品列表页 - public function productcat($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');} - $data['post'] = $post; - - $subcat=""; - $post2 = object_to_array(DB::table('product_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(); - if($counts>sysconfig('CMS_MAXARC')){$counts=sysconfig('CMS_MAXARC');dd($counts);} - $pagesize = sysconfig('CMS_PAGESIZE');$page=0; - if($counts % $pagesize){//取总数据量除以每页数的余数 - $pages = intval($counts/$pagesize) + 1; //如果有余数,则页数等于总数据量除以每页数的结果取整再加一,如果没有余数,则页数等于总数据量除以每页数的结果 - }else{$pages = $counts/$pagesize;} - if(!empty($pagenow)){if($pagenow==1 || $pagenow>$pages){return redirect()->route('page404');}$page = $pagenow-1;$nextpage=$pagenow+1;$previouspage=$pagenow-1;}else{$page = 0;$nextpage=2;$previouspage=0;} - $data['page'] = $page; - $data['pages'] = $pages; - $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")); //获取分页列表 - - if($post['templist']=='category2'){if(!empty($pagenow)){return redirect()->route('page404');}} - - return view('home.index.'.$post['templist'], $data); - } - - //商品详情页 - public function product($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'); - if($post) - { - $cat = $post['typeid']; - $post['body'] = ReplaceKeyword($post['body']); - if(!empty($post['writer'])){$post['writertitle']=$post['title'].' '.$post['writer'];} - - $data['post'] = $post; - $data['pre'] = get_article_prenext(array('aid'=>$post["id"],'typeid'=>$post["typeid"],'type'=>"pre")); - } - else - { - return redirect()->route('page404'); - } - - $post = object_to_array(DB::table('product_type')->where('id', $cat)->first(), 1); - - return view('home.index.'.$post['temparticle'], $data); - } - - //sitemap页面 - public function sitemap() + + // 队列测试 + public function queue() { - return view('home.index.sitemap'); + // php artisan queue:work + dispatch(new \App\Jobs\Example()); } - - //404页面 - public function page404() - { - return view('home.404'); - } - - //测试页面 - public function test() + + // 事件测试 + public function event() { - return date("Y-m-d H:i:s",strtotime("2017-04")); + $order = \App\Http\Model\Order::where(['id' => 1])->first(); + $order_id = 1; + event(new \App\Events\OrderShipped($order_id)); } + } \ No newline at end of file diff --git a/app/Http/Controllers/Wap/ArticleController.php b/app/Http/Controllers/Wap/ArticleController.php new file mode 100644 index 0000000..b8224c9 --- /dev/null +++ b/app/Http/Controllers/Wap/ArticleController.php @@ -0,0 +1,126 @@ +route('page404'); + } + + if (cache("catid$cat")) { + $post = cache("catid$cat"); + } else { + $post = object_to_array(DB::table('arctype')->where('id', $cat)->first(), 1); + if (empty($post)) { + return redirect()->route('page404'); + } + cache(["catid$cat" => $post], \Carbon\Carbon::now()->addMinutes(2592000)); + } + $data['post'] = $post; + + $subcat = ""; + $sql = ""; + $post2 = object_to_array(DB::table('arctype')->select('id')->where('pid', $cat)->get()); + if (!empty($post2)) { + foreach ($post2 as $row) { + $subcat = $subcat . "typeid=" . $row["id"] . " or "; + } + } + $subcat = $subcat . "typeid=" . $cat; + $sql = $subcat . " or typeid2 in (" . $cat . ")";//echo $subcat2;exit; + $data['sql'] = $sql; + + $counts = DB::table("article")->whereRaw($sql)->count(); + if ($counts > sysconfig('CMS_MAXARC')) { + $counts = sysconfig('CMS_MAXARC'); + dd($counts); + } + $pagesize = sysconfig('CMS_PAGESIZE'); + $page = 0; + if ($counts % $pagesize) {//取总数据量除以每页数的余数 + $pages = intval($counts / $pagesize) + 1; //如果有余数,则页数等于总数据量除以每页数的结果取整再加一,如果没有余数,则页数等于总数据量除以每页数的结果 + } else { + $pages = $counts / $pagesize; + } + if (!empty($pagenow)) { + if ($pagenow == 1 || $pagenow > $pages) { + return redirect()->route('page404'); + } + $page = $pagenow - 1; + $nextpage = $pagenow + 1; + $previouspage = $pagenow - 1; + } else { + $page = 0; + $nextpage = 2; + $previouspage = 0; + } + $data['page'] = $page; + $data['pages'] = $pages; + $data['counts'] = $counts; + $start = $page * $pagesize; + + $data['posts'] = arclist(array("sql" => $sql, "limit" => "$start,$pagesize")); //获取列表 + $data['pagenav'] = get_listnav(array("counts" => $counts, "pagesize" => $pagesize, "pagenow" => $page + 1, "catid" => $cat)); //获取分页列表 + + if ($post['templist'] == 'category2') { + if (!empty($pagenow)) { + return redirect()->route('page404'); + } + } + + return view('wap.article.index', $data); + } + + //文章详情页 + public function detail($id) + { + if (empty($id) || !preg_match('/[0-9]+/', $id)) { + return redirect()->route('page404'); + } + + if (cache("detailid$id")) { + $post = cache("detailid$id"); + } else { + $post = object_to_array(DB::table('article')->where('id', $id)->first(), 1); + if (empty($post)) { + return redirect()->route('page404'); + } + $post['name'] = DB::table('arctype')->where('id', $post['typeid'])->value('name'); + cache(["detailid$id" => $post], \Carbon\Carbon::now()->addMinutes(2592000)); + } + if ($post) { + $cat = $post['typeid']; + $post['body'] = ReplaceKeyword($post['body']); + if (!empty($post['writer'])) { + $post['writertitle'] = $post['title'] . ' ' . $post['writer']; + } + + $data['post'] = $post; + $data['pre'] = get_article_prenext(array('aid' => $post["id"], 'typeid' => $post["typeid"], 'type' => "pre")); + } else { + return redirect()->route('page404'); + } + + if (cache("catid$cat")) { + $post = cache("catid$cat"); + } else { + $post = object_to_array(DB::table('arctype')->where('id', $cat)->first(), 1); + cache(["catid$cat" => $post], \Carbon\Carbon::now()->addMinutes(2592000)); + } + + return view('wap.article.detail', $data); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/Wap/BaseController.php b/app/Http/Controllers/Wap/BaseController.php new file mode 100644 index 0000000..7cd2604 --- /dev/null +++ b/app/Http/Controllers/Wap/BaseController.php @@ -0,0 +1,11 @@ +operation_log_add(); + } + + // 添加操作记录 + public function operation_log_add($login_info = []) + { + $time = time(); + // 记录操作 + if ($login_info) { + $data['login_id'] = $login_info['id']; + $data['login_name'] = $login_info['user_name']; + } + $data['type'] = 4; + $data['ip'] = request()->ip(); + $data['url'] = mb_strcut(request()->url(), 0, 255, 'UTF-8'); + $data['http_method'] = request()->method(); + $data['domain_name'] = mb_strcut($_SERVER['SERVER_NAME'], 0, 60, 'UTF-8'); + if ($data['http_method'] != 'GET') { + $data['content'] = mb_strcut(json_encode(request()->toArray(), JSON_UNESCAPED_SLASHES), 0, 255, 'UTF-8'); + } + if (!empty($_SERVER['HTTP_REFERER'])) { + $data['http_referer'] = mb_strcut($_SERVER['HTTP_REFERER'], 0, 255, 'UTF-8'); + } + $data['add_time'] = $time; + logic('Log')->add($data); } } diff --git a/app/Http/Controllers/Wap/GoodsController.php b/app/Http/Controllers/Wap/GoodsController.php new file mode 100644 index 0000000..1467447 --- /dev/null +++ b/app/Http/Controllers/Wap/GoodsController.php @@ -0,0 +1,108 @@ +route('page404'); + } + + $post = object_to_array(DB::table('product_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()); + 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(); + if ($counts > sysconfig('CMS_MAXARC')) { + $counts = sysconfig('CMS_MAXARC'); + dd($counts); + } + $pagesize = sysconfig('CMS_PAGESIZE'); + $page = 0; + if ($counts % $pagesize) {//取总数据量除以每页数的余数 + $pages = intval($counts / $pagesize) + 1; //如果有余数,则页数等于总数据量除以每页数的结果取整再加一,如果没有余数,则页数等于总数据量除以每页数的结果 + } else { + $pages = $counts / $pagesize; + } + if (!empty($pagenow)) { + if ($pagenow == 1 || $pagenow > $pages) { + return redirect()->route('page404'); + } + $page = $pagenow - 1; + $nextpage = $pagenow + 1; + $previouspage = $pagenow - 1; + } else { + $page = 0; + $nextpage = 2; + $previouspage = 0; + } + $data['page'] = $page; + $data['pages'] = $pages; + $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")); //获取分页列表 + + if ($post['templist'] == 'category2') { + if (!empty($pagenow)) { + return redirect()->route('page404'); + } + } + + return view('wap.goods.index', $data); + } + + //商品详情页 + public function detail($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'); + if (!$post) { + return redirect()->route('page404'); + } + $cat = $post['typeid']; + $post['body'] = ReplaceKeyword($post['body']); + if (!empty($post['writer'])) { + $post['writertitle'] = $post['title'] . ' ' . $post['writer']; + } + + $data['post'] = $post; + $data['pre'] = get_article_prenext(array('aid' => $post["id"], 'typeid' => $post["typeid"], 'type' => "pre")); + + $post = object_to_array(DB::table('product_type')->where('id', $cat)->first(), 1); + + return view('wap.goods.detail', $data); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/Wap/IndexController.php b/app/Http/Controllers/Wap/IndexController.php index d6124bb..13fe9d7 100644 --- a/app/Http/Controllers/Wap/IndexController.php +++ b/app/Http/Controllers/Wap/IndexController.php @@ -1,264 +1,365 @@ route('page404');} - - if(cache("catid$cat")){$post = cache("catid$cat");}else{$post = object_to_array(DB::table('arctype')->where('id', $cat)->first(), 1);if(empty($post)){return redirect()->route('page404');} cache(["catid$cat"=>$post], \Carbon\Carbon::now()->addMinutes(2592000));} + + if (empty($cat) || !preg_match('/[0-9]+/', $cat)) { + return redirect()->route('page404'); + } + + if (cache("catid$cat")) { + $post = cache("catid$cat"); + } else { + $post = object_to_array(DB::table('arctype')->where('id', $cat)->first(), 1); + if (empty($post)) { + return redirect()->route('page404'); + } + cache(["catid$cat" => $post], \Carbon\Carbon::now()->addMinutes(2592000)); + } $data['post'] = $post; - - $subcat="";$sql=""; - $post2 = object_to_array(DB::table('arctype')->select('id')->where('pid', $cat)->get()); - if(!empty($post2)){foreach($post2 as $row){$subcat=$subcat."typeid=".$row["id"]." or ";}} - $subcat=$subcat."typeid=".$cat; - $sql=$subcat." or typeid2 in (".$cat.")";//echo $subcat2;exit; - $data['sql'] = $sql; - - $counts = DB::table("article")->whereRaw($sql)->count(); - if($counts>sysconfig('CMS_MAXARC')){$counts=sysconfig('CMS_MAXARC');dd($counts);} - $pagesize = sysconfig('CMS_PAGESIZE');$page=0; - if($counts % $pagesize){//取总数据量除以每页数的余数 - $pages = intval($counts/$pagesize) + 1; //如果有余数,则页数等于总数据量除以每页数的结果取整再加一,如果没有余数,则页数等于总数据量除以每页数的结果 - }else{$pages = $counts/$pagesize;} - if(!empty($pagenow)){if($pagenow==1 || $pagenow>$pages){return redirect()->route('page404');}$page = $pagenow-1;$nextpage=$pagenow+1;$previouspage=$pagenow-1;}else{$page = 0;$nextpage=2;$previouspage=0;} - $data['page'] = $page; - $data['pages'] = $pages; - $data['counts'] = $counts; - $start = $page*$pagesize; - - $data['posts'] = arclist(array("sql"=>$sql, "limit"=>"$start,$pagesize")); //获取列表 - $data['pagenav'] = get_listnav(array("counts"=>$counts,"pagesize"=>$pagesize,"pagenow"=>$page+1,"catid"=>$cat)); //获取分页列表 - - if($post['templist']=='category2'){if(!empty($pagenow)){return redirect()->route('page404');}} - - return view('wap.index.'.$post['templist'], $data); - } - + + $subcat = ""; + $sql = ""; + $post2 = object_to_array(DB::table('arctype')->select('id')->where('pid', $cat)->get()); + if (!empty($post2)) { + foreach ($post2 as $row) { + $subcat = $subcat . "typeid=" . $row["id"] . " or "; + } + } + $subcat = $subcat . "typeid=" . $cat; + $sql = $subcat . " or typeid2 in (" . $cat . ")";//echo $subcat2;exit; + $data['sql'] = $sql; + + $counts = DB::table("article")->whereRaw($sql)->count(); + if ($counts > sysconfig('CMS_MAXARC')) { + $counts = sysconfig('CMS_MAXARC'); + dd($counts); + } + $pagesize = sysconfig('CMS_PAGESIZE'); + $page = 0; + if ($counts % $pagesize) {//取总数据量除以每页数的余数 + $pages = intval($counts / $pagesize) + 1; //如果有余数,则页数等于总数据量除以每页数的结果取整再加一,如果没有余数,则页数等于总数据量除以每页数的结果 + } else { + $pages = $counts / $pagesize; + } + if (!empty($pagenow)) { + if ($pagenow == 1 || $pagenow > $pages) { + return redirect()->route('page404'); + } + $page = $pagenow - 1; + $nextpage = $pagenow + 1; + $previouspage = $pagenow - 1; + } else { + $page = 0; + $nextpage = 2; + $previouspage = 0; + } + $data['page'] = $page; + $data['pages'] = $pages; + $data['counts'] = $counts; + $start = $page * $pagesize; + + $data['posts'] = arclist(array("sql" => $sql, "limit" => "$start,$pagesize")); //获取列表 + $data['pagenav'] = get_listnav(array("counts" => $counts, "pagesize" => $pagesize, "pagenow" => $page + 1, "catid" => $cat)); //获取分页列表 + + if ($post['templist'] == 'category2') { + if (!empty($pagenow)) { + return redirect()->route('page404'); + } + } + + return view('wap.index.' . $post['templist'], $data); + } + //文章详情页 public function detail($id) - { - if(empty($id) || !preg_match('/[0-9]+/',$id)){return redirect()->route('page404');} - - if(cache("detailid$id")){$post = cache("detailid$id");}else{$post = object_to_array(DB::table('article')->where('id', $id)->first(), 1);if(empty($post)){return redirect()->route('page404');}$post['name'] = DB::table('arctype')->where('id', $post['typeid'])->value('name');cache(["detailid$id"=>$post], \Carbon\Carbon::now()->addMinutes(2592000));} - if($post) - { - $cat = $post['typeid']; - $post['body'] = ReplaceKeyword($post['body']); - if(!empty($post['writer'])){$post['writertitle']=$post['title'].' '.$post['writer'];} - - $data['post'] = $post; - $data['pre'] = get_article_prenext(array('aid'=>$post["id"],'typeid'=>$post["typeid"],'type'=>"pre")); + { + if (empty($id) || !preg_match('/[0-9]+/', $id)) { + return redirect()->route('page404'); + } + + if (cache("detailid$id")) { + $post = cache("detailid$id"); + } else { + $post = object_to_array(DB::table('article')->where('id', $id)->first(), 1); + if (empty($post)) { + return redirect()->route('page404'); + } + $post['name'] = DB::table('arctype')->where('id', $post['typeid'])->value('name'); + cache(["detailid$id" => $post], \Carbon\Carbon::now()->addMinutes(2592000)); } - else - { + if ($post) { + $cat = $post['typeid']; + $post['body'] = ReplaceKeyword($post['body']); + if (!empty($post['writer'])) { + $post['writertitle'] = $post['title'] . ' ' . $post['writer']; + } + + $data['post'] = $post; + $data['pre'] = get_article_prenext(array('aid' => $post["id"], 'typeid' => $post["typeid"], 'type' => "pre")); + } else { return redirect()->route('page404'); } - - if(cache("catid$cat")){$post=cache("catid$cat");}else{$post = object_to_array(DB::table('arctype')->where('id', $cat)->first(), 1);cache(["catid$cat"=>$post], \Carbon\Carbon::now()->addMinutes(2592000));} - - return view('wap.index.'.$post['temparticle'], $data); + + if (cache("catid$cat")) { + $post = cache("catid$cat"); + } else { + $post = object_to_array(DB::table('arctype')->where('id', $cat)->first(), 1); + cache(["catid$cat" => $post], \Carbon\Carbon::now()->addMinutes(2592000)); + } + + return view('wap.index.' . $post['temparticle'], $data); } - + //标签详情页,共有3种显示方式,1正常列表,2列表显示文章,3显示描述 - public function tag($tag, $page=0) - { + public function tag($tag, $page = 0) + { $pagenow = $page; - - if(empty($tag) || !preg_match('/[0-9]+/',$tag)){return redirect()->route('page404');} - - $post = object_to_array(DB::table('tagindex')->where('id',$tag)->first(), 1); + + if (empty($tag) || !preg_match('/[0-9]+/', $tag)) { + return redirect()->route('page404'); + } + + $post = object_to_array(DB::table('tagindex')->where('id', $tag)->first(), 1); $data['post'] = $post; - - $counts=DB::table("taglist")->where('tid',$tag)->count('aid'); - if($counts>sysconfig('CMS_MAXARC')){$counts=sysconfig('CMS_MAXARC');} - $pagesize=sysconfig('CMS_PAGESIZE');$page=0; - if($counts % $pagesize){//取总数据量除以每页数的余数 - $pages = intval($counts/$pagesize) + 1; //如果有余数,则页数等于总数据量除以每页数的结果取整再加一,如果没有余数,则页数等于总数据量除以每页数的结果 - }else{$pages = $counts/$pagesize;} - if(!empty($pagenow)){if($pagenow==1 || $pagenow>$pages){return redirect()->route('page404');}$page = $pagenow-1;$nextpage=$pagenow+1;$previouspage=$pagenow-1;}else{$page = 0;$nextpage=2;$previouspage=0;} - $data['page'] = $page; - $data['pages'] = $pages; - $data['counts'] = $counts; - $start=$page*$pagesize; - - $posts=object_to_array(DB::table("taglist")->where('tid',$tag)->orderBy('aid', 'desc')->skip($start)->take($pagesize)->get()); - foreach($posts as $row) - { - $aid[] = $row["aid"]; - } - $aid = isset($aid)?implode(',',$aid):""; - - if($aid!="") - { - if($post['template']=='tag2') - { - $data['posts'] = arclist(array("sql"=>"id in ($aid)","orderby"=>['id', 'desc'],"row"=>"$pagesize","field"=>"title,body")); //获取列表 - } - else - { - $data['posts'] = arclist(array("sql"=>"id in ($aid)","orderby"=>['id', 'desc'],"row"=>"$pagesize")); //获取列表 + + $counts = DB::table("taglist")->where('tid', $tag)->count('aid'); + if ($counts > sysconfig('CMS_MAXARC')) { + $counts = sysconfig('CMS_MAXARC'); + } + $pagesize = sysconfig('CMS_PAGESIZE'); + $page = 0; + if ($counts % $pagesize) {//取总数据量除以每页数的余数 + $pages = intval($counts / $pagesize) + 1; //如果有余数,则页数等于总数据量除以每页数的结果取整再加一,如果没有余数,则页数等于总数据量除以每页数的结果 + } else { + $pages = $counts / $pagesize; + } + if (!empty($pagenow)) { + if ($pagenow == 1 || $pagenow > $pages) { + return redirect()->route('page404'); } + $page = $pagenow - 1; + $nextpage = $pagenow + 1; + $previouspage = $pagenow - 1; + } else { + $page = 0; + $nextpage = 2; + $previouspage = 0; } - else - { + $data['page'] = $page; + $data['pages'] = $pages; + $data['counts'] = $counts; + $start = $page * $pagesize; + + $posts = object_to_array(DB::table("taglist")->where('tid', $tag)->orderBy('aid', 'desc')->skip($start)->take($pagesize)->get()); + foreach ($posts as $row) { + $aid[] = $row["aid"]; + } + $aid = isset($aid) ? implode(',', $aid) : ""; + + if ($aid != "") { + if ($post['template'] == 'tag2') { + $data['posts'] = arclist(array("sql" => "id in ($aid)", "orderby" => ['id', 'desc'], "row" => "$pagesize", "field" => "title,body")); //获取列表 + } else { + $data['posts'] = arclist(array("sql" => "id in ($aid)", "orderby" => ['id', 'desc'], "row" => "$pagesize")); //获取列表 + } + } else { $data['posts'] = ''; //获取列表 } - - $data['pagenav'] = get_listnav(array("counts"=>$counts,"pagesize"=>$pagesize,"pagenow"=>$page+1,"catid"=>$tag,"urltype"=>"tag")); //获取分页列表 - - if($post['template']=='tag2' || $post['template']=='tag3'){if(!empty($pagenow)){return redirect()->route('page404');}} - - return view('wap.index.'.$post['template'], $data); + + $data['pagenav'] = get_listnav(array("counts" => $counts, "pagesize" => $pagesize, "pagenow" => $page + 1, "catid" => $tag, "urltype" => "tag")); //获取分页列表 + + if ($post['template'] == 'tag2' || $post['template'] == 'tag3') { + if (!empty($pagenow)) { + return redirect()->route('page404'); + } + } + + return view('wap.index.' . $post['template'], $data); } - - //标签页 + + //标签页 public function tags() - { - return view('wap.index.tags'); + { + return view('wap.index.tags'); } - + //搜索页 - public function search($keyword) - { - if(empty($keyword)) - { - echo '请输入正确的关键词';exit; - } - - if(strstr($keyword,"&")) exit; - - $data['posts']= object_to_array(DB::table("article")->where("title", "like", "%$keyword%")->orderBy('id', 'desc')->take(30)->get()); - $data['keyword']= $keyword; - - return view('wap.index.search', $data); + public function search($keyword) + { + if (empty($keyword)) { + echo '请输入正确的关键词'; + exit; + } + + if (strstr($keyword, "&")) exit; + + $data['posts'] = object_to_array(DB::table("article")->where("title", "like", "%$keyword%")->orderBy('id', 'desc')->take(30)->get()); + $data['keyword'] = $keyword; + + return view('wap.index.search', $data); } - + //单页面 public function page($id) - { - $data = []; - - if(!empty($id) && preg_match('/[a-z0-9]+/',$id)) - { - $map['filename']=$id; - if(cache("pageid$id")){$post=cache("pageid$id");}else{$post = object_to_array(DB::table('page')->where($map)->first(), 1);cache("pageid$id", $post, 2592000);cache(["pageid$id"=>$post], \Carbon\Carbon::now()->addMinutes(2592000));} - - if($post) - { - $data['post'] = $post; + { + $data = []; + + if (!empty($id) && preg_match('/[a-z0-9]+/', $id)) { + $map['filename'] = $id; + if (cache("pageid$id")) { + $post = cache("pageid$id"); + } else { + $post = object_to_array(DB::table('page')->where($map)->first(), 1); + cache("pageid$id", $post, 2592000); + cache(["pageid$id" => $post], \Carbon\Carbon::now()->addMinutes(2592000)); } - else - { + + if ($post) { + $data['post'] = $post; + } else { return redirect()->route('page404'); } - - } - else - { + + } else { return redirect()->route('page404'); } - - $data['posts'] = object_to_array(DB::table('page')->orderBy(\DB::raw('rand()'))->take(5)->get()); - - return view('wap.index.'.$post['template'], $data); + + $data['posts'] = object_to_array(DB::table('page')->orderBy(\DB::raw('rand()'))->take(5)->get()); + + return view('wap.index.' . $post['template'], $data); } - - //商品列表页 - public function productcat($cat, $page=0) - { + + //商品列表页 + public function productcat($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');} + + 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'); + } $data['post'] = $post; - - $subcat=""; - $post2 = object_to_array(DB::table('product_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(); - if($counts>sysconfig('CMS_MAXARC')){$counts=sysconfig('CMS_MAXARC');dd($counts);} - $pagesize = sysconfig('CMS_PAGESIZE');$page=0; - if($counts % $pagesize){//取总数据量除以每页数的余数 - $pages = intval($counts/$pagesize) + 1; //如果有余数,则页数等于总数据量除以每页数的结果取整再加一,如果没有余数,则页数等于总数据量除以每页数的结果 - }else{$pages = $counts/$pagesize;} - if(!empty($pagenow)){if($pagenow==1 || $pagenow>$pages){return redirect()->route('page404');}$page = $pagenow-1;$nextpage=$pagenow+1;$previouspage=$pagenow-1;}else{$page = 0;$nextpage=2;$previouspage=0;} - $data['page'] = $page; - $data['pages'] = $pages; - $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")); //获取分页列表 - - if($post['templist']=='category2'){if(!empty($pagenow)){return redirect()->route('page404');}} - - return view('wap.index.'.$post['templist'], $data); - } - + + $subcat = ""; + $post2 = object_to_array(DB::table('product_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(); + if ($counts > sysconfig('CMS_MAXARC')) { + $counts = sysconfig('CMS_MAXARC'); + dd($counts); + } + $pagesize = sysconfig('CMS_PAGESIZE'); + $page = 0; + if ($counts % $pagesize) {//取总数据量除以每页数的余数 + $pages = intval($counts / $pagesize) + 1; //如果有余数,则页数等于总数据量除以每页数的结果取整再加一,如果没有余数,则页数等于总数据量除以每页数的结果 + } else { + $pages = $counts / $pagesize; + } + if (!empty($pagenow)) { + if ($pagenow == 1 || $pagenow > $pages) { + return redirect()->route('page404'); + } + $page = $pagenow - 1; + $nextpage = $pagenow + 1; + $previouspage = $pagenow - 1; + } else { + $page = 0; + $nextpage = 2; + $previouspage = 0; + } + $data['page'] = $page; + $data['pages'] = $pages; + $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")); //获取分页列表 + + if ($post['templist'] == 'category2') { + if (!empty($pagenow)) { + return redirect()->route('page404'); + } + } + + return view('wap.index.' . $post['templist'], $data); + } + //商品详情页 public function product($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'); - if($post) - { - $cat = $post['typeid']; - $post['body'] = ReplaceKeyword($post['body']); - if(!empty($post['writer'])){$post['writertitle']=$post['title'].' '.$post['writer'];} - - $data['post'] = $post; - $data['pre'] = get_article_prenext(array('aid'=>$post["id"],'typeid'=>$post["typeid"],'type'=>"pre")); + { + 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'); } - else - { + $post['name'] = DB::table('product_type')->where('id', $post['typeid'])->value('name'); + if ($post) { + $cat = $post['typeid']; + $post['body'] = ReplaceKeyword($post['body']); + if (!empty($post['writer'])) { + $post['writertitle'] = $post['title'] . ' ' . $post['writer']; + } + + $data['post'] = $post; + $data['pre'] = get_article_prenext(array('aid' => $post["id"], 'typeid' => $post["typeid"], 'type' => "pre")); + } else { return redirect()->route('page404'); } - - $post = object_to_array(DB::table('product_type')->where('id', $cat)->first(), 1); - - return view('wap.index.'.$post['temparticle'], $data); + + $post = object_to_array(DB::table('product_type')->where('id', $cat)->first(), 1); + + return view('wap.index.' . $post['temparticle'], $data); } - - //sitemap页面 + + //sitemap页面 public function sitemap() { - return view('wap.index.sitemap'); + return view('wap.index.sitemap'); } - - //404页面 - public function page404() - { - return view('home.404'); - } - + + //404页面 + public function page404() + { + return view('home.404'); + } + //测试页面 - public function test() + public function test() { - return date("Y-m-d H:i:s",strtotime("2017-04")); + return date("Y-m-d H:i:s", strtotime("2017-04")); } } \ No newline at end of file diff --git a/app/Http/Controllers/Wap/PageController.php b/app/Http/Controllers/Wap/PageController.php new file mode 100644 index 0000000..3917bc6 --- /dev/null +++ b/app/Http/Controllers/Wap/PageController.php @@ -0,0 +1,42 @@ +where($map)->first(), 1); + cache("pageid$id", $post, 2592000); + cache(["pageid$id" => $post], \Carbon\Carbon::now()->addMinutes(2592000)); + } + + if (!$post) { + return redirect()->route('page404'); + } + $data['post'] = $post; + } else { + return redirect()->route('page404'); + } + + $data['posts'] = object_to_array(DB::table('page')->orderBy(\DB::raw('rand()'))->take(5)->get()); + + return view('wap.page.detail', $data); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/Weixin/AddressController.php b/app/Http/Controllers/Weixin/AddressController.php index 31ca714..a37f8d1 100644 --- a/app/Http/Controllers/Weixin/AddressController.php +++ b/app/Http/Controllers/Weixin/AddressController.php @@ -1,87 +1,86 @@ $pagesize, + 'limit' => $pagesize, 'offset' => $offset, 'access_token' => $_SESSION['weixin_user_info']['access_token'] - ); - $url = env('APP_API_URL')."/user_address_list"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/user_address_list"; + $res = curl_request($url, $postdata, 'GET'); $data['list'] = $res['data']['list']; - - $data['totalpage'] = ceil($res['data']['count']/$pagesize); - if(isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax']==1) - { - $html = ''; - - if($res['data']['list']) - { - foreach($res['data']['list'] as $k => $v) - { + + $data['totalpage'] = ceil($res['data']['count'] / $pagesize); + if (isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax'] == 1) { + $html = ''; + + if ($res['data']['list']) { + foreach ($res['data']['list'] as $k => $v) { $html .= '
    '; - - if($v['is_default']==1) - { - $html .= '

    '.$v['mobile'].'默认

    '; - } - else - { - $html .= '

    '.$v['mobile'].'

    '; + + if ($v['is_default'] == 1) { + $html .= '

    ' . $v['mobile'] . '默认

    '; + } else { + $html .= '

    ' . $v['mobile'] . '

    '; } - - $html .= '

    '.$v['province_name'].$v['city_name'].$v['district_name'].' '.$v['address'].'

    '; - $html .= ''; + + $html .= '

    ' . $v['province_name'] . $v['city_name'] . $v['district_name'] . ' ' . $v['address'] . '

    '; + $html .= ''; $html .= '
    '; } } - - exit(json_encode($html)); - } - - return view('weixin.address.index', $data); - } - + + exit(json_encode($html)); + } + + return view('weixin.address.index', $data); + } + //收货地址添加 public function userAddressAdd(Request $request) - { - return view('weixin.address.userAddressAdd'); - } - + { + return view('weixin.address.userAddressAdd'); + } + //收货地址修改 public function userAddressUpdate(Request $request) - { - $id = $request->input('id',''); - - if($id == ''){$this->error_jump(ReturnCode::NO_FOUND,route('weixin'),3);} - + { + $id = $request->input('id', ''); + + if ($id == '') { + $this->error_jump(ReturnCode::NO_FOUND, route('weixin'), 3); + } + $postdata = array( - 'id' => $_REQUEST['id'], + 'id' => $_REQUEST['id'], 'access_token' => $_SESSION['weixin_user_info']['access_token'] - ); - $url = env('APP_API_URL')."/user_address_detail"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/user_address_detail"; + $res = curl_request($url, $postdata, 'GET'); $data['post'] = $res['data']; - - return view('weixin.address.userAddressUpdate',$data); - } + + return view('weixin.address.userAddressUpdate', $data); + } } \ No newline at end of file diff --git a/app/Http/Controllers/Weixin/ArticleController.php b/app/Http/Controllers/Weixin/ArticleController.php index 970545a..2a5bd74 100644 --- a/app/Http/Controllers/Weixin/ArticleController.php +++ b/app/Http/Controllers/Weixin/ArticleController.php @@ -1,83 +1,83 @@ $cat - ); - $url = env('APP_API_URL')."/arctype_detail"; - $arctype_detail = curl_request($url,$postdata,'GET'); + 'id' => $cat + ); + $url = env('APP_API_URL') . "/arctype_detail"; + $arctype_detail = curl_request($url, $postdata, 'GET'); $data['post'] = $arctype_detail['data']; - - if(isset($_REQUEST['page'])){$offset = ($_REQUEST['page']-1)*$pagesize;} - + + if (isset($_REQUEST['page'])) { + $offset = ($_REQUEST['page'] - 1) * $pagesize; + } + //文章列表 $postdata2 = array( - 'limit' => $pagesize, + 'limit' => $pagesize, 'offset' => $offset, - 'typeid' => $cat - ); - $url = env('APP_API_URL')."/article_list"; - $res = curl_request($url,$postdata2,'GET'); - if($res['data']['list']) - { - foreach($res['data']['list'] as $k => $v) - { - $res['data']['list'][$k]['pubdate'] = date("Y-m-d H:i",$v['pubdate']); + 'typeid' => $cat + ); + $url = env('APP_API_URL') . "/article_list"; + $res = curl_request($url, $postdata2, 'GET'); + if ($res['data']['list']) { + foreach ($res['data']['list'] as $k => $v) { + $res['data']['list'][$k]['pubdate'] = date("Y-m-d H:i", $v['pubdate']); } } $data['list'] = $res['data']['list']; - - $data['totalpage'] = ceil($res['data']['count']/$pagesize); - - if(isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax']==1) - { - $html = ''; - - if($res['data']['list']) - { - foreach($res['data']['list'] as $k => $v) - { - $html .= '
  • '.$v['title'].'

    '.$v['pubdate'].'

  • '; + + $data['totalpage'] = ceil($res['data']['count'] / $pagesize); + + if (isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax'] == 1) { + $html = ''; + + if ($res['data']['list']) { + foreach ($res['data']['list'] as $k => $v) { + $html .= '
  • ' . $v['title'] . '

    ' . $v['pubdate'] . '

  • '; } } - - exit(json_encode($html)); - } - - return view('weixin.article.category', $data); - } - + + exit(json_encode($html)); + } + + return view('weixin.article.category', $data); + } + //文章详情页 public function detail($id) - { + { //最新资讯 $postdata = array( - 'id' => $id - ); - $url = env('APP_API_URL')."/article_detail"; - $res = curl_request($url,$postdata,'GET'); - if(empty($res['data'])){return redirect()->route('weixin_page404');} - $res['data']['body'] = preg_replace('/src=\"\/uploads\/allimg/',"src=\"".env('APP_URL')."/uploads/allimg",$res['data']['body']); - $res['data']['pubdate'] = date('Y-m-d',$res['data']['pubdate']); + 'id' => $id + ); + $url = env('APP_API_URL') . "/article_detail"; + $res = curl_request($url, $postdata, 'GET'); + if (empty($res['data'])) { + return redirect()->route('weixin_page404'); + } + $res['data']['body'] = preg_replace('/src=\"\/uploads\/allimg/', "src=\"" . env('APP_URL') . "/uploads/allimg", $res['data']['body']); + $res['data']['pubdate'] = date('Y-m-d', $res['data']['pubdate']); $data['post'] = $res['data']; - + return view('weixin.article.detail', $data); } } \ No newline at end of file diff --git a/app/Http/Controllers/Weixin/BaseController.php b/app/Http/Controllers/Weixin/BaseController.php new file mode 100644 index 0000000..839125f --- /dev/null +++ b/app/Http/Controllers/Weixin/BaseController.php @@ -0,0 +1,14 @@ +isWechatBrowser = Helper::isWechatBrowser(); view()->share('isWechatBrowser', $this->isWechatBrowser); + + $this->login_info = array(); + if (isset($_SESSION['weixin_user_info'])) { + $this->login_info = $_SESSION['weixin_user_info']; + } + + // 添加操作记录 + $this->operation_log_add(); } - + /** * 操作错误跳转的快捷方法 * @access protected @@ -24,25 +34,21 @@ class CommonController extends Controller * @param mixed $time 当数字时指定跳转时间 * @return void */ - public function error_jump($msg='', $url='', $time=3) + public function error_jump($msg = '', $url = '', $time = 3) { - if ($url=='' && isset($_SERVER["HTTP_REFERER"])) - { + if ($url == '' && isset($_SERVER["HTTP_REFERER"])) { $url = $_SERVER["HTTP_REFERER"]; } - - if(!headers_sent()) - { - header("Location:".route('weixin_jump')."?error=$msg&url=$url&time=$time"); + + if (!headers_sent()) { + header("Location:" . route('weixin_jump') . "?error=$msg&url=$url&time=$time"); exit(); - } - else - { - $str = ""; + } else { + $str = ""; exit($str); } } - + /** * 操作成功跳转的快捷方法 * @access protected @@ -51,22 +57,42 @@ class CommonController extends Controller * @param mixed $time 当数字时指定跳转时间 * @return void */ - public function success_jump($msg='', $url='', $time=1) + public function success_jump($msg = '', $url = '', $time = 1) { - if ($url=='' && isset($_SERVER["HTTP_REFERER"])) - { + if ($url == '' && isset($_SERVER["HTTP_REFERER"])) { $url = $_SERVER["HTTP_REFERER"]; } - - if(!headers_sent()) - { - header("Location:".route('weixin_jump')."?message=$msg&url=$url&time=$time"); + + if (!headers_sent()) { + header("Location:" . route('weixin_jump') . "?message=$msg&url=$url&time=$time"); exit(); - } - else - { - $str = ""; + } else { + $str = ""; exit($str); } } + + // 添加操作记录 + public function operation_log_add($login_info = []) + { + $time = time(); + // 记录操作 + if ($login_info) { + $data['login_id'] = $login_info['id']; + $data['login_name'] = $login_info['user_name']; + } + $data['type'] = 5; + $data['ip'] = request()->ip(); + $data['url'] = mb_strcut(request()->url(), 0, 255, 'UTF-8'); + $data['http_method'] = request()->method(); + $data['domain_name'] = mb_strcut($_SERVER['SERVER_NAME'], 0, 60, 'UTF-8'); + if ($data['http_method'] != 'GET') { + $data['content'] = mb_strcut(json_encode(request()->toArray(), JSON_UNESCAPED_SLASHES), 0, 255, 'UTF-8'); + } + if (!empty($_SERVER['HTTP_REFERER'])) { + $data['http_referer'] = mb_strcut($_SERVER['HTTP_REFERER'], 0, 255, 'UTF-8'); + } + $data['add_time'] = $time; + logic('Log')->add($data); + } } \ No newline at end of file diff --git a/app/Http/Controllers/Weixin/FeedbackController.php b/app/Http/Controllers/Weixin/FeedbackController.php index 0f5b53d..f9e22e4 100644 --- a/app/Http/Controllers/Weixin/FeedbackController.php +++ b/app/Http/Controllers/Weixin/FeedbackController.php @@ -1,20 +1,21 @@ error_jump(ReturnCode::NO_FOUND,route('weixin'),3);} - - return view('weixin.goods_brand.brandDetail', $data); - } - + if (!$data['post']) { + $this->error_jump(ReturnCode::NO_FOUND, route('weixin'), 3); + } + + return view('weixin.goods_brand.brandDetail', $data); + } + //商品品牌列表 public function brandList(Request $request) - { + { //商品列表 $postdata['limit'] = 10; $postdata['offset'] = 0; - - $url = env('APP_API_URL')."/goodsbrand_list"; - $res = curl_request($url,$postdata,'GET'); + + $url = env('APP_API_URL') . "/goodsbrand_list"; + $res = curl_request($url, $postdata, 'GET'); $data['list'] = $res['data']['list']; - - return view('weixin.goods_brand.brandList', $data); - } + + return view('weixin.goods_brand.brandList', $data); + } } \ No newline at end of file diff --git a/app/Http/Controllers/Weixin/GoodsController.php b/app/Http/Controllers/Weixin/GoodsController.php index 4d0939a..4d79760 100644 --- a/app/Http/Controllers/Weixin/GoodsController.php +++ b/app/Http/Controllers/Weixin/GoodsController.php @@ -1,125 +1,151 @@ $id - ); - if(isset($_SESSION['weixin_user_info'])){$postdata['user_id']=$_SESSION['weixin_user_info']['id'];} - $url = env('APP_API_URL')."/goods_detail"; - $res = curl_request($url,$postdata,'GET'); + 'id' => $id + ); + if (isset($_SESSION['weixin_user_info'])) { + $postdata['user_id'] = $_SESSION['weixin_user_info']['id']; + } + $url = env('APP_API_URL') . "/goods_detail"; + $res = curl_request($url, $postdata, 'GET'); $data['post'] = $res['data']; - if(!$data['post']){$this->error_jump(ReturnCode::NO_FOUND,route('weixin'),3);} - + if (!$data['post']) { + $this->error_jump(ReturnCode::NO_FOUND, route('weixin'), 3); + } + //添加浏览记录 - if(isset($_SESSION['weixin_user_info'])) - { + if (isset($_SESSION['weixin_user_info'])) { $postdata = array( - 'goods_id' => $id, + 'goods_id' => $id, 'access_token' => $_SESSION['weixin_user_info']['access_token'] ); - $url = env('APP_API_URL')."/user_goods_history_add"; - curl_request($url,$postdata,'POST'); + $url = env('APP_API_URL') . "/user_goods_history_add"; + curl_request($url, $postdata, 'POST'); } - - return view('weixin.goods.goodsDetail', $data); - } - + + return view('weixin.goods.goodsDetail', $data); + } + //商品列表 public function goodsList(Request $request) - { - if($request->input('typeid', null) != null){$param['typeid'] = $request->input('typeid');} - if($request->input('tuijian', null) != null){$param['tuijian'] = $request->input('tuijian');} - if($request->input('keyword', null) != null){$param['keyword'] = $request->input('keyword');} - if($request->input('status', null) != null){$param['status'] = $request->input('status');} - if($request->input('is_promote', null) != null){$param['is_promote'] = $request->input('is_promote');} - if($request->input('orderby', null) != null){$param['orderby'] = $request->input('orderby');} - if($request->input('max_price', null) != null){$param['max_price'] = $request->input('max_price');}else{$param['max_price'] = 99999;} - if($request->input('min_price', null) != null){$param['min_price'] = $request->input('min_price');}else{$param['min_price'] = 0;} - if($request->input('brand_id', null) != null){$param['brand_id'] = $request->input('brand_id');} - + { + if ($request->input('typeid', null) != null) { + $param['typeid'] = $request->input('typeid'); + } + if ($request->input('tuijian', null) != null) { + $param['tuijian'] = $request->input('tuijian'); + } + if ($request->input('keyword', null) != null) { + $param['keyword'] = $request->input('keyword'); + } + if ($request->input('status', null) != null) { + $param['status'] = $request->input('status'); + } + if ($request->input('is_promote', null) != null) { + $param['is_promote'] = $request->input('is_promote'); + } + if ($request->input('orderby', null) != null) { + $param['orderby'] = $request->input('orderby'); + } + if ($request->input('max_price', null) != null) { + $param['max_price'] = $request->input('max_price'); + } else { + $param['max_price'] = 99999; + } + if ($request->input('min_price', null) != null) { + $param['min_price'] = $request->input('min_price'); + } else { + $param['min_price'] = 0; + } + if ($request->input('brand_id', null) != null) { + $param['brand_id'] = $request->input('brand_id'); + } + //商品列表 $postdata = $param; $postdata['limit'] = 10; $postdata['offset'] = 0; - - $url = env('APP_API_URL')."/goods_list"; - $res = curl_request($url,$postdata,'GET'); + + $url = env('APP_API_URL') . "/goods_list"; + $res = curl_request($url, $postdata, 'GET'); $data['goods_list'] = $res['data']['list']; $data['request_param'] = $param; - - return view('weixin.goods.goodsList', $data); - } - + + return view('weixin.goods.goodsList', $data); + } + //商品列表 public function categoryGoodsList(Request $request) - { + { $data['typeid'] = 0; - if($request->input('typeid', null) != null){$data['typeid'] = $request->input('typeid');} - + if ($request->input('typeid', null) != null) { + $data['typeid'] = $request->input('typeid'); + } + $pagesize = 10; $offset = 0; - if(isset($_REQUEST['page'])){$offset = ($_REQUEST['page']-1)*$pagesize;} - + if (isset($_REQUEST['page'])) { + $offset = ($_REQUEST['page'] - 1) * $pagesize; + } + //商品列表 $postdata = array( 'typeid' => $data['typeid'], - 'limit' => $pagesize, + 'limit' => $pagesize, 'offset' => $offset - ); - $url = env('APP_API_URL')."/goods_list"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/goods_list"; + $res = curl_request($url, $postdata, 'GET'); $data['list'] = $res['data']['list']; - - $data['totalpage'] = ceil($res['data']['count']/$pagesize); - - if(isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax']==1) - { - $html = ''; - - if($res['data']['list']) - { - foreach($res['data']['list'] as $k => $v) - { + + $data['totalpage'] = ceil($res['data']['count'] / $pagesize); + + if (isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax'] == 1) { + $html = ''; + + if ($res['data']['list']) { + foreach ($res['data']['list'] as $k => $v) { $html .= '
  • '; - $html .= ''.$v['title'].''; $html .= '
  • '; } } - - exit(json_encode($html)); - } - + + exit(json_encode($html)); + } + //商品分类列表 $postdata = array( - 'pid' => 0, - 'limit' => 15, + 'pid' => 0, + 'limit' => 15, 'offset' => 0 - ); - $url = env('APP_API_URL')."/goodstype_list"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/goodstype_list"; + $res = curl_request($url, $postdata, 'GET'); $data['goodstype_list'] = $res['data']['list']; - - return view('weixin.goods.categoryGoodsList', $data); - } + + return view('weixin.goods.categoryGoodsList', $data); + } } \ No newline at end of file diff --git a/app/Http/Controllers/Weixin/IndexController.php b/app/Http/Controllers/Weixin/IndexController.php index 9aa0f56..965654c 100644 --- a/app/Http/Controllers/Weixin/IndexController.php +++ b/app/Http/Controllers/Weixin/IndexController.php @@ -1,266 +1,307 @@ 1, - 'limit' => 5, + 'type' => 1, + 'limit' => 5, 'offset' => 0 - ); - $url = env('APP_API_URL')."/slide_list"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/slide_list"; + $res = curl_request($url, $postdata, 'GET'); $data['slide_list'] = $res['data']['list']; - + //最新资讯 $postdata = array( - 'limit' => 5, + 'limit' => 5, 'offset' => 0 - ); - $url = env('APP_API_URL')."/article_list"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/article_list"; + $res = curl_request($url, $postdata, 'GET'); $data['article_list'] = $res['data']['list']; - + //最新商品列表 $postdata = array( - 'limit' => 8, + 'limit' => 8, 'offset' => 0 - ); - $url = env('APP_API_URL')."/goods_list"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/goods_list"; + $res = curl_request($url, $postdata, 'GET'); $data['goods_list'] = $res['data']['list']; - + //商品推荐 $postdata = array( - 'tuijian'=> 1, - 'limit' => 6, + 'tuijian' => 1, + 'limit' => 6, 'offset' => 0 - ); - $url = env('APP_API_URL')."/goods_list"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/goods_list"; + $res = curl_request($url, $postdata, 'GET'); $data['goods_recommend_list'] = $res['data']['list']; - + //畅销商品列表 $postdata = array( - 'orderby'=> 1, - 'limit' => 6, + 'orderby' => 1, + 'limit' => 6, 'offset' => 0 - ); - $url = env('APP_API_URL')."/goods_list"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/goods_list"; + $res = curl_request($url, $postdata, 'GET'); $data['goods_sale_list'] = $res['data']['list']; - + //促销、优惠商品列表 $postdata = array( - 'orderby'=> 5, - 'limit' => 4, + 'orderby' => 5, + 'limit' => 4, 'offset' => 0 - ); - $url = env('APP_API_URL')."/goods_list"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/goods_list"; + $res = curl_request($url, $postdata, 'GET'); $data['goods_promote_list'] = $res['data']['list']; - - return view('weixin.index.index',$data); + + return view('weixin.index.index', $data); } - + //分类 public function category() - { + { $data['aaa'] = 111; - return view('weixin.index.category',$data); + return view('weixin.index.category', $data); } - + //标签详情页,共有3种显示方式,1正常列表,2列表显示文章,3显示描述 - public function tag($tag, $page=0) - { + public function tag($tag, $page = 0) + { $pagenow = $page; - - if(empty($tag) || !preg_match('/[0-9]+/',$tag)){return redirect()->route('page404');} - - $post = object_to_array(DB::table('tagindex')->where('id',$tag)->first(), 1); + + if (empty($tag) || !preg_match('/[0-9]+/', $tag)) { + return redirect()->route('page404'); + } + + $post = object_to_array(DB::table('tagindex')->where('id', $tag)->first(), 1); $data['post'] = $post; - - $counts=DB::table("taglist")->where('tid',$tag)->count('aid'); - if($counts>sysconfig('CMS_MAXARC')){$counts=sysconfig('CMS_MAXARC');} - $pagesize=sysconfig('CMS_PAGESIZE');$page=0; - if($counts % $pagesize){//取总数据量除以每页数的余数 - $pages = intval($counts/$pagesize) + 1; //如果有余数,则页数等于总数据量除以每页数的结果取整再加一,如果没有余数,则页数等于总数据量除以每页数的结果 - }else{$pages = $counts/$pagesize;} - if(!empty($pagenow)){if($pagenow==1 || $pagenow>$pages){return redirect()->route('page404');}$page = $pagenow-1;$nextpage=$pagenow+1;$previouspage=$pagenow-1;}else{$page = 0;$nextpage=2;$previouspage=0;} - $data['page'] = $page; - $data['pages'] = $pages; - $data['counts'] = $counts; - $start=$page*$pagesize; - - $posts=object_to_array(DB::table("taglist")->where('tid',$tag)->orderBy('aid', 'desc')->skip($start)->take($pagesize)->get()); - foreach($posts as $row) - { - $aid[] = $row["aid"]; - } - $aid = isset($aid)?implode(',',$aid):""; - - if($aid!="") - { - if($post['template']=='tag2') - { - $data['posts'] = arclist(array("sql"=>"id in ($aid)","orderby"=>['id', 'desc'],"row"=>"$pagesize","field"=>"title,body")); //获取列表 - } - else - { - $data['posts'] = arclist(array("sql"=>"id in ($aid)","orderby"=>['id', 'desc'],"row"=>"$pagesize")); //获取列表 + + $counts = DB::table("taglist")->where('tid', $tag)->count('aid'); + if ($counts > sysconfig('CMS_MAXARC')) { + $counts = sysconfig('CMS_MAXARC'); + } + $pagesize = sysconfig('CMS_PAGESIZE'); + $page = 0; + if ($counts % $pagesize) {//取总数据量除以每页数的余数 + $pages = intval($counts / $pagesize) + 1; //如果有余数,则页数等于总数据量除以每页数的结果取整再加一,如果没有余数,则页数等于总数据量除以每页数的结果 + } else { + $pages = $counts / $pagesize; + } + if (!empty($pagenow)) { + if ($pagenow == 1 || $pagenow > $pages) { + return redirect()->route('page404'); } + $page = $pagenow - 1; + $nextpage = $pagenow + 1; + $previouspage = $pagenow - 1; + } else { + $page = 0; + $nextpage = 2; + $previouspage = 0; } - else - { + $data['page'] = $page; + $data['pages'] = $pages; + $data['counts'] = $counts; + $start = $page * $pagesize; + + $posts = object_to_array(DB::table("taglist")->where('tid', $tag)->orderBy('aid', 'desc')->skip($start)->take($pagesize)->get()); + foreach ($posts as $row) { + $aid[] = $row["aid"]; + } + $aid = isset($aid) ? implode(',', $aid) : ""; + + if ($aid != "") { + if ($post['template'] == 'tag2') { + $data['posts'] = arclist(array("sql" => "id in ($aid)", "orderby" => ['id', 'desc'], "row" => "$pagesize", "field" => "title,body")); //获取列表 + } else { + $data['posts'] = arclist(array("sql" => "id in ($aid)", "orderby" => ['id', 'desc'], "row" => "$pagesize")); //获取列表 + } + } else { $data['posts'] = ''; //获取列表 } - - $data['pagenav'] = get_listnav(array("counts"=>$counts,"pagesize"=>$pagesize,"pagenow"=>$page+1,"catid"=>$tag,"urltype"=>"tag")); //获取分页列表 - - if($post['template']=='tag2' || $post['template']=='tag3'){if(!empty($pagenow)){return redirect()->route('page404');}} - - return view('weixin.index.'.$post['template'], $data); + + $data['pagenav'] = get_listnav(array("counts" => $counts, "pagesize" => $pagesize, "pagenow" => $page + 1, "catid" => $tag, "urltype" => "tag")); //获取分页列表 + + if ($post['template'] == 'tag2' || $post['template'] == 'tag3') { + if (!empty($pagenow)) { + return redirect()->route('page404'); + } + } + + return view('weixin.index.' . $post['template'], $data); } - - //标签页 + + //标签页 public function tags() - { - return view('weixin.index.tags'); + { + return view('weixin.index.tags'); } - + //搜索页 - public function search() - { + public function search() + { //商品热门搜索词列表 $postdata = array( - 'limit' => 10, + 'limit' => 10, 'offset' => 0 - ); - $url = env('APP_API_URL')."/goods_searchword_list"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/goods_searchword_list"; + $res = curl_request($url, $postdata, 'GET'); $data['goods_searchword_list'] = $res['data']['list']; - - return view('weixin.index.search',$data); + + return view('weixin.index.search', $data); } - + //单页面 public function page($id) - { - $data = []; - - if(!empty($id) && preg_match('/[a-z0-9]+/',$id)) - { - $map['filename']=$id; - if(cache("pageid$id")){$post=cache("pageid$id");}else{$post = object_to_array(DB::table('page')->where($map)->first(), 1);cache("pageid$id", $post, 2592000);cache(["pageid$id"=>$post], \Carbon\Carbon::now()->addMinutes(2592000));} - - if($post) - { - $post['body'] = preg_replace('/src=\"\/uploads\/allimg/',"src=\"".env('APP_URL')."/uploads/allimg",$post['body']); - $post['pubdate'] = date('Y-m-d',$post['pubdate']); - $data['post'] = $post; + { + $data = []; + + if (!empty($id) && preg_match('/[a-z0-9]+/', $id)) { + $map['filename'] = $id; + if (cache("pageid$id")) { + $post = cache("pageid$id"); + } else { + $post = object_to_array(DB::table('page')->where($map)->first(), 1); + cache("pageid$id", $post, 2592000); + cache(["pageid$id" => $post], \Carbon\Carbon::now()->addMinutes(2592000)); } - else - { + + if ($post) { + $post['body'] = preg_replace('/src=\"\/uploads\/allimg/', "src=\"" . env('APP_URL') . "/uploads/allimg", $post['body']); + $post['pubdate'] = date('Y-m-d', $post['pubdate']); + $data['post'] = $post; + } else { return redirect()->route('page404'); } - - } - else - { + + } else { return redirect()->route('page404'); } - - $data['posts'] = object_to_array(DB::table('page')->orderBy(\DB::raw('rand()'))->take(5)->get()); - - return view('weixin.index.'.$post['template'], $data); + + $data['posts'] = object_to_array(DB::table('page')->orderBy(\DB::raw('rand()'))->take(5)->get()); + + return view('weixin.index.' . $post['template'], $data); } - - //商品列表页 + + //商品列表页 public function goodslist(Request $request) - { - if($request->input('typeid', '') != ''){$data['typeid'] = $request->input('typeid');} - if($request->input('tuijian', '') != ''){$data['tuijian'] = $request->input('tuijian');} - if($request->input('keyword', '') != ''){$data['keyword'] = $request->input('keyword');} - if($request->input('status', '') != ''){$data['status'] = $request->input('status');} - if($request->input('is_promote', '') != ''){$data['is_promote'] = $request->input('is_promote');} - if($request->input('orderby', '') != ''){$data['orderby'] = $request->input('orderby');} - if($request->input('max_price', '') != ''){$data['max_price'] = $request->input('max_price');}else{$data['max_price'] = 99999;} - if($request->input('min_price', '') != ''){$data['min_price'] = $request->input('min_price');}else{$data['min_price'] = 0;} - - return view('weixin.index.goodslist', $data); - } - + { + if ($request->input('typeid', '') != '') { + $data['typeid'] = $request->input('typeid'); + } + if ($request->input('tuijian', '') != '') { + $data['tuijian'] = $request->input('tuijian'); + } + if ($request->input('keyword', '') != '') { + $data['keyword'] = $request->input('keyword'); + } + if ($request->input('status', '') != '') { + $data['status'] = $request->input('status'); + } + if ($request->input('is_promote', '') != '') { + $data['is_promote'] = $request->input('is_promote'); + } + if ($request->input('orderby', '') != '') { + $data['orderby'] = $request->input('orderby'); + } + if ($request->input('max_price', '') != '') { + $data['max_price'] = $request->input('max_price'); + } else { + $data['max_price'] = 99999; + } + if ($request->input('min_price', '') != '') { + $data['min_price'] = $request->input('min_price'); + } else { + $data['min_price'] = 0; + } + + return view('weixin.index.goodslist', $data); + } + //商品详情页 public function goods($id) - { - if(empty($id) || !preg_match('/[0-9]+/',$id)){return redirect()->route('page404');} - - $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']; - $post['body'] = ReplaceKeyword($post['body']); - if(!empty($post['writer'])){$post['writertitle']=$post['title'].' '.$post['writer'];} - - $data['post'] = $post; - $data['pre'] = get_article_prenext(array('aid'=>$post["id"],'typeid'=>$post["typeid"],'type'=>"pre")); + { + if (empty($id) || !preg_match('/[0-9]+/', $id)) { + return redirect()->route('page404'); } - else - { + + $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']; + $post['body'] = ReplaceKeyword($post['body']); + if (!empty($post['writer'])) { + $post['writertitle'] = $post['title'] . ' ' . $post['writer']; + } + + $data['post'] = $post; + $data['pre'] = get_article_prenext(array('aid' => $post["id"], 'typeid' => $post["typeid"], 'type' => "pre")); + } else { return redirect()->route('page404'); } - - $post = object_to_array(DB::table('goods_type')->where('id', $cat)->first(), 1); - - return view('weixin.index.'.$post['temparticle'], $data); + + $post = object_to_array(DB::table('goods_type')->where('id', $cat)->first(), 1); + + return view('weixin.index.' . $post['temparticle'], $data); } - - //sitemap页面 + + //sitemap页面 public function sitemap() { - return view('weixin.index.sitemap'); + return view('weixin.index.sitemap'); } - - //404页面 - public function page404() - { - return view('weixin.404'); - } - + + //404页面 + public function page404() + { + return view('weixin.404'); + } + //测试页面 - public function test() - {return view('weixin.index.test'); + public function test() + { + return view('weixin.index.test'); //return base_path('resources/org'); //$qrcode = new \SimpleSoftwareIO\QrCode\BaconQrCodeGenerator; //return $qrcode->size(500)->generate('Make a qrcode without Laravel!'); //return ''; - //set_exception_handler('myException'); - //return uniqid(); - //return \App\Common\Helper::formatPrice(1.2346); + //set_exception_handler('myException'); + //return uniqid(); + //return \App\Common\Helper::formatPrice(1.2346); } } \ No newline at end of file diff --git a/app/Http/Controllers/Weixin/OrderController.php b/app/Http/Controllers/Weixin/OrderController.php index 58d2577..7be4b0f 100644 --- a/app/Http/Controllers/Weixin/OrderController.php +++ b/app/Http/Controllers/Weixin/OrderController.php @@ -1,264 +1,270 @@ input('status',-1); - + + if (isset($_REQUEST['page'])) { + $offset = ($_REQUEST['page'] - 1) * $pagesize; + } + + $status = $request->input('status', -1); + $postdata = array( - 'limit' => $pagesize, + 'limit' => $pagesize, 'offset' => $offset, 'status' => $status, //0或者不传表示全部,1待付款,2待发货,3待收货,4待评价,5退款/售后 'access_token' => $_SESSION['weixin_user_info']['access_token'] - ); - $url = env('APP_API_URL')."/order_list"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/order_list"; + $res = curl_request($url, $postdata, 'GET'); $data['list'] = $res['data']['list']; - - $data['totalpage'] = ceil($res['data']['count']/$pagesize); - - if(isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax']==1) - { - $html = ''; - - if($res['data']['list']) - { - foreach($res['data']['list'] as $k => $v) - { - $html .= '
  • '.$v['goods']['title'].''; - $html .= '

    '.$v['goods']['title'].'

    '; - $html .= '

    '.$v['goods']['price'].'

    '; - $html .= '

    删除

    '; + + $data['totalpage'] = ceil($res['data']['count'] / $pagesize); + + if (isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax'] == 1) { + $html = ''; + + if ($res['data']['list']) { + foreach ($res['data']['list'] as $k => $v) { + $html .= '
  • ' . $v['goods']['title'] . ''; + $html .= '

    ' . $v['goods']['title'] . '

    '; + $html .= '

    ' . $v['goods']['price'] . '

    '; + $html .= '

    删除

    '; $html .= '
  • '; } } - - exit(json_encode($html)); - } - + + exit(json_encode($html)); + } + return view('weixin.order.orderList', $data); } - + //订单详情 public function orderDetail(Request $request) - { - $id = $request->input('id',''); - + { + $id = $request->input('id', ''); + $postdata = array( - 'id' => $id, + 'id' => $id, 'access_token' => $_SESSION['weixin_user_info']['access_token'] - ); - $url = env('APP_API_URL')."/order_detail"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/order_detail"; + $res = curl_request($url, $postdata, 'GET'); $data['post'] = $res['data']; - if(empty($data['post'])){$this->error_jump('订单不存在');} - + if (empty($data['post'])) { + $this->error_jump('订单不存在'); + } + return view('weixin.order.orderDetail', $data); } - - //订单评价 + + //订单评价 public function orderComment(Request $request) - { - if(Helper::isPostRequest()) - { - if($_POST['comment']) - { - foreach($_POST['comment'] as $k=>$v) - { + { + if (Helper::isPostRequest()) { + if ($_POST['comment']) { + foreach ($_POST['comment'] as $k => $v) { $_POST['comment'][$k]['comment_type'] = 0; $_POST['comment'][$k]['comment_rank'] = 5; } - } - else - { + } else { $this->error_jump('评论失败'); } - + $postdata = array( 'order_id' => $_POST['order_id'], 'comment' => json_encode($_POST['comment']), 'access_token' => $_SESSION['weixin_user_info']['access_token'] ); - $url = env('APP_API_URL')."/comment_batch_add"; - $res = curl_request($url,$postdata,'POST'); - if($res['code']!=0){$this->error_jump('评论失败');} - - $this->success_jump('评论成功',route('weixin_order_list')); + $url = env('APP_API_URL') . "/comment_batch_add"; + $res = curl_request($url, $postdata, 'POST'); + if ($res['code'] != 0) { + $this->error_jump('评论失败'); + } + + $this->success_jump('评论成功', route('weixin_order_list')); + } + + $id = $request->input('id', ''); + if ($id == '') { + $this->error_jump('您访问的页面不存在或已被删除!'); } - - $id = $request->input('id',''); - if($id==''){$this->error_jump('您访问的页面不存在或已被删除!');} - + $postdata = array( 'id' => $id, 'order_status' => 3, 'refund_status' => 0, 'access_token' => $_SESSION['weixin_user_info']['access_token'] - ); - $url = env('APP_API_URL')."/order_detail"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/order_detail"; + $res = curl_request($url, $postdata, 'GET'); $data['post'] = $res['data']; - if(empty($data['post'])){$this->error_jump('您访问的页面不存在或已被删除!');} - + if (empty($data['post'])) { + $this->error_jump('您访问的页面不存在或已被删除!'); + } + return view('weixin.order.orderComment', $data); } - + //订单支付 public function pay($id) - { + { //获取订单详情 $postdata = array( 'id' => $id, //要支付的订单id 'order_status' => 0, 'pay_status' => 0, 'access_token' => $_SESSION['weixin_user_info']['access_token'] - ); - $url = env('APP_API_URL')."/order_detail"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/order_detail"; + $res = curl_request($url, $postdata, 'GET'); $data['order_detail'] = $res['data']; $data['order_id'] = $id; - - if($res['code']!=0 || empty($data['order_detail'])){$this->error_jump('订单不存在或已过期');} - + + if ($res['code'] != 0 || empty($data['order_detail'])) { + $this->error_jump('订单不存在或已过期'); + } + //获取会员信息 $postdata = array( 'access_token' => $_SESSION['weixin_user_info']['access_token'] - ); - $url = env('APP_API_URL')."/user_info"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/user_info"; + $res = curl_request($url, $postdata, 'GET'); $data['user_info'] = $res['data']; - + //判断余额是否足够 $is_balance_enough = 1; //足够 - if($data['order_detail']['order_amount']>$data['user_info']['money']){$is_balance_enough = 0;} + if ($data['order_detail']['order_amount'] > $data['user_info']['money']) { + $is_balance_enough = 0; + } $data['is_balance_enough'] = $is_balance_enough; - - return view('weixin.order.pay', $data); - } - + + return view('weixin.order.pay', $data); + } + public function dopay(Request $request) - { - $order_id = $request->input('order_id',''); - $payment_id = $request->input('payment_id',''); - - if($order_id == '' || $payment_id == '') - { + { + $order_id = $request->input('order_id', ''); + $payment_id = $request->input('payment_id', ''); + + if ($order_id == '' || $payment_id == '') { $this->error_jump(ReturnData::PARAMS_ERROR); } - + $url = ''; - - if($payment_id == 1) //余额支付 + + if ($payment_id == 1) //余额支付 { - $url = route('weixin_order_yuepay',array('order_id'=>$order_id)); - } - elseif($payment_id == 2) //微信支付 + $url = route('weixin_order_yuepay', array('order_id' => $order_id)); + } elseif ($payment_id == 2) //微信支付 { - $url = route('weixin_order_wxpay',array('order_id'=>$order_id)); + $url = route('weixin_order_wxpay', array('order_id' => $order_id)); } - - if($url == '') - { + + if ($url == '') { $this->error_jump('订单不存在或已过期'); - } - else - { - header('Location: '.$url); + } else { + header('Location: ' . $url); exit; } } - + //订单余额支付 public function orderYuepay(Request $request) - { - $order_id = $request->input('order_id',''); + { + $order_id = $request->input('order_id', ''); //修改订单状态 $postdata = array( 'id' => $order_id, 'access_token' => $_SESSION['weixin_user_info']['access_token'] - ); - $url = env('APP_API_URL')."/order_yue_pay"; - $res = curl_request($url,$postdata,'POST'); - if($res['code']==ReturnData::SUCCESS){$this->success_jump('支付成功',route('weixin_order_list'));} - + ); + $url = env('APP_API_URL') . "/order_yue_pay"; + $res = curl_request($url, $postdata, 'POST'); + if ($res['code'] == ReturnData::SUCCESS) { + $this->success_jump('支付成功', route('weixin_order_list')); + } + $this->error_jump('支付失败'); } - + //订单-微信支付 public function orderWxpay(Request $request) - { - $order_id = $request->input('order_id',''); - + { + $order_id = $request->input('order_id', ''); + //获取订单详情 $postdata = array( 'id' => $order_id, //要支付的订单id 'order_status' => 0, 'pay_status' => 0, 'access_token' => $_SESSION['weixin_user_info']['access_token'] - ); - $url = env('APP_API_URL')."/order_detail"; - $res = curl_request($url,$postdata,'GET'); - if($res['code']!=0){$this->error_jump('订单不存在或已过期');} + ); + $url = env('APP_API_URL') . "/order_detail"; + $res = curl_request($url, $postdata, 'GET'); + if ($res['code'] != 0) { + $this->error_jump('订单不存在或已过期'); + } $data['order_detail'] = $res['data']; $data['order_id'] = $order_id; - + //微信支付-start require_once(resource_path('org/wxpay/WxPayConfig.php')); // 导入微信配置类 require_once(resource_path('org/wxpay/WxPayPubHelper.class.php')); // 导入微信支付类 - - $body = '订单支付';//订单详情 - $out_trade_no = $data['order_detail']['order_sn'];//订单号 - $total_fee = floatval($data['order_detail']['order_amount']*100);//价格0.01 + + $body = '订单支付';//订单详情 + $out_trade_no = $data['order_detail']['order_sn'];//订单号 + $total_fee = floatval($data['order_detail']['order_amount'] * 100);//价格0.01 $attach = 'pay_type=2'; //附加数据,pay_type=2订单支付,示例:xxx=1&yyy=2 - $notify_url = route('notify_wxpay_jsapi');//通知地址 - $wxconfig= \WxPayConfig::wxconfig(); - - //=========步骤1:网页授权获取用户openid============ - $jsApi = new \JsApi_pub($wxconfig); - $openid = $jsApi->getOpenid(); - //=========步骤2:使用统一支付接口,获取prepay_id============ - //使用统一支付接口 + $notify_url = route('notify_wxpay_jsapi');//通知地址 + $wxconfig = \WxPayConfig::wxconfig(); + + //=========步骤1:网页授权获取用户openid============ + $jsApi = new \JsApi_pub($wxconfig); + $openid = $jsApi->getOpenid(); + //=========步骤2:使用统一支付接口,获取prepay_id============ + //使用统一支付接口 $unifiedOrder = new \UnifiedOrder_pub($wxconfig); - //设置统一支付接口参数 - //设置必填参数 - //appid已填,商户无需重复填写 - //mch_id已填,商户无需重复填写 - //noncestr已填,商户无需重复填写 - //spbill_create_ip已填,商户无需重复填写 - //sign已填,商户无需重复填写 - $unifiedOrder->setParameter("openid","$openid");//微信用户openid,trade_type=JSAPI,此参数必传,用户在商户appid下的唯一标识, - $unifiedOrder->setParameter("body","$body");//商品描述 - $unifiedOrder->setParameter("out_trade_no","$out_trade_no");//商户订单号 - $unifiedOrder->setParameter("total_fee","$total_fee");//总金额 - $unifiedOrder->setParameter("attach","$attach"); //附加数据,选填,在查询API和支付通知中原样返回,可作为自定义参数使用,示例:a=1&b=2 - $unifiedOrder->setParameter("notify_url","$notify_url");//通知地址 - $unifiedOrder->setParameter("trade_type","JSAPI");//交易类型,JSAPI,NATIVE,APP... - $prepay_id = $unifiedOrder->getPrepayId(); - //=========步骤3:使用jsapi调起支付============ - $jsApi->setPrepayId($prepay_id); - $jsApiParameters = $jsApi->getParameters(); - - $data['jsApiParameters'] = $jsApiParameters; + //设置统一支付接口参数 + //设置必填参数 + //appid已填,商户无需重复填写 + //mch_id已填,商户无需重复填写 + //noncestr已填,商户无需重复填写 + //spbill_create_ip已填,商户无需重复填写 + //sign已填,商户无需重复填写 + $unifiedOrder->setParameter("openid", "$openid");//微信用户openid,trade_type=JSAPI,此参数必传,用户在商户appid下的唯一标识, + $unifiedOrder->setParameter("body", "$body");//商品描述 + $unifiedOrder->setParameter("out_trade_no", "$out_trade_no");//商户订单号 + $unifiedOrder->setParameter("total_fee", "$total_fee");//总金额 + $unifiedOrder->setParameter("attach", "$attach"); //附加数据,选填,在查询API和支付通知中原样返回,可作为自定义参数使用,示例:a=1&b=2 + $unifiedOrder->setParameter("notify_url", "$notify_url");//通知地址 + $unifiedOrder->setParameter("trade_type", "JSAPI");//交易类型,JSAPI,NATIVE,APP... + $prepay_id = $unifiedOrder->getPrepayId(); + //=========步骤3:使用jsapi调起支付============ + $jsApi->setPrepayId($prepay_id); + $jsApiParameters = $jsApi->getParameters(); + + $data['jsApiParameters'] = $jsApiParameters; $data['returnUrl'] = route('weixin_order_list'); //支付完成要跳转的url,跳转到用户订单列表页面 - + return view('weixin.order.orderWxpay', $data); } } \ No newline at end of file diff --git a/app/Http/Controllers/Weixin/UserController.php b/app/Http/Controllers/Weixin/UserController.php index c9f74c2..35907b4 100644 --- a/app/Http/Controllers/Weixin/UserController.php +++ b/app/Http/Controllers/Weixin/UserController.php @@ -1,4 +1,5 @@ $_SESSION['weixin_user_info']['access_token'] - ); - $url = env('APP_API_URL')."/user_info"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/user_info"; + $res = curl_request($url, $postdata, 'GET'); $data['user_info'] = $res['data']; - - if($res['code'] != ReturnData::SUCCESS){unset($_SESSION['weixin_user_info']);$this->error_jump('请先登录',route('weixin_login'));} - - return view('weixin.user.index', $data); - } - + + if ($res['code'] != ReturnData::SUCCESS) { + unset($_SESSION['weixin_user_info']); + $this->error_jump('请先登录', route('weixin_login')); + } + + return view('weixin.user.index', $data); + } + //个人中心设置 public function userinfo(Request $request) - { + { //获取会员信息 $postdata = array( 'access_token' => $_SESSION['weixin_user_info']['access_token'] - ); - $url = env('APP_API_URL')."/user_info"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/user_info"; + $res = curl_request($url, $postdata, 'GET'); $data['user_info'] = $res['data']; - - return view('weixin.user.userinfo', $data); - } - + + return view('weixin.user.userinfo', $data); + } + //我的分销 public function userDistribution(Request $request) - { + { //获取会员信息 $postdata = array( 'access_token' => $_SESSION['weixin_user_info']['access_token'] - ); - $url = env('APP_API_URL')."/user_info"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/user_info"; + $res = curl_request($url, $postdata, 'GET'); $data['user_info'] = $res['data']; - + //获取直属下级会员列表 $pagesize = 10; $offset = 0; - if(isset($_REQUEST['page'])){$offset = ($_REQUEST['page']-1)*$pagesize;} - + if (isset($_REQUEST['page'])) { + $offset = ($_REQUEST['page'] - 1) * $pagesize; + } + $postdata = array( - 'limit' => $pagesize, + 'limit' => $pagesize, 'offset' => $offset, 'parent_id' => $_SESSION['weixin_user_info']['id'], 'access_token' => $_SESSION['weixin_user_info']['access_token'] - ); - $url = env('APP_API_URL')."/user_list"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/user_list"; + $res = curl_request($url, $postdata, 'GET'); $data['list'] = $res['data']['list']; - - $data['totalpage'] = ceil($res['data']['count']/$pagesize); - - if(isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax']==1) - { - $html = ''; - - if($res['data']['list']) - { - foreach($res['data']['list'] as $k => $v) - { - $html .= '
  • '.$v['user_name'].''; - $html .= '

    '.$v['user_name'].'

    '; - $html .= '

    佣金:'.$v['commission'].'

    '; - $html .= '

    注册时间:'.date('Y-m-d',$v['add_time']).'

    '; + + $data['totalpage'] = ceil($res['data']['count'] / $pagesize); + + if (isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax'] == 1) { + $html = ''; + + if ($res['data']['list']) { + foreach ($res['data']['list'] as $k => $v) { + $html .= '
  • ' . $v['user_name'] . ''; + $html .= '

    ' . $v['user_name'] . '

    '; + $html .= '

    佣金:' . $v['commission'] . '

    '; + $html .= '

    注册时间:' . date('Y-m-d', $v['add_time']) . '

    '; $html .= '
  • '; } } - - exit(json_encode($html)); - } - - return view('weixin.user.userDistribution', $data); - } - + + exit(json_encode($html)); + } + + return view('weixin.user.userDistribution', $data); + } + //资金管理 public function userAccount(Request $request) - { + { $postdata = array( 'access_token' => $_SESSION['weixin_user_info']['access_token'] - ); - $url = env('APP_API_URL')."/user_info"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/user_info"; + $res = curl_request($url, $postdata, 'GET'); $data['user_info'] = $res['data']; - + return view('weixin.user.userAccount', $data); } - + //提现 public function userWithdraw(Request $request) - { + { $postdata = array( 'access_token' => $_SESSION['weixin_user_info']['access_token'] - ); - $url = env('APP_API_URL')."/user_info"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/user_info"; + $res = curl_request($url, $postdata, 'GET'); $data['user_info'] = $res['data']; $data['is_withdraw'] = 0; //是否达到可提现要求,0否 $data['min_withdraw_money'] = sysconfig('CMS_MIN_WITHDRAWAL_MONEY'); //最低可提现金额 - - if($data['user_info']['money']>=$data['min_withdraw_money']){$data['is_withdraw'] = 1;} - + + if ($data['user_info']['money'] >= $data['min_withdraw_money']) { + $data['is_withdraw'] = 1; + } + return view('weixin.user.userWithdraw', $data); } - + //提现明细 public function userWithdrawList(Request $request) - { + { $pagesize = 10; $offset = 0; - if(isset($_REQUEST['page'])){$offset = ($_REQUEST['page']-1)*$pagesize;} - + if (isset($_REQUEST['page'])) { + $offset = ($_REQUEST['page'] - 1) * $pagesize; + } + $postdata = array( - 'limit' => $pagesize, + 'limit' => $pagesize, 'offset' => $offset, 'access_token' => $_SESSION['weixin_user_info']['access_token'] - ); - $url = env('APP_API_URL')."/user_withdraw_list"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/user_withdraw_list"; + $res = curl_request($url, $postdata, 'GET'); $data['list'] = $res['data']['list']; - - $data['totalpage'] = ceil($res['data']['count']/$pagesize); - - if(isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax']==1) - { - $html = ''; - - if($res['data']['list']) - { - foreach($res['data']['list'] as $k => $v) - { + + $data['totalpage'] = ceil($res['data']['count'] / $pagesize); + + if (isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax'] == 1) { + $html = ''; + + if ($res['data']['list']) { + foreach ($res['data']['list'] as $k => $v) { $html .= '
  • '; - $html .= '- '.$v['money'].''; + $html .= '- ' . $v['money'] . ''; $html .= '

    提现

    '; - $html .= '

    收款账号:'.$v['name'].' ,提现方式:'.$v['method'].' ,姓名:'.$v['name'].'
    状态:'.$v['status_text'].'

    '; - $html .= '

    '.date('Y-m-d H:i:s',$v['add_time']).'

    '; + $html .= '

    收款账号:' . $v['name'] . ' ,提现方式:' . $v['method'] . ' ,姓名:' . $v['name'] . '
    状态:' . $v['status_text'] . '

    '; + $html .= '

    ' . date('Y-m-d H:i:s', $v['add_time']) . '

    '; $html .= '
  • '; } } - - exit(json_encode($html)); - } - + + exit(json_encode($html)); + } + return view('weixin.user.userWithdrawList', $data); } - + //用户充值 public function userRecharge(Request $request) - { + { return view('weixin.user.userRecharge'); } - + //充值明细 public function userRechargeOrder(Request $request) - { + { $pagesize = 10; $offset = 0; - if(isset($_REQUEST['page'])){$offset = ($_REQUEST['page']-1)*$pagesize;} - + if (isset($_REQUEST['page'])) { + $offset = ($_REQUEST['page'] - 1) * $pagesize; + } + $postdata = array( - 'limit' => $pagesize, + 'limit' => $pagesize, 'offset' => $offset, 'status' => 1, 'access_token' => $_SESSION['weixin_user_info']['access_token'] - ); - $url = env('APP_API_URL')."/user_recharge_list"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/user_recharge_list"; + $res = curl_request($url, $postdata, 'GET'); $data['list'] = $res['data']['list']; - - $data['totalpage'] = ceil($res['data']['count']/$pagesize); - - if(isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax']==1) - { - $html = ''; - - if($res['data']['list']) - { - foreach($res['data']['list'] as $k => $v) - { + + $data['totalpage'] = ceil($res['data']['count'] / $pagesize); + + if (isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax'] == 1) { + $html = ''; + + if ($res['data']['list']) { + foreach ($res['data']['list'] as $k => $v) { $html .= '
  • '; - $html .= '+ '.$v['money'].''; + $html .= '+ ' . $v['money'] . ''; $html .= '

    充值

    '; - $html .= '

    '.date('Y-m-d H:i:s', $v['created_at']).'

    '; + $html .= '

    ' . date('Y-m-d H:i:s', $v['created_at']) . '

    '; $html .= '
  • '; } } - - exit(json_encode($html)); - } - + + exit(json_encode($html)); + } + return view('weixin.user.userRechargeOrder', $data); } - + //用户充值第二步,支付 public function userRechargeOrderDetail(Request $request) - { - $id = $request->input('id',''); - if($id == ''){$this->error_jump(ReturnData::PARAMS_ERROR);} - + { + $id = $request->input('id', ''); + if ($id == '') { + $this->error_jump(ReturnData::PARAMS_ERROR); + } + //获取充值记录详情 $postdata = array( 'id' => $id, 'access_token' => $_SESSION['weixin_user_info']['access_token'] - ); - $url = env('APP_API_URL')."/user_recharge_detail"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/user_recharge_detail"; + $res = curl_request($url, $postdata, 'GET'); $user_recharge = $data['post'] = $res['data']; - + //微信支付-start require_once(resource_path('org/wxpay/WxPayConfig.php')); // 导入微信配置类 require_once(resource_path('org/wxpay/WxPayPubHelper.class.php')); // 导入微信支付类 - - $body = '充值';//订单详情 - $out_trade_no = $user_recharge['recharge_sn'];//订单号 - $total_fee = floatval($user_recharge['money']*100);//价格0.01 + + $body = '充值';//订单详情 + $out_trade_no = $user_recharge['recharge_sn'];//订单号 + $total_fee = floatval($user_recharge['money'] * 100);//价格0.01 $attach = 'pay_type=1'; //附加数据,pay_type=1充值支付,示例:xxx=1&yyy=2 - $notify_url = route('notify_wxpay_jsapi');//通知地址 - $wxconfig= \WxPayConfig::wxconfig(); - - //=========步骤1:网页授权获取用户openid============ - $jsApi = new \JsApi_pub($wxconfig); - $openid = $jsApi->getOpenid(); - //=========步骤2:使用统一支付接口,获取prepay_id============ - //使用统一支付接口 + $notify_url = route('notify_wxpay_jsapi');//通知地址 + $wxconfig = \WxPayConfig::wxconfig(); + + //=========步骤1:网页授权获取用户openid============ + $jsApi = new \JsApi_pub($wxconfig); + $openid = $jsApi->getOpenid(); + //=========步骤2:使用统一支付接口,获取prepay_id============ + //使用统一支付接口 $unifiedOrder = new \UnifiedOrder_pub($wxconfig); - //设置统一支付接口参数 - //设置必填参数 - //appid已填,商户无需重复填写 - //mch_id已填,商户无需重复填写 - //noncestr已填,商户无需重复填写 - //spbill_create_ip已填,商户无需重复填写 - //sign已填,商户无需重复填写 - $unifiedOrder->setParameter("openid","$openid");//微信用户 - $unifiedOrder->setParameter("body","$body");//商品描述 - $unifiedOrder->setParameter("out_trade_no","$out_trade_no");//商户订单号 - $unifiedOrder->setParameter("total_fee","$total_fee");//总金额 - $unifiedOrder->setParameter("attach","$attach"); //附加数据,选填,在查询API和支付通知中原样返回,可作为自定义参数使用,示例:a=1&b=2 - $unifiedOrder->setParameter("notify_url","$notify_url");//通知地址 - $unifiedOrder->setParameter("trade_type","JSAPI");//交易类型 - $prepay_id = $unifiedOrder->getPrepayId(); - //=========步骤3:使用jsapi调起支付============ - $jsApi->setPrepayId($prepay_id); - $jsApiParameters = $jsApi->getParameters(); - - $data['jsApiParameters'] = $jsApiParameters; + //设置统一支付接口参数 + //设置必填参数 + //appid已填,商户无需重复填写 + //mch_id已填,商户无需重复填写 + //noncestr已填,商户无需重复填写 + //spbill_create_ip已填,商户无需重复填写 + //sign已填,商户无需重复填写 + $unifiedOrder->setParameter("openid", "$openid");//微信用户 + $unifiedOrder->setParameter("body", "$body");//商品描述 + $unifiedOrder->setParameter("out_trade_no", "$out_trade_no");//商户订单号 + $unifiedOrder->setParameter("total_fee", "$total_fee");//总金额 + $unifiedOrder->setParameter("attach", "$attach"); //附加数据,选填,在查询API和支付通知中原样返回,可作为自定义参数使用,示例:a=1&b=2 + $unifiedOrder->setParameter("notify_url", "$notify_url");//通知地址 + $unifiedOrder->setParameter("trade_type", "JSAPI");//交易类型 + $prepay_id = $unifiedOrder->getPrepayId(); + //=========步骤3:使用jsapi调起支付============ + $jsApi->setPrepayId($prepay_id); + $jsApiParameters = $jsApi->getParameters(); + + $data['jsApiParameters'] = $jsApiParameters; $data['returnUrl'] = route('weixin_user_recharge_order'); //支付完成要跳转的url return view('weixin.user.userRechargeOrderDetail', $data); } - + //余额明细 public function userMoneyList(Request $request) - { + { $pagesize = 10; $offset = 0; - if(isset($_REQUEST['page'])){$offset = ($_REQUEST['page']-1)*$pagesize;} - + if (isset($_REQUEST['page'])) { + $offset = ($_REQUEST['page'] - 1) * $pagesize; + } + $postdata = array( - 'limit' => $pagesize, + 'limit' => $pagesize, 'offset' => $offset, 'access_token' => $_SESSION['weixin_user_info']['access_token'] - ); - $url = env('APP_API_URL')."/user_money_list"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/user_money_list"; + $res = curl_request($url, $postdata, 'GET'); $data['list'] = $res['data']['list']; - - $data['totalpage'] = ceil($res['data']['count']/$pagesize); - - if(isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax']==1) - { - $html = ''; - - if($res['data']['list']) - { - foreach($res['data']['list'] as $k => $v) - { + + $data['totalpage'] = ceil($res['data']['count'] / $pagesize); + + if (isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax'] == 1) { + $html = ''; + + if ($res['data']['list']) { + foreach ($res['data']['list'] as $k => $v) { $html .= '
  • '; - if($v['type']==0) - { - $html .= '+ '.$v['money'].''; - } - else - { - $html .= '- '.$v['money'].''; + if ($v['type'] == 0) { + $html .= '+ ' . $v['money'] . ''; + } else { + $html .= '- ' . $v['money'] . ''; } - $html .= '

    '.$v['des'].'

    '; - $html .= '

    '.date('Y-m-d H:i:s',$v['add_time']).'

    '; + $html .= '

    ' . $v['des'] . '

    '; + $html .= '

    ' . date('Y-m-d H:i:s', $v['add_time']) . '

    '; $html .= '
  • '; } } - - exit(json_encode($html)); - } - + + exit(json_encode($html)); + } + return view('weixin.user.userMoneyList', $data); } - + //积分明细 public function userPointList(Request $request) - { + { $pagesize = 10; $offset = 0; - if(isset($_REQUEST['page'])){$offset = ($_REQUEST['page']-1)*$pagesize;} - + if (isset($_REQUEST['page'])) { + $offset = ($_REQUEST['page'] - 1) * $pagesize; + } + $postdata = array( - 'limit' => $pagesize, + 'limit' => $pagesize, 'offset' => $offset, 'access_token' => $_SESSION['weixin_user_info']['access_token'] - ); - $url = env('APP_API_URL')."/user_point_list"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/user_point_list"; + $res = curl_request($url, $postdata, 'GET'); $data['list'] = $res['data']['list']; - - $data['totalpage'] = ceil($res['data']['count']/$pagesize); - - if(isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax']==1) - { - $html = ''; - - if($res['data']['list']) - { - foreach($res['data']['list'] as $k => $v) - { + + $data['totalpage'] = ceil($res['data']['count'] / $pagesize); + + if (isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax'] == 1) { + $html = ''; + + if ($res['data']['list']) { + foreach ($res['data']['list'] as $k => $v) { $html .= '
  • '; - if($v['type']==0) - { - $html .= '+ '.$v['point'].''; - } - else - { - $html .= '- '.$v['point'].''; + if ($v['type'] == 0) { + $html .= '+ ' . $v['point'] . ''; + } else { + $html .= '- ' . $v['point'] . ''; } - $html .= '

    '.$v['des'].'

    '; - $html .= '

    '.date('Y-m-d H:i:s',$v['add_time']).'

    '; + $html .= '

    ' . $v['des'] . '

    '; + $html .= '

    ' . date('Y-m-d H:i:s', $v['add_time']) . '

    '; $html .= '
  • '; } } - - exit(json_encode($html)); - } - + + exit(json_encode($html)); + } + return view('weixin.user.userPointList', $data); } - + //用户优惠券列表 public function userBonusList(Request $request) - { + { //商品列表 $pagesize = 10; $offset = 0; - if(isset($_REQUEST['page'])){$offset = ($_REQUEST['page']-1)*$pagesize;} - + if (isset($_REQUEST['page'])) { + $offset = ($_REQUEST['page'] - 1) * $pagesize; + } + $postdata = array( - 'limit' => $pagesize, + 'limit' => $pagesize, 'offset' => $offset, 'status' => 0, 'access_token' => $_SESSION['weixin_user_info']['access_token'] - ); - $url = env('APP_API_URL')."/user_bonus_list"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/user_bonus_list"; + $res = curl_request($url, $postdata, 'GET'); $data['list'] = $res['data']['list']; - - $data['totalpage'] = ceil($res['data']['count']/$pagesize); - - if(isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax']==1) - { - $html = ''; - - if($res['data']['list']) - { - foreach($res['data']['list'] as $k => $v) - { + + $data['totalpage'] = ceil($res['data']['count'] / $pagesize); + + if (isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax'] == 1) { + $html = ''; + + if ($res['data']['list']) { + foreach ($res['data']['list'] as $k => $v) { $html .= '
    '; - $html .= '

    '.$v['bonus']['name'].''.$v['bonus']['money'].'

    '; - $html .= '

    有效期至'.$v['bonus']['end_time'].' 满'.$v['bonus']['min_amount'].'可用

    '; + $html .= '

    ' . $v['bonus']['name'] . '' . $v['bonus']['money'] . '

    '; + $html .= '

    有效期至' . $v['bonus']['end_time'] . ' 满' . $v['bonus']['min_amount'] . '可用

    '; //$html .= '
    说明
    '; $html .= '
    '; - } + } } - - exit(json_encode($html)); - } - + + exit(json_encode($html)); + } + return view('weixin.user.userBonusList', $data); - } - + } + //用户消息 public function userMessageList(Request $request) - { + { $pagesize = 10; $offset = 0; - if(isset($_REQUEST['page'])){$offset = ($_REQUEST['page']-1)*$pagesize;} - + if (isset($_REQUEST['page'])) { + $offset = ($_REQUEST['page'] - 1) * $pagesize; + } + $postdata = array( - 'limit' => $pagesize, + 'limit' => $pagesize, 'offset' => $offset, 'access_token' => $_SESSION['weixin_user_info']['access_token'] - ); - $url = env('APP_API_URL')."/user_message_list"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/user_message_list"; + $res = curl_request($url, $postdata, 'GET'); $data['list'] = $res['data']['list']; - - $data['totalpage'] = ceil($res['data']['count']/$pagesize); - - if(isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax']==1) - { - $html = ''; - - if($res['data']['list']) - { - foreach($res['data']['list'] as $k => $v) - { + + $data['totalpage'] = ceil($res['data']['count'] / $pagesize); + + if (isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax'] == 1) { + $html = ''; + + if ($res['data']['list']) { + foreach ($res['data']['list'] as $k => $v) { $html .= '
  • '; - if($v['title']==0) - { - $html .= '

    '.$v['title'].'

    '; + if ($v['title'] == 0) { + $html .= '

    ' . $v['title'] . '

    '; } - - if($v['des']==0) - { - $html .= '

    '.$v['des'].'

    '; + + if ($v['des'] == 0) { + $html .= '

    ' . $v['des'] . '

    '; } - - $html .= '

    '.date('Y-m-d H:i:s',$v['add_time']).'

    '; + + $html .= '

    ' . date('Y-m-d H:i:s', $v['add_time']) . '

    '; $html .= '
  • '; } } - - exit(json_encode($html)); - } - + + exit(json_encode($html)); + } + return view('weixin.user.userMessageList', $data); } - + //浏览记录 public function userGoodsHistory(Request $request) - { + { //商品列表 $pagesize = 10; $offset = 0; - if(isset($_REQUEST['page'])){$offset = ($_REQUEST['page']-1)*$pagesize;} - + if (isset($_REQUEST['page'])) { + $offset = ($_REQUEST['page'] - 1) * $pagesize; + } + $postdata = array( - 'limit' => $pagesize, + 'limit' => $pagesize, 'offset' => $offset, 'access_token' => $_SESSION['weixin_user_info']['access_token'] - ); - $url = env('APP_API_URL')."/user_goods_history_list"; - $res = curl_request($url,$postdata,'GET'); + ); + $url = env('APP_API_URL') . "/user_goods_history_list"; + $res = curl_request($url, $postdata, 'GET'); $data['user_goods_history'] = $res['data']['list']; - - $data['totalpage'] = ceil($res['data']['count']/$pagesize); - - if(isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax']==1) - { - $html = ''; - - if($res['data']['list']) - { - foreach($res['data']['list'] as $k => $v) - { - $html .= '
  • '.$v['goods']['title'].''; - $html .= '

    '.$v['goods']['title'].'

    '; - $html .= '

    '.$v['goods']['price'].'

    '; - $html .= '

    删除

    '; + + $data['totalpage'] = ceil($res['data']['count'] / $pagesize); + + if (isset($_REQUEST['page_ajax']) && $_REQUEST['page_ajax'] == 1) { + $html = ''; + + if ($res['data']['list']) { + foreach ($res['data']['list'] as $k => $v) { + $html .= '
  • ' . $v['goods']['title'] . ''; + $html .= '

    ' . $v['goods']['title'] . '

    '; + $html .= '

    ' . $v['goods']['price'] . '

    '; + $html .= '

    删除

    '; $html .= '
  • '; } } - - exit(json_encode($html)); - } - + + exit(json_encode($html)); + } + return view('weixin.user.userGoodsHistory', $data); - } - + } + //浏览记录删除 public function userGoodsHistoryDelete(Request $request) - { - $id = $request->input('id',''); - - if($id == ''){$this->error_jump(ReturnData::PARAMS_ERROR);} - + { + $id = $request->input('id', ''); + + if ($id == '') { + $this->error_jump(ReturnData::PARAMS_ERROR); + } + $postdata = array( 'id' => $id, 'access_token' => $_SESSION['weixin_user_info']['access_token'] - ); - $url = env('APP_API_URL')."/user_goods_history_delete"; - $res = curl_request($url,$postdata,'POST'); - - if($res['code'] != ReturnData::SUCCESS){$this->error_jump(ReturnCode::FAIL);} - + ); + $url = env('APP_API_URL') . "/user_goods_history_delete"; + $res = curl_request($url, $postdata, 'POST'); + + if ($res['code'] != ReturnData::SUCCESS) { + $this->error_jump(ReturnCode::FAIL); + } + $this->success_jump(ReturnCode::SUCCESS); - } - + } + //浏览记录清空 public function userGoodsHistoryClear(Request $request) - { + { $postdata = array( 'access_token' => $_SESSION['weixin_user_info']['access_token'] - ); - $url = env('APP_API_URL')."/user_goods_history_clear"; - $res = curl_request($url,$postdata,'POST'); - - if($res['code'] != ReturnData::SUCCESS){$this->error_jump(ReturnCode::FAIL);} - + ); + $url = env('APP_API_URL') . "/user_goods_history_clear"; + $res = curl_request($url, $postdata, 'POST'); + + if ($res['code'] != ReturnData::SUCCESS) { + $this->error_jump(ReturnCode::FAIL); + } + $this->success_jump(ReturnCode::SUCCESS); - } - + } + //微信网页授权登录 public function oauth(Request $request) - { - if (!isset($_SESSION['weixin_oauth']['userinfo'])) - { - $wechat_auth = new WechatAuth(sysconfig('CMS_WX_APPID'),sysconfig('CMS_WX_APPSECRET')); - + { + if (!isset($_SESSION['weixin_oauth']['userinfo'])) { + $wechat_auth = new WechatAuth(sysconfig('CMS_WX_APPID'), sysconfig('CMS_WX_APPSECRET')); + // 获取code码,用于和微信服务器申请token。 注:依据OAuth2.0要求,此处授权登录需要用户端操作 - if(!isset($_GET['code'])) - { + if (!isset($_GET['code'])) { $http_type = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) ? 'https://' : 'http://'; $callback_url = $http_type . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; //回调地址,当前页面 //生成唯一随机串防CSRF攻击 $state = md5(uniqid(rand(), true)); $_SESSION['weixin_oauth']['state'] = $state; //存到SESSION $authorize_url = $wechat_auth->get_authorize_url($callback_url, $state); - - header("Location: $authorize_url");exit; + + header("Location: $authorize_url"); + exit; } - + // 依据code码去获取openid和access_token,自己的后台服务器直接向微信服务器申请即可 $_SESSION['weixin_oauth']['code'] = $_GET['code']; - - if($_GET['state'] != $_SESSION['weixin_oauth']['state']) - { + + if ($_GET['state'] != $_SESSION['weixin_oauth']['state']) { $this->error_jump('您访问的页面不存在或已被删除'); } - + //得到 access_token 与 openid $_SESSION['weixin_oauth']['token'] = $wechat_auth->get_access_token($_GET['code']); // 依据申请到的access_token和openid,申请Userinfo信息。 $_SESSION['weixin_oauth']['userinfo'] = $wechat_auth->get_user_info($_SESSION['weixin_oauth']['token']['access_token'], $_SESSION['weixin_oauth']['token']['openid']); } - - $postdata = array( + + $post_data = array( 'openid' => $_SESSION['weixin_oauth']['userinfo']['openid'], 'unionid' => isset($_SESSION['weixin_oauth']['userinfo']['unionid']) ? $_SESSION['weixin_oauth']['userinfo']['unionid'] : '', 'nickname' => $_SESSION['weixin_oauth']['userinfo']['nickname'], @@ -573,77 +569,95 @@ class UserController extends CommonController 'parent_mobile' => '', 'mobile' => '' ); - $url = env('APP_API_URL')."/wx_oauth_register"; - $res = curl_request($url,$postdata,'POST'); - if($res['code'] != ReturnData::SUCCESS){$this->error_jump('系统错误');} - + $url = env('APP_API_URL') . "/wx_oauth_register"; + $res = curl_request($url, $post_data, 'POST'); + if ($res['code'] != ReturnData::SUCCESS) { + $this->error_jump('系统错误'); + } + $_SESSION['weixin_user_info'] = $res['data']; - header('Location: '.route('weixin_user'));exit; - } - + header('Location: ' . route('weixin_user')); + exit; + } + //登录 public function login(Request $request) - { - if(isset($_SESSION['weixin_user_info'])) - { - if(isset($_SERVER["HTTP_REFERER"])){header('Location: '.$_SERVER["HTTP_REFERER"]);exit;} - header('Location: '.route('weixin_user'));exit; + { + if (isset($_SESSION['weixin_user_info'])) { + if (isset($_SERVER["HTTP_REFERER"])) { + header('Location: ' . $_SERVER["HTTP_REFERER"]); + exit; + } + header('Location: ' . route('weixin_user')); + exit; } - + $return_url = ''; - if(isset($_REQUEST['return_url']) && !empty($_REQUEST['return_url'])){$return_url = $_SESSION['weixin_history_back_url'] = $_REQUEST['return_url'];} - - if($_SERVER['REQUEST_METHOD'] == 'POST') - { - if($_POST['user_name'] == '') - { + if (isset($_REQUEST['return_url']) && !empty($_REQUEST['return_url'])) { + $return_url = $_SESSION['weixin_history_back_url'] = $_REQUEST['return_url']; + } + + if ($_SERVER['REQUEST_METHOD'] == 'POST') { + if ($_POST['user_name'] == '') { $this->error_jump('账号不能为空'); } - - if($_POST['password'] == '') - { + + if ($_POST['password'] == '') { $this->error_jump('密码不能为空'); } - + $postdata = array( 'user_name' => $_POST['user_name'], 'password' => md5($_POST['password']) ); - $url = env('APP_API_URL')."/wx_login"; - $res = curl_request($url,$postdata,'POST'); - - if($res['code'] != ReturnData::SUCCESS){$this->error_jump('登录失败');} - + $url = env('APP_API_URL') . "/wx_login"; + $res = curl_request($url, $postdata, 'POST'); + + if ($res['code'] != ReturnData::SUCCESS) { + $this->error_jump('登录失败'); + } + $_SESSION['weixin_user_info'] = $res['data']; - - if($return_url != ''){header('Location: '.$return_url);exit;} - header('Location: '.route('weixin_user'));exit; + + if ($return_url != '') { + header('Location: ' . $return_url); + exit; + } + header('Location: ' . route('weixin_user')); + exit; } - + return view('weixin.user.login'); - } - + } + //注册 public function register(Request $request) - { - if(isset($_SESSION['weixin_user_info'])) - { - if(isset($_SERVER["HTTP_REFERER"])){header('Location: '.$_SERVER["HTTP_REFERER"]);exit;} - header('Location: '.route('weixin_user'));exit; + { + if (isset($_SESSION['weixin_user_info'])) { + if (isset($_SERVER["HTTP_REFERER"])) { + header('Location: ' . $_SERVER["HTTP_REFERER"]); + exit; + } + header('Location: ' . route('weixin_user')); + exit; } - + $return_url = ''; - if(isset($_REQUEST['return_url']) && !empty($_REQUEST['return_url'])){$_SESSION['weixin_history_back_url'] = $_REQUEST['return_url'];} - if(isset($_REQUEST['invite_code']) && !empty($_REQUEST['invite_code'])){$_SESSION['weixin_user_invite_code'] = $_REQUEST['invite_code'];} //推荐人id存在session,首页入口也存了一次 - + if (isset($_REQUEST['return_url']) && !empty($_REQUEST['return_url'])) { + $_SESSION['weixin_history_back_url'] = $_REQUEST['return_url']; + } + if (isset($_REQUEST['invite_code']) && !empty($_REQUEST['invite_code'])) { + $_SESSION['weixin_user_invite_code'] = $_REQUEST['invite_code']; + } //推荐人id存在session,首页入口也存了一次 + return view('weixin.user.register'); - } - + } + public function logout(Request $request) - { + { session_unset(); session_destroy(); // 退出登录,清除session - - $this->success_jump('退出成功',route('weixin')); - } + + $this->success_jump('退出成功', route('weixin')); + } } \ No newline at end of file diff --git a/app/Http/Controllers/Weixin/WxPayController.php b/app/Http/Controllers/Weixin/WxPayController.php index dba9d61..ed1b77b 100644 --- a/app/Http/Controllers/Weixin/WxPayController.php +++ b/app/Http/Controllers/Weixin/WxPayController.php @@ -1,33 +1,34 @@ setParameter("mch_billno", date('YmdHis').rand(1000, 9999));//订单号 + $wxHongBaoHelper->setParameter("mch_billno", date('YmdHis') . rand(1000, 9999));//订单号 $wxHongBaoHelper->setParameter("send_name", '红包');//红包发送者名称 $wxHongBaoHelper->setParameter("re_openid", $re_openid);//接受openid - $wxHongBaoHelper->setParameter("total_amount", floatval($money*100));//付款金额,单位分 + $wxHongBaoHelper->setParameter("total_amount", floatval($money * 100));//付款金额,单位分 $wxHongBaoHelper->setParameter("total_num", 1);//红包収放总人数 $wxHongBaoHelper->setParameter("wishing", $wishing);//红包祝福 $wxHongBaoHelper->setParameter("client_ip", '127.0.0.1');//调用接口的机器 Ip 地址 @@ -36,9 +37,9 @@ class WxPayController extends CommonController $responseXml = $wxHongBaoHelper->postXmlSSL(); //用作结果调试输出 //echo htmlentities($responseXml,ENT_COMPAT,'UTF-8'); - $responseObj = simplexml_load_string($responseXml, 'SimpleXMLElement', LIBXML_NOCDATA); - return $responseObj->result_code; + $responseObj = simplexml_load_string($responseXml, 'SimpleXMLElement', LIBXML_NOCDATA); + return $responseObj->result_code; } - - + + } \ No newline at end of file diff --git a/app/Http/Logic/LogLogic.php b/app/Http/Logic/LogLogic.php new file mode 100644 index 0000000..7938247 --- /dev/null +++ b/app/Http/Logic/LogLogic.php @@ -0,0 +1,153 @@ +getSceneRules($scene_name), $validate->getSceneRulesMessages()); + } + + //列表 + public function getList($where = array(), $order = '', $field = '*', $offset = '', $limit = '') + { + $res = $this->getModel()->getList($where, $order, $field, $offset, $limit); + + if ($res['count'] > 0) { + foreach ($res['list'] as $k => $v) { + $res['list'][$k] = $this->getDataView($v); + } + } + + return $res; + } + + //分页html + public function getPaginate($where = array(), $order = '', $field = '*', $limit = '') + { + $res = $this->getModel()->getPaginate($where, $order, $field, $limit); + + if ($res->count() > 0) { + foreach ($res as $k => $v) { + $res[$k] = $this->getDataView($v); + } + } + + return $res; + } + + //全部列表 + public function getAll($where = array(), $order = '', $field = '*', $limit = '') + { + $res = $this->getModel()->getAll($where, $order, $field, $limit); + + if ($res) { + foreach ($res as $k => $v) { + $res[$k] = $this->getDataView($v); + } + } + + return $res; + } + + //详情 + public function getOne($where = array(), $field = '*') + { + $res = $this->getModel()->getOne($where, $field); + if (!$res) { + return false; + } + + $res = $this->getDataView($res); + + return $res; + } + + //添加 + public function add($data = array(), $type = 0) + { + if (empty($data)) { + return ReturnData::create(ReturnData::PARAMS_ERROR); + } + + $validator = $this->getValidate($data, 'add'); + if ($validator->fails()) { + return ReturnData::create(ReturnData::PARAMS_ERROR, null, $validator->errors()->first()); + } + + $res = $this->getModel()->add($data, $type); + if ($res) { + return ReturnData::create(ReturnData::SUCCESS, $res); + } + + return ReturnData::create(ReturnData::FAIL); + } + + //修改 + public function edit($data, $where = array()) + { + if (empty($data)) { + return ReturnData::create(ReturnData::SUCCESS); + } + + $validator = $this->getValidate($data, 'edit'); + if ($validator->fails()) { + return ReturnData::create(ReturnData::PARAMS_ERROR, null, $validator->errors()->first()); + } + + $res = $this->getModel()->edit($data, $where); + if ($res) { + return ReturnData::create(ReturnData::SUCCESS, $res); + } + + return ReturnData::create(ReturnData::FAIL); + } + + //删除 + public function del($where) + { + if (empty($where)) { + return ReturnData::create(ReturnData::PARAMS_ERROR); + } + + $validator = $this->getValidate($where, 'del'); + if ($validator->fails()) { + return ReturnData::create(ReturnData::PARAMS_ERROR, null, $validator->errors()->first()); + } + + $res = $this->getModel()->del($where); + if ($res) { + return ReturnData::create(ReturnData::SUCCESS, $res); + } + + return ReturnData::create(ReturnData::FAIL); + } + + /** + * 数据获取器 + * @param array $data 要转化的数据 + * @return array + */ + private function getDataView($data = array()) + { + return getDataAttr($this->getModel(), $data); + } +} \ No newline at end of file diff --git a/app/Http/Middleware/CheckLogin.php b/app/Http/Middleware/CheckLogin.php index bac1f0a..4c1fc88 100644 --- a/app/Http/Middleware/CheckLogin.php +++ b/app/Http/Middleware/CheckLogin.php @@ -1,4 +1,5 @@ has('admin_user_info')) - { - redirect()->route('admin_login'); - } - else - { - - } - + if (!session()->has('admin_info')) { + redirect()->route('admin_login'); + } else { + + } + return $next($request); } } diff --git a/app/Http/Middleware/Sign.php b/app/Http/Middleware/Sign.php index 3bb8686..50f64f4 100644 --- a/app/Http/Middleware/Sign.php +++ b/app/Http/Middleware/Sign.php @@ -1,4 +1,5 @@ header('app_key') ?: $request->input('app_key'); + $app_key = $request->header('app_key') ?: $request->input('app_key'); $app_time = $request->header('app_time') ?: $request->input('app_time'); - $sign = $request->header('sign') ?: $request->input('sign'); - - if (empty($app_key) || empty($app_time) || empty($sign)) - { + $sign = $request->header('sign') ?: $request->input('sign'); + + if (empty($app_key) || empty($app_time) || empty($sign)) { return ReturnData::create(ReturnData::FORBIDDEN); } - if (!Token::checkSign($app_key, $app_time, $sign)) - { + if (!Token::checkSign($app_key, $app_time, $sign)) { return ReturnData::create(ReturnData::SIGN_ERROR); } - + return $next($request); } } \ No newline at end of file diff --git a/app/Http/Middleware/WxLogin.php b/app/Http/Middleware/WxLogin.php index 5c407a8..26fcd48 100644 --- a/app/Http/Middleware/WxLogin.php +++ b/app/Http/Middleware/WxLogin.php @@ -1,4 +1,5 @@ getDb(); if($where){$model = $model->where($where);} @@ -39,7 +39,7 @@ class Access extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -56,14 +56,14 @@ class Access extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/Admin.php b/app/Http/Model/Admin.php index 95317d2..5ef5983 100644 --- a/app/Http/Model/Admin.php +++ b/app/Http/Model/Admin.php @@ -26,7 +26,7 @@ class Admin extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -39,7 +39,7 @@ class Admin extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -56,14 +56,14 @@ class Admin extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/AdminRole.php b/app/Http/Model/AdminRole.php index a4e717b..5922a2b 100644 --- a/app/Http/Model/AdminRole.php +++ b/app/Http/Model/AdminRole.php @@ -26,7 +26,7 @@ class AdminRole extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -39,7 +39,7 @@ class AdminRole extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -56,14 +56,14 @@ class AdminRole extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/Arctype.php b/app/Http/Model/Arctype.php index dbb5670..fb934c9 100644 --- a/app/Http/Model/Arctype.php +++ b/app/Http/Model/Arctype.php @@ -46,7 +46,7 @@ class Arctype extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -59,7 +59,7 @@ class Arctype extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -76,14 +76,14 @@ class Arctype extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/Article.php b/app/Http/Model/Article.php index 1bdd3d2..cbb3fd9 100644 --- a/app/Http/Model/Article.php +++ b/app/Http/Model/Article.php @@ -62,7 +62,7 @@ class Article extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -75,7 +75,7 @@ class Article extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -92,14 +92,14 @@ class Article extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/Bonus.php b/app/Http/Model/Bonus.php index 6c78f52..6599fed 100644 --- a/app/Http/Model/Bonus.php +++ b/app/Http/Model/Bonus.php @@ -28,7 +28,7 @@ class Bonus extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -41,7 +41,7 @@ class Bonus extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -58,14 +58,14 @@ class Bonus extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/Cart.php b/app/Http/Model/Cart.php index 6f2b111..6c40755 100644 --- a/app/Http/Model/Cart.php +++ b/app/Http/Model/Cart.php @@ -38,7 +38,7 @@ class Cart extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -51,7 +51,7 @@ class Cart extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -68,14 +68,14 @@ class Cart extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/CollectGoods.php b/app/Http/Model/CollectGoods.php index eeb2017..4b94079 100644 --- a/app/Http/Model/CollectGoods.php +++ b/app/Http/Model/CollectGoods.php @@ -26,7 +26,7 @@ class CollectGoods extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -39,7 +39,7 @@ class CollectGoods extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -56,14 +56,14 @@ class CollectGoods extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/Comment.php b/app/Http/Model/Comment.php index 7542d5a..6fbca77 100644 --- a/app/Http/Model/Comment.php +++ b/app/Http/Model/Comment.php @@ -31,7 +31,7 @@ class Comment extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -44,7 +44,7 @@ class Comment extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -61,14 +61,14 @@ class Comment extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/FeedBack.php b/app/Http/Model/FeedBack.php index 079e402..d6db259 100644 --- a/app/Http/Model/FeedBack.php +++ b/app/Http/Model/FeedBack.php @@ -26,7 +26,7 @@ class FeedBack extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -39,7 +39,7 @@ class FeedBack extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -56,14 +56,14 @@ class FeedBack extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/Friendlink.php b/app/Http/Model/Friendlink.php index ceffa3b..df09e29 100644 --- a/app/Http/Model/Friendlink.php +++ b/app/Http/Model/Friendlink.php @@ -26,7 +26,7 @@ class Friendlink extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -39,7 +39,7 @@ class Friendlink extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -56,14 +56,14 @@ class Friendlink extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/Goods.php b/app/Http/Model/Goods.php index c51a95c..bbcb0ce 100644 --- a/app/Http/Model/Goods.php +++ b/app/Http/Model/Goods.php @@ -62,7 +62,7 @@ class Goods extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -75,7 +75,7 @@ class Goods extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -92,14 +92,14 @@ class Goods extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/GoodsBrand.php b/app/Http/Model/GoodsBrand.php index 11719b6..51b59b6 100644 --- a/app/Http/Model/GoodsBrand.php +++ b/app/Http/Model/GoodsBrand.php @@ -29,7 +29,7 @@ class GoodsBrand extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -42,7 +42,7 @@ class GoodsBrand extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -59,14 +59,14 @@ class GoodsBrand extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/GoodsImg.php b/app/Http/Model/GoodsImg.php index 7f40729..b56942c 100644 --- a/app/Http/Model/GoodsImg.php +++ b/app/Http/Model/GoodsImg.php @@ -26,7 +26,7 @@ class GoodsImg extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -39,7 +39,7 @@ class GoodsImg extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -56,14 +56,14 @@ class GoodsImg extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/GoodsSearchword.php b/app/Http/Model/GoodsSearchword.php index 85fc04c..6af583c 100644 --- a/app/Http/Model/GoodsSearchword.php +++ b/app/Http/Model/GoodsSearchword.php @@ -26,7 +26,7 @@ class GoodsSearchword extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -39,7 +39,7 @@ class GoodsSearchword extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -56,14 +56,14 @@ class GoodsSearchword extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/GoodsType.php b/app/Http/Model/GoodsType.php index 577002f..e57336f 100644 --- a/app/Http/Model/GoodsType.php +++ b/app/Http/Model/GoodsType.php @@ -41,7 +41,7 @@ class GoodsType extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -54,7 +54,7 @@ class GoodsType extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -71,14 +71,14 @@ class GoodsType extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/Guestbook.php b/app/Http/Model/Guestbook.php index f673567..3dd782c 100644 --- a/app/Http/Model/Guestbook.php +++ b/app/Http/Model/Guestbook.php @@ -26,7 +26,7 @@ class Guestbook extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -39,7 +39,7 @@ class Guestbook extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -56,14 +56,14 @@ class Guestbook extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/Jobs.php b/app/Http/Model/Jobs.php new file mode 100644 index 0000000..4e56db5 --- /dev/null +++ b/app/Http/Model/Jobs.php @@ -0,0 +1,164 @@ +table); + } + + /** + * 列表 + * @param array $where 查询条件 + * @param string $order 排序 + * @param string $field 字段 + * @param int $offset 偏移量 + * @param int $limit 取多少条 + * @return array + */ + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) + { + $model = $this->getDb(); + if($where){$model = $model->where($where);} + + $res['count'] = $model->count(); + $res['list'] = array(); + + if($res['count'] > 0) + { + if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} + if($order){$model = parent::getOrderByData($model, $order);} + if($offset){}else{$offset = 0;} + if($limit){}else{$limit = 15;} + + $res['list'] = $model->skip($offset)->take($limit)->get(); + } + + return $res; + } + + /** + * 分页,用于前端html输出 + * @param array $where 查询条件 + * @param string $order 排序 + * @param string $field 字段 + * @param int $limit 每页几条 + * @param int $page 当前第几页 + * @return array + */ + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) + { + $res = $this->getDb(); + + if($where){$res = $res->where($where);} + if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} + if($order){$res = parent::getOrderByData($res, $order);} + if($limit){}else{$limit = 15;} + + return $res->paginate($limit); + } + + /** + * 查询全部 + * @param array $where 查询条件 + * @param string $order 排序 + * @param string $field 字段 + * @param int $limit 取多少条 + * @return array + */ + public function getAll($where = array(), $order = '', $field = '*', $limit = '', $offset = '') + { + $res = $this->getDb(); + + if($where){$res = $res->where($where);} + if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} + if($order){$res = parent::getOrderByData($res, $order);} + if($offset){$res = $res->skip($offset);} + if($limit){$res = $res->take($limit);} + + $res = $res->get(); + + return $res; + } + + /** + * 获取一条 + * @param array $where 条件 + * @param string $field 字段 + * @return array + */ + public function getOne($where, $field = '*') + { + $res = $this->getDb(); + + if($where){$res = $res->where($where);} + if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} + + $res = $res->first(); + + return $res; + } + + /** + * 添加 + * @param array $data 数据 + * @return int + */ + public function add(array $data,$type = 0) + { + if($type==0) + { + // 新增单条数据并返回主键值 + return self::insertGetId(parent::filterTableColumn($data,$this->table)); + } + elseif($type==1) + { + /** + * 添加单条数据 + * $data = ['foo' => 'bar', 'bar' => 'foo']; + * 添加多条数据 + * $data = [ + * ['foo' => 'bar', 'bar' => 'foo'], + * ['foo' => 'bar1', 'bar' => 'foo1'], + * ['foo' => 'bar2', 'bar' => 'foo2'] + * ]; + */ + return self::insert($data); + } + } + + /** + * 修改 + * @param array $data 数据 + * @param array $where 条件 + * @return int + */ + public function edit($data, $where = array()) + { + $res = $this->getDb(); + return $res->where($where)->update(parent::filterTableColumn($data, $this->table)); + } + + /** + * 删除 + * @param array $where 条件 + * @return bool + */ + public function del($where) + { + $res = $this->getDb(); + $res = $res->where($where)->delete(); + + return $res; + } +} \ No newline at end of file diff --git a/app/Http/Model/Keyword.php b/app/Http/Model/Keyword.php index c23f10a..43a342d 100644 --- a/app/Http/Model/Keyword.php +++ b/app/Http/Model/Keyword.php @@ -26,7 +26,7 @@ class Keyword extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -39,7 +39,7 @@ class Keyword extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -56,14 +56,14 @@ class Keyword extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/Kuaidi.php b/app/Http/Model/Kuaidi.php index dc790b1..b83bb22 100644 --- a/app/Http/Model/Kuaidi.php +++ b/app/Http/Model/Kuaidi.php @@ -26,7 +26,7 @@ class Kuaidi extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -39,7 +39,7 @@ class Kuaidi extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -56,14 +56,14 @@ class Kuaidi extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/Log.php b/app/Http/Model/Log.php new file mode 100644 index 0000000..e088490 --- /dev/null +++ b/app/Http/Model/Log.php @@ -0,0 +1,223 @@ +table); + } + + /** + * 列表 + * @param array $where 查询条件 + * @param string $order 排序 + * @param string $field 字段 + * @param int $offset 偏移量 + * @param int $limit 取多少条 + * @return array + */ + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) + { + $model = $this->getDb(); + if ($where) { + $model = $model->where($where); + } + + $res['count'] = $model->count(); + $res['list'] = array(); + + if ($res['count'] > 0) { + if ($field) { + if (is_array($field)) { + $model = $model->select($field); + } else { + $model = $model->select(\DB::raw($field)); + } + } + if ($order) { + $model = parent::getOrderByData($model, $order); + } + if ($offset) { + } else { + $offset = 0; + } + if ($limit) { + } else { + $limit = 15; + } + + $res['list'] = $model->skip($offset)->take($limit)->get(); + } + + return $res; + } + + /** + * 分页,用于前端html输出 + * @param array $where 查询条件 + * @param string $order 排序 + * @param string $field 字段 + * @param int $limit 每页几条 + * @param int $page 当前第几页 + * @return array + */ + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) + { + $res = $this->getDb(); + + if ($where) { + $res = $res->where($where); + } + if ($field) { + if (is_array($field)) { + $res = $res->select($field); + } else { + $res = $res->select(\DB::raw($field)); + } + } + if ($order) { + $res = parent::getOrderByData($res, $order); + } + if ($limit) { + } else { + $limit = 15; + } + + return $res->paginate($limit); + } + + /** + * 查询全部 + * @param array $where 查询条件 + * @param string $order 排序 + * @param string $field 字段 + * @param int $limit 取多少条 + * @return array + */ + public function getAll($where = array(), $order = '', $field = '*', $limit = '', $offset = '') + { + $res = $this->getDb(); + + if ($where) { + $res = $res->where($where); + } + if ($field) { + if (is_array($field)) { + $res = $res->select($field); + } else { + $res = $res->select(\DB::raw($field)); + } + } + if ($order) { + $res = parent::getOrderByData($res, $order); + } + if ($offset) { + $res = $res->skip($offset); + } + if ($limit) { + $res = $res->take($limit); + } + + $res = $res->get(); + + return $res; + } + + /** + * 获取一条 + * @param array $where 条件 + * @param string $field 字段 + * @return array + */ + public function getOne($where, $field = '*') + { + $res = $this->getDb(); + + if ($where) { + $res = $res->where($where); + } + if ($field) { + if (is_array($field)) { + $res = $res->select($field); + } else { + $res = $res->select(\DB::raw($field)); + } + } + + $res = $res->first(); + + return $res; + } + + /** + * 添加 + * @param array $data 数据 + * @return int + */ + public function add(array $data, $type = 0) + { + if ($type == 0) { + // 新增单条数据并返回主键值 + return self::insertGetId(parent::filterTableColumn($data, $this->table)); + } elseif ($type == 1) { + /** + * 添加单条数据 + * $data = ['foo' => 'bar', 'bar' => 'foo']; + * 添加多条数据 + * $data = [ + * ['foo' => 'bar', 'bar' => 'foo'], + * ['foo' => 'bar1', 'bar' => 'foo1'], + * ['foo' => 'bar2', 'bar' => 'foo2'] + * ]; + */ + return self::insert($data); + } + } + + /** + * 修改 + * @param array $data 数据 + * @param array $where 条件 + * @return int + */ + public function edit($data, $where = array()) + { + $res = $this->getDb(); + return $res->where($where)->update(parent::filterTableColumn($data, $this->table)); + } + + /** + * 删除 + * @param array $where 条件 + * @return bool + */ + public function del($where) + { + $res = $this->getDb(); + $res = $res->where($where)->delete(); + + return $res; + } + + /** + * 获取器——类型:默认0未知,1fladmin,2index,3api + * @param int $value + * @return string + */ + public function getTypeAttr($data) + { + $arr = array(0 => '未知', 1 => 'fladmin', 2 => 'index', 3 => 'api', 4 => 'wap', 5 => 'weixin', 6 => 'shop'); + return $arr[$data->type]; + } +} \ No newline at end of file diff --git a/app/Http/Model/Menu.php b/app/Http/Model/Menu.php index ba3ab2d..562515e 100644 --- a/app/Http/Model/Menu.php +++ b/app/Http/Model/Menu.php @@ -1,20 +1,22 @@ table); } - + /** * 列表 * @param array $where 查询条件 @@ -24,27 +26,42 @@ class Menu extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); - if($where){$model = $model->where($where);} - + if ($where) { + $model = $model->where($where); + } + $res['count'] = $model->count(); $res['list'] = array(); - - if($res['count'] > 0) - { - if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} - if($order){$model = parent::getOrderByData($model, $order);} - if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} - + + if ($res['count'] > 0) { + if ($field) { + if (is_array($field)) { + $model = $model->select($field); + } else { + $model = $model->select(\DB::raw($field)); + } + } + if ($order) { + $model = parent::getOrderByData($model, $order); + } + if ($offset) { + } else { + $offset = 0; + } + if ($limit) { + } else { + $limit = 15; + } + $res['list'] = $model->skip($offset)->take($limit)->get(); } - + return $res; } - + /** * 分页,用于前端html输出 * @param array $where 查询条件 @@ -54,18 +71,31 @@ class Menu extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); - - if($where){$res = $res->where($where);} - if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} - if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} - + + if ($where) { + $res = $res->where($where); + } + if ($field) { + if (is_array($field)) { + $res = $res->select($field); + } else { + $res = $res->select(\DB::raw($field)); + } + } + if ($order) { + $res = parent::getOrderByData($res, $order); + } + if ($limit) { + } else { + $limit = 15; + } + return $res->paginate($limit); } - + /** * 查询全部 * @param array $where 查询条件 @@ -77,18 +107,32 @@ class Menu extends BaseModel public function getAll($where = array(), $order = '', $field = '*', $limit = '', $offset = '') { $res = $this->getDb(); - - if($where){$res = $res->where($where);} - if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} - if($order){$res = parent::getOrderByData($res, $order);} - if($offset){$res = $res->skip($offset);} - if($limit){$res = $res->take($limit);} - + + if ($where) { + $res = $res->where($where); + } + if ($field) { + if (is_array($field)) { + $res = $res->select($field); + } else { + $res = $res->select(\DB::raw($field)); + } + } + if ($order) { + $res = parent::getOrderByData($res, $order); + } + if ($offset) { + $res = $res->skip($offset); + } + if ($limit) { + $res = $res->take($limit); + } + $res = $res->get(); - + return $res; } - + /** * 获取一条 * @param array $where 条件 @@ -98,29 +142,34 @@ class Menu extends BaseModel public function getOne($where, $field = '*') { $res = $this->getDb(); - - if($where){$res = $res->where($where);} - if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} - + + if ($where) { + $res = $res->where($where); + } + if ($field) { + if (is_array($field)) { + $res = $res->select($field); + } else { + $res = $res->select(\DB::raw($field)); + } + } + $res = $res->first(); - + return $res; } - + /** * 添加 * @param array $data 数据 * @return int */ - public function add(array $data,$type = 0) + public function add(array $data, $type = 0) { - if($type==0) - { + if ($type == 0) { // 新增单条数据并返回主键值 - return self::insertGetId(parent::filterTableColumn($data,$this->table)); - } - elseif($type==1) - { + return self::insertGetId(parent::filterTableColumn($data, $this->table)); + } elseif ($type == 1) { /** * 添加单条数据 * $data = ['foo' => 'bar', 'bar' => 'foo']; @@ -134,7 +183,7 @@ class Menu extends BaseModel return self::insert($data); } } - + /** * 修改 * @param array $data 数据 @@ -146,7 +195,7 @@ class Menu extends BaseModel $res = $this->getDb(); return $res->where($where)->update(parent::filterTableColumn($data, $this->table)); } - + /** * 删除 * @param array $where 条件 @@ -156,41 +205,38 @@ class Menu extends BaseModel { $res = $this->getDb(); $res = $res->where($where)->delete(); - + return $res; } - - //获取后台管理员所具有权限的菜单列表 - public static function getPermissionsMenu($role_id, $pid=0, $pad=0) - { - $res = []; - - $where['access.role_id'] = $role_id; - $where['menu.pid'] = $pid; - $where["menu.status"] = 1; - - $menu = object_to_array(\DB::table('menu') + + //获取后台管理员所具有权限的菜单列表 + public static function getPermissionsMenu($role_id, $pid = 0, $pad = 0) + { + $res = []; + + $where['access.role_id'] = $role_id; + $where['menu.pid'] = $pid; + $where["menu.status"] = 1; + + $menu = object_to_array(DB::table('menu') ->join('access', 'access.menu_id', '=', 'menu.id') ->select('menu.*', 'access.role_id') - ->where($where) - ->orderBy('listorder', 'asc') + ->where($where) + ->orderBy('listorder', 'asc') ->get()); - - if($menu) - { - foreach($menu as $row) - { - $row['deep'] = $pad; - - if($PermissionsMenu = self::getPermissionsMenu($role_id, $row['id'], $pad+1)) - { - $row['child'] = $PermissionsMenu; - } - - $res[] = $row; - } - } - - return $res; - } + + if ($menu) { + foreach ($menu as $row) { + $row['deep'] = $pad; + + if ($permissions_menu = self::getPermissionsMenu($role_id, $row['id'], $pad + 1)) { + $row['child'] = $permissions_menu; + } + + $res[] = $row; + } + } + + return $res; + } } \ No newline at end of file diff --git a/app/Http/Model/Order.php b/app/Http/Model/Order.php index a5cdebd..cd31136 100644 --- a/app/Http/Model/Order.php +++ b/app/Http/Model/Order.php @@ -29,7 +29,7 @@ class Order extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -42,7 +42,7 @@ class Order extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -59,14 +59,14 @@ class Order extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/OrderGoods.php b/app/Http/Model/OrderGoods.php index aed4ad4..eb1ca33 100644 --- a/app/Http/Model/OrderGoods.php +++ b/app/Http/Model/OrderGoods.php @@ -26,7 +26,7 @@ class OrderGoods extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -39,7 +39,7 @@ class OrderGoods extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -56,14 +56,14 @@ class OrderGoods extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/Page.php b/app/Http/Model/Page.php index 1b1488a..ccb1153 100644 --- a/app/Http/Model/Page.php +++ b/app/Http/Model/Page.php @@ -26,7 +26,7 @@ class Page extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -39,7 +39,7 @@ class Page extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -56,14 +56,14 @@ class Page extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/Payment.php b/app/Http/Model/Payment.php index 0158324..2db18e9 100644 --- a/app/Http/Model/Payment.php +++ b/app/Http/Model/Payment.php @@ -28,7 +28,7 @@ class Payment extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -41,7 +41,7 @@ class Payment extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -58,14 +58,14 @@ class Payment extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/Region.php b/app/Http/Model/Region.php index 79ba90e..3a852e7 100644 --- a/app/Http/Model/Region.php +++ b/app/Http/Model/Region.php @@ -26,7 +26,7 @@ class Region extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -39,7 +39,7 @@ class Region extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -56,14 +56,14 @@ class Region extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/Searchword.php b/app/Http/Model/Searchword.php index d0bce48..5a5f779 100644 --- a/app/Http/Model/Searchword.php +++ b/app/Http/Model/Searchword.php @@ -26,7 +26,7 @@ class Searchword extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -39,7 +39,7 @@ class Searchword extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -56,14 +56,14 @@ class Searchword extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/Slide.php b/app/Http/Model/Slide.php index 38ede30..116036b 100644 --- a/app/Http/Model/Slide.php +++ b/app/Http/Model/Slide.php @@ -28,7 +28,7 @@ class Slide extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -41,7 +41,7 @@ class Slide extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -58,14 +58,14 @@ class Slide extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/SmsLog.php b/app/Http/Model/SmsLog.php index fd63e25..4be9f1e 100644 --- a/app/Http/Model/SmsLog.php +++ b/app/Http/Model/SmsLog.php @@ -48,7 +48,7 @@ class SmsLog extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -61,7 +61,7 @@ class SmsLog extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -78,14 +78,14 @@ class SmsLog extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/Sysconfig.php b/app/Http/Model/Sysconfig.php index 3267849..b7b63ca 100644 --- a/app/Http/Model/Sysconfig.php +++ b/app/Http/Model/Sysconfig.php @@ -26,7 +26,7 @@ class Sysconfig extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -39,7 +39,7 @@ class Sysconfig extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -56,14 +56,14 @@ class Sysconfig extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/Tagindex.php b/app/Http/Model/Tagindex.php index 4fa3cbd..9163b67 100644 --- a/app/Http/Model/Tagindex.php +++ b/app/Http/Model/Tagindex.php @@ -26,7 +26,7 @@ class Tagindex extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -39,7 +39,7 @@ class Tagindex extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -56,14 +56,14 @@ class Tagindex extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/Taglist.php b/app/Http/Model/Taglist.php index 385a8a0..b23fa7e 100644 --- a/app/Http/Model/Taglist.php +++ b/app/Http/Model/Taglist.php @@ -24,7 +24,7 @@ class Taglist extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -37,7 +37,7 @@ class Taglist extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -54,14 +54,14 @@ class Taglist extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/User.php b/app/Http/Model/User.php index 888796b..e8579d8 100644 --- a/app/Http/Model/User.php +++ b/app/Http/Model/User.php @@ -28,7 +28,7 @@ class User extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -41,7 +41,7 @@ class User extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -58,14 +58,14 @@ class User extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/UserAddress.php b/app/Http/Model/UserAddress.php index 450f017..c7da5e9 100644 --- a/app/Http/Model/UserAddress.php +++ b/app/Http/Model/UserAddress.php @@ -28,7 +28,7 @@ class UserAddress extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -41,7 +41,7 @@ class UserAddress extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -58,14 +58,14 @@ class UserAddress extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/UserBonus.php b/app/Http/Model/UserBonus.php index df5c63c..0dc4e38 100644 --- a/app/Http/Model/UserBonus.php +++ b/app/Http/Model/UserBonus.php @@ -26,7 +26,7 @@ class UserBonus extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -39,7 +39,7 @@ class UserBonus extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -56,14 +56,14 @@ class UserBonus extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/UserGoodsHistory.php b/app/Http/Model/UserGoodsHistory.php index 59db60e..188d314 100644 --- a/app/Http/Model/UserGoodsHistory.php +++ b/app/Http/Model/UserGoodsHistory.php @@ -26,7 +26,7 @@ class UserGoodsHistory extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -39,7 +39,7 @@ class UserGoodsHistory extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -56,14 +56,14 @@ class UserGoodsHistory extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/UserMessage.php b/app/Http/Model/UserMessage.php index fe7c7ff..982214c 100644 --- a/app/Http/Model/UserMessage.php +++ b/app/Http/Model/UserMessage.php @@ -26,7 +26,7 @@ class UserMessage extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -39,7 +39,7 @@ class UserMessage extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -56,14 +56,14 @@ class UserMessage extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/UserMoney.php b/app/Http/Model/UserMoney.php index 83bb658..e187970 100644 --- a/app/Http/Model/UserMoney.php +++ b/app/Http/Model/UserMoney.php @@ -29,7 +29,7 @@ class UserMoney extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -42,7 +42,7 @@ class UserMoney extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -59,14 +59,14 @@ class UserMoney extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/UserPoint.php b/app/Http/Model/UserPoint.php index ca16c1d..17b083c 100644 --- a/app/Http/Model/UserPoint.php +++ b/app/Http/Model/UserPoint.php @@ -29,7 +29,7 @@ class UserPoint extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -42,7 +42,7 @@ class UserPoint extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -59,14 +59,14 @@ class UserPoint extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/UserRecharge.php b/app/Http/Model/UserRecharge.php index 7c0f2b7..1ef84ef 100644 --- a/app/Http/Model/UserRecharge.php +++ b/app/Http/Model/UserRecharge.php @@ -30,7 +30,7 @@ class UserRecharge extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -43,7 +43,7 @@ class UserRecharge extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -60,14 +60,14 @@ class UserRecharge extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/UserRole.php b/app/Http/Model/UserRole.php index c7f52dc..e8ce0af 100644 --- a/app/Http/Model/UserRole.php +++ b/app/Http/Model/UserRole.php @@ -26,7 +26,7 @@ class UserRole extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -39,7 +39,7 @@ class UserRole extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -56,14 +56,14 @@ class UserRole extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/UserWithdraw.php b/app/Http/Model/UserWithdraw.php index 90ba14d..4771b54 100644 --- a/app/Http/Model/UserWithdraw.php +++ b/app/Http/Model/UserWithdraw.php @@ -29,7 +29,7 @@ class UserWithdraw extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -42,7 +42,7 @@ class UserWithdraw extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -59,14 +59,14 @@ class UserWithdraw extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/VerifyCode.php b/app/Http/Model/VerifyCode.php index d66b2b5..4635644 100644 --- a/app/Http/Model/VerifyCode.php +++ b/app/Http/Model/VerifyCode.php @@ -39,7 +39,7 @@ class VerifyCode extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -52,7 +52,7 @@ class VerifyCode extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -69,14 +69,14 @@ class VerifyCode extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Model/WeixinMenu.php b/app/Http/Model/WeixinMenu.php index 40d143c..7230fc1 100644 --- a/app/Http/Model/WeixinMenu.php +++ b/app/Http/Model/WeixinMenu.php @@ -32,7 +32,7 @@ class WeixinMenu extends BaseModel * @param int $limit 取多少条 * @return array */ - public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 10) + public function getList($where = array(), $order = '', $field = '*', $offset = 0, $limit = 15) { $model = $this->getDb(); if($where){$model = $model->where($where);} @@ -45,7 +45,7 @@ class WeixinMenu extends BaseModel if($field){if(is_array($field)){$model = $model->select($field);}else{$model = $model->select(\DB::raw($field));}} if($order){$model = parent::getOrderByData($model, $order);} if($offset){}else{$offset = 0;} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} $res['list'] = $model->skip($offset)->take($limit)->get(); } @@ -62,14 +62,14 @@ class WeixinMenu extends BaseModel * @param int $page 当前第几页 * @return array */ - public function getPaginate($where = array(), $order = '', $field = '*', $limit = 10) + public function getPaginate($where = array(), $order = '', $field = '*', $limit = 15) { $res = $this->getDb(); if($where){$res = $res->where($where);} if($field){if(is_array($field)){$res = $res->select($field);}else{$res = $res->select(\DB::raw($field));}} if($order){$res = parent::getOrderByData($res, $order);} - if($limit){}else{$limit = 10;} + if($limit){}else{$limit = 15;} return $res->paginate($limit); } diff --git a/app/Http/Requests/AdminRequest.php b/app/Http/Requests/AdminRequest.php index ce3a986..873ae07 100644 --- a/app/Http/Requests/AdminRequest.php +++ b/app/Http/Requests/AdminRequest.php @@ -6,9 +6,9 @@ class AdminRequest extends BaseRequest //总的验证规则 protected $rules = [ 'id' => 'required|integer', - 'username' => 'required|max:30', + 'name' => 'required|max:30', 'email' => 'required|max:30', - 'logintime' => 'integer', + 'login_time' => 'integer', 'pwd' => 'required|max:32', 'role_id' => 'required|integer', 'status' => 'integer|between:0,3', @@ -21,11 +21,11 @@ class AdminRequest extends BaseRequest protected $messages = [ 'id.required' => 'ID必填', 'id.integer' => 'ID必须为数字', - 'username.required' => '用户名必填', - 'username.max' => '用户名不能超过30个字符', + 'name.required' => '用户名必填', + 'name.max' => '用户名不能超过30个字符', 'email.required' => '邮箱必填', 'email.max' => '邮箱不能超过30个字符', - 'logintime.integer' => '登录时间必须是数字', + 'login_time.integer' => '登录时间必须是数字', 'pwd.required' => '密码必填', 'pwd.max' => '密码不能超过32个字符', 'role_id.required' => '角色ID必填', @@ -40,8 +40,8 @@ class AdminRequest extends BaseRequest //场景验证规则 protected $scene = [ - 'add' => ['username', 'email', 'logintime', 'pwd', 'role_id', 'status', 'mobile', 'avatar'], - 'edit' => ['username', 'email', 'logintime', 'pwd', 'role_id', 'status', 'mobile', 'avatar'], + 'add' => ['name', 'email', 'login_time', 'pwd', 'role_id', 'status', 'mobile', 'avatar'], + 'edit' => ['name', 'email', 'login_time', 'pwd', 'role_id', 'status', 'mobile', 'avatar'], 'del' => ['id'], ]; diff --git a/app/Http/Requests/LogRequest.php b/app/Http/Requests/LogRequest.php new file mode 100644 index 0000000..fde714d --- /dev/null +++ b/app/Http/Requests/LogRequest.php @@ -0,0 +1,108 @@ + 'required|integer', + 'ip' => 'required|max:15|ip', + 'content' => 'max:250', + 'login_name' => 'max:30', + 'login_id' => 'integer', + 'url' => 'required|max:255', + 'domain_name' => 'max:60', + 'http_referer' => 'max:255', + 'http_method' => 'required|max:10', + 'add_time' => 'required|integer', + ]; + + //总的自定义错误信息 + protected $messages = [ + 'id.required' => 'ID不能为空', + 'id.integer' => 'ID必须是数字', + 'ip.required' => 'IP不能为空', + 'ip.max' => 'IP不能超过15个字符', + 'ip.ip' => 'IP格式不正确', + 'content.max' => '操作内容不能超过255个字符', + 'login_name.required' => '登录名称不能为空', + 'login_name.max' => '登录名称不能超过30个字符', + 'login_id.required' => '登录ID不能为空', + 'login_id.integer' => '登录ID必须是数字', + 'url.required' => 'URL不能为空', + 'url.max' => 'URL不能超过255个字符', + 'domain_name.max' => '域名不能超过60个字符', + 'http_referer.max' => '上一个页面URL不能超过250个字符', + 'http_method.required' => '请求方式不能为空', + 'http_method.max' => '请求方式不能超过10个字符', + 'add_time.required' => '添加时间不能为空', + 'add_time.integer' => '添加时间格式不正确', + ]; + + //场景验证规则 + protected $scene = [ + 'add' => ['ip', 'content', 'login_name', 'login_id', 'route', 'http_method', 'add_time'], + 'edit' => ['ip', 'content', 'login_name', 'login_id', 'route', 'http_method', 'add_time'], + 'del' => ['id'], + ]; + + /** + * Determine if the user is authorized to make this request. + * + * @return bool + */ + public function authorize() + { + return true; //修改为true + } + + /** + * Get the validation rules that apply to the request. + * + * @return array + */ + public function rules() + { + return $this->rules; + } + + /** + * 获取被定义验证规则的错误消息. + * + * @return array + */ + public function messages() + { + return $this->messages; + } + + //获取场景验证规则 + public function getSceneRules($name, $fields = null) + { + $res = array(); + + if(!isset($this->scene[$name])) + { + return false; + } + + $scene = $this->scene[$name]; + if($fields != null && is_array($fields)) + { + $scene = $fields; + } + + foreach($scene as $k=>$v) + { + if(isset($this->rules[$v])){$res[$v] = $this->rules[$v];} + } + + return $res; + } + + //获取场景验证规则自定义错误信息 + public function getSceneRulesMessages() + { + return $this->messages; + } +} \ No newline at end of file diff --git a/app/Jobs/Example.php b/app/Jobs/Example.php new file mode 100644 index 0000000..d5fc235 --- /dev/null +++ b/app/Jobs/Example.php @@ -0,0 +1,61 @@ +order 发访问订单 + \Log::info('----SendShipmentNotification Listeners handle----'); + \Log::info('order_id:' . $event->order_id); + } +} \ No newline at end of file diff --git a/app/Listeners/SendShipmentNotificationQueue.php b/app/Listeners/SendShipmentNotificationQueue.php new file mode 100644 index 0000000..7bf08af --- /dev/null +++ b/app/Listeners/SendShipmentNotificationQueue.php @@ -0,0 +1,37 @@ + [ 'App\Listeners\EventListener', ], + // 订单发货 + 'App\Events\OrderShipped' => [ + // 发送发货通知 + 'App\Listeners\SendShipmentNotification', + ], ]; /** diff --git a/composer.json b/composer.json index 03f3e1c..c6a625e 100644 --- a/composer.json +++ b/composer.json @@ -6,14 +6,15 @@ "type": "project", "require": { "php": ">=5.6.4", - "intervention/image": "^2.3", - "jpush/jpush": "v3.5.*", "laravel/framework": "5.4.*", "laravel/tinker": "~1.0", + "predis/predis": "^1.1", "maatwebsite/excel": "~2.1.0", + "simplesoftwareio/simple-qrcode": "~1", + "intervention/image": "^2.3", + "yansongda/pay": "^1.0", "overtrue/laravel-wechat": "~3.1", - "predis/predis": "^1.1", - "simplesoftwareio/simple-qrcode": "~1" + "jpush/jpush": "v3.5.*" }, "require-dev": { "fzaninotto/faker": "~1.4", @@ -60,7 +61,7 @@ "repositories": { "packagist": { "type": "composer", - "url": "https://packagist.phpcomposer.com" + "url": "https://mirrors.aliyun.com/composer/" } } } diff --git a/composer.lock b/composer.lock deleted file mode 100644 index bb9bac4..0000000 --- a/composer.lock +++ /dev/null @@ -1,4549 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", - "This file is @generated automatically" - ], - "content-hash": "97c59668860ec127b80901fdc58f9562", - "packages": [ - { - "name": "bacon/bacon-qr-code", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/Bacon/BaconQrCode.git", - "reference": "031a2ce68c5794064b49d11775b2daf45c96e21c" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/Bacon/BaconQrCode/031a2ce68c5794064b49d11775b2daf45c96e21c.zip", - "reference": "031a2ce68c5794064b49d11775b2daf45c96e21c", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-gd": "to generate QR code images" - }, - "type": "library", - "autoload": { - "psr-0": { - "BaconQrCode": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-2-Clause" - ], - "authors": [ - { - "name": "Ben Scholzen 'DASPRiD'", - "email": "mail@dasprids.de", - "homepage": "http://www.dasprids.de", - "role": "Developer" - } - ], - "description": "BaconQrCode is a QR code generator for PHP.", - "homepage": "https://github.com/Bacon/BaconQrCode", - "time": "2016-01-09T22:55:35+00:00" - }, - { - "name": "dnoegel/php-xdg-base-dir", - "version": "0.1", - "source": { - "type": "git", - "url": "https://github.com/dnoegel/php-xdg-base-dir.git", - "reference": "265b8593498b997dc2d31e75b89f053b5cc9621a" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/dnoegel/php-xdg-base-dir/265b8593498b997dc2d31e75b89f053b5cc9621a.zip", - "reference": "265b8593498b997dc2d31e75b89f053b5cc9621a", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "@stable" - }, - "type": "project", - "autoload": { - "psr-4": { - "XdgBaseDir\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "implementation of xdg base directory specification for php", - "time": "2014-10-24T07:27:01+00:00" - }, - { - "name": "doctrine/cache", - "version": "v1.6.2", - "source": { - "type": "git", - "url": "https://github.com/doctrine/cache.git", - "reference": "eb152c5100571c7a45470ff2a35095ab3f3b900b" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/doctrine/cache/eb152c5100571c7a45470ff2a35095ab3f3b900b.zip", - "reference": "eb152c5100571c7a45470ff2a35095ab3f3b900b", - "shasum": "" - }, - "require": { - "php": "~5.5|~7.0" - }, - "conflict": { - "doctrine/common": ">2.2,<2.4" - }, - "require-dev": { - "phpunit/phpunit": "~4.8|~5.0", - "predis/predis": "~1.0", - "satooshi/php-coveralls": "~0.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.6.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Caching library offering an object-oriented API for many cache backends", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "cache", - "caching" - ], - "time": "2017-07-22T12:49:21+00:00" - }, - { - "name": "doctrine/inflector", - "version": "v1.1.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/inflector.git", - "reference": "90b2128806bfde671b6952ab8bea493942c1fdae" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/doctrine/inflector/90b2128806bfde671b6952ab8bea493942c1fdae.zip", - "reference": "90b2128806bfde671b6952ab8bea493942c1fdae", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "4.*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "autoload": { - "psr-0": { - "Doctrine\\Common\\Inflector\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Common String Manipulations with regard to casing and singular/plural rules.", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "inflection", - "pluralize", - "singularize", - "string" - ], - "time": "2015-11-06T14:35:42+00:00" - }, - { - "name": "erusev/parsedown", - "version": "1.6.3", - "source": { - "type": "git", - "url": "https://github.com/erusev/parsedown.git", - "reference": "728952b90a333b5c6f77f06ea9422b94b585878d" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/erusev/parsedown/728952b90a333b5c6f77f06ea9422b94b585878d.zip", - "reference": "728952b90a333b5c6f77f06ea9422b94b585878d", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "autoload": { - "psr-0": { - "Parsedown": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Emanuil Rusev", - "email": "hello@erusev.com", - "homepage": "http://erusev.com" - } - ], - "description": "Parser for Markdown.", - "homepage": "http://parsedown.org", - "keywords": [ - "markdown", - "parser" - ], - "time": "2017-05-14T14:47:48+00:00" - }, - { - "name": "guzzlehttp/guzzle", - "version": "6.3.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/guzzle/guzzle/f4db5a78a5ea468d4831de7f0bf9d9415e348699.zip", - "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699", - "shasum": "" - }, - "require": { - "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.4", - "php": ">=5.5" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "^4.0 || ^5.0", - "psr/log": "^1.0" - }, - "suggest": { - "psr/log": "Required for using the Log middleware" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.2-dev" - } - }, - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "time": "2017-06-22T18:50:49+00:00" - }, - { - "name": "guzzlehttp/promises", - "version": "v1.3.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/guzzle/promises/a59da6cf61d80060647ff4d3eb2c03a2bc694646.zip", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "shasum": "" - }, - "require": { - "php": ">=5.5.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ], - "time": "2016-12-20T10:07:11+00:00" - }, - { - "name": "guzzlehttp/psr7", - "version": "1.4.2", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/guzzle/psr7/f5b8a8512e2b58b0071a7280e39f14f72e05d87c.zip", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Tobias Schultze", - "homepage": "https://github.com/Tobion" - } - ], - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": [ - "http", - "message", - "request", - "response", - "stream", - "uri", - "url" - ], - "time": "2017-03-20T17:10:46+00:00" - }, - { - "name": "intervention/image", - "version": "2.4.0", - "source": { - "type": "git", - "url": "https://github.com/Intervention/image.git", - "reference": "322a4ade249467179c50a3e50eda8760ff3af2a3" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/Intervention/image/322a4ade249467179c50a3e50eda8760ff3af2a3.zip", - "reference": "322a4ade249467179c50a3e50eda8760ff3af2a3", - "shasum": "" - }, - "require": { - "ext-fileinfo": "*", - "guzzlehttp/psr7": "~1.1", - "php": ">=5.4.0" - }, - "require-dev": { - "mockery/mockery": "~0.9.2", - "phpunit/phpunit": "^4.8 || ^5.7" - }, - "suggest": { - "ext-gd": "to use GD library based image processing.", - "ext-imagick": "to use Imagick based image processing.", - "intervention/imagecache": "Caching extension for the Intervention Image library" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - }, - "laravel": { - "providers": [ - "Intervention\\Image\\ImageServiceProvider" - ], - "aliases": { - "Image": "Intervention\\Image\\Facades\\Image" - } - } - }, - "autoload": { - "psr-4": { - "Intervention\\Image\\": "src/Intervention/Image" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Oliver Vogel", - "email": "oliver@olivervogel.com", - "homepage": "http://olivervogel.com/" - } - ], - "description": "Image handling and manipulation library with support for Laravel integration", - "homepage": "http://image.intervention.io/", - "keywords": [ - "gd", - "image", - "imagick", - "laravel", - "thumbnail", - "watermark" - ], - "time": "2017-07-03T15:50:40+00:00" - }, - { - "name": "jakub-onderka/php-console-color", - "version": "0.1", - "source": { - "type": "git", - "url": "https://github.com/JakubOnderka/PHP-Console-Color.git", - "reference": "e0b393dacf7703fc36a4efc3df1435485197e6c1" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/JakubOnderka/PHP-Console-Color/e0b393dacf7703fc36a4efc3df1435485197e6c1.zip", - "reference": "e0b393dacf7703fc36a4efc3df1435485197e6c1", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "jakub-onderka/php-code-style": "1.0", - "jakub-onderka/php-parallel-lint": "0.*", - "jakub-onderka/php-var-dump-check": "0.*", - "phpunit/phpunit": "3.7.*", - "squizlabs/php_codesniffer": "1.*" - }, - "type": "library", - "autoload": { - "psr-0": { - "JakubOnderka\\PhpConsoleColor": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-2-Clause" - ], - "authors": [ - { - "name": "Jakub Onderka", - "email": "jakub.onderka@gmail.com", - "homepage": "http://www.acci.cz" - } - ], - "time": "2014-04-08T15:00:19+00:00" - }, - { - "name": "jakub-onderka/php-console-highlighter", - "version": "v0.3.2", - "source": { - "type": "git", - "url": "https://github.com/JakubOnderka/PHP-Console-Highlighter.git", - "reference": "7daa75df45242c8d5b75a22c00a201e7954e4fb5" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/JakubOnderka/PHP-Console-Highlighter/7daa75df45242c8d5b75a22c00a201e7954e4fb5.zip", - "reference": "7daa75df45242c8d5b75a22c00a201e7954e4fb5", - "shasum": "" - }, - "require": { - "jakub-onderka/php-console-color": "~0.1", - "php": ">=5.3.0" - }, - "require-dev": { - "jakub-onderka/php-code-style": "~1.0", - "jakub-onderka/php-parallel-lint": "~0.5", - "jakub-onderka/php-var-dump-check": "~0.1", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~1.5" - }, - "type": "library", - "autoload": { - "psr-0": { - "JakubOnderka\\PhpConsoleHighlighter": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jakub Onderka", - "email": "acci@acci.cz", - "homepage": "http://www.acci.cz/" - } - ], - "time": "2015-04-20T18:58:01+00:00" - }, - { - "name": "jeremeamia/SuperClosure", - "version": "2.3.0", - "source": { - "type": "git", - "url": "https://github.com/jeremeamia/super_closure.git", - "reference": "443c3df3207f176a1b41576ee2a66968a507b3db" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/jeremeamia/super_closure/443c3df3207f176a1b41576ee2a66968a507b3db.zip", - "reference": "443c3df3207f176a1b41576ee2a66968a507b3db", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^1.2|^2.0|^3.0", - "php": ">=5.4", - "symfony/polyfill-php56": "^1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0|^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } - }, - "autoload": { - "psr-4": { - "SuperClosure\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jeremy Lindblom", - "email": "jeremeamia@gmail.com", - "homepage": "https://github.com/jeremeamia", - "role": "Developer" - } - ], - "description": "Serialize Closure objects, including their context and binding", - "homepage": "https://github.com/jeremeamia/super_closure", - "keywords": [ - "closure", - "function", - "lambda", - "parser", - "serializable", - "serialize", - "tokenizer" - ], - "time": "2016-12-07T09:37:55+00:00" - }, - { - "name": "jpush/jpush", - "version": "v3.5.22", - "source": { - "type": "git", - "url": "https://github.com/jpush/jpush-api-php-client.git", - "reference": "a3d1907b01980de034995c73e5d0c24edf4cedcd" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/jpush/jpush-api-php-client/a3d1907b01980de034995c73e5d0c24edf4cedcd.zip", - "reference": "a3d1907b01980de034995c73e5d0c24edf4cedcd", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "*" - }, - "type": "library", - "autoload": { - "psr-4": { - "JPush\\": "src/JPush/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "JPush", - "email": "support@jpush.cn", - "homepage": "https://www.jpush.cn/", - "role": "Developer" - } - ], - "description": "JPush API PHP Client", - "homepage": "https://github.com/jpush/jpush-api-php-client", - "time": "2017-08-01T05:13:49+00:00" - }, - { - "name": "laravel/framework", - "version": "v5.4.32", - "source": { - "type": "git", - "url": "https://github.com/laravel/framework.git", - "reference": "b8300578d159199b1195413b67318c79068cd24d" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/laravel/framework/b8300578d159199b1195413b67318c79068cd24d.zip", - "reference": "b8300578d159199b1195413b67318c79068cd24d", - "shasum": "" - }, - "require": { - "doctrine/inflector": "~1.1.0", - "erusev/parsedown": "~1.6", - "ext-mbstring": "*", - "ext-openssl": "*", - "league/flysystem": "~1.0", - "monolog/monolog": "~1.11", - "mtdowling/cron-expression": "~1.0", - "nesbot/carbon": "~1.20", - "paragonie/random_compat": "~1.4|~2.0", - "php": ">=5.6.4", - "ramsey/uuid": "~3.0", - "swiftmailer/swiftmailer": "~5.4", - "symfony/console": "~3.2", - "symfony/debug": "~3.2", - "symfony/finder": "~3.2", - "symfony/http-foundation": "~3.2", - "symfony/http-kernel": "~3.2", - "symfony/process": "~3.2", - "symfony/routing": "~3.2", - "symfony/var-dumper": "~3.2", - "tijsverkoyen/css-to-inline-styles": "~2.2", - "vlucas/phpdotenv": "~2.2" - }, - "replace": { - "illuminate/auth": "self.version", - "illuminate/broadcasting": "self.version", - "illuminate/bus": "self.version", - "illuminate/cache": "self.version", - "illuminate/config": "self.version", - "illuminate/console": "self.version", - "illuminate/container": "self.version", - "illuminate/contracts": "self.version", - "illuminate/cookie": "self.version", - "illuminate/database": "self.version", - "illuminate/encryption": "self.version", - "illuminate/events": "self.version", - "illuminate/exception": "self.version", - "illuminate/filesystem": "self.version", - "illuminate/hashing": "self.version", - "illuminate/http": "self.version", - "illuminate/log": "self.version", - "illuminate/mail": "self.version", - "illuminate/notifications": "self.version", - "illuminate/pagination": "self.version", - "illuminate/pipeline": "self.version", - "illuminate/queue": "self.version", - "illuminate/redis": "self.version", - "illuminate/routing": "self.version", - "illuminate/session": "self.version", - "illuminate/support": "self.version", - "illuminate/translation": "self.version", - "illuminate/validation": "self.version", - "illuminate/view": "self.version", - "tightenco/collect": "self.version" - }, - "require-dev": { - "aws/aws-sdk-php": "~3.0", - "doctrine/dbal": "~2.5", - "mockery/mockery": "~0.9.4", - "pda/pheanstalk": "~3.0", - "phpunit/phpunit": "~5.7", - "predis/predis": "~1.0", - "symfony/css-selector": "~3.2", - "symfony/dom-crawler": "~3.2" - }, - "suggest": { - "aws/aws-sdk-php": "Required to use the SQS queue driver and SES mail driver (~3.0).", - "doctrine/dbal": "Required to rename columns and drop SQLite columns (~2.5).", - "fzaninotto/faker": "Required to use the eloquent factory builder (~1.4).", - "guzzlehttp/guzzle": "Required to use the Mailgun and Mandrill mail drivers and the ping methods on schedules (~6.0).", - "laravel/tinker": "Required to use the tinker console command (~1.0).", - "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (~1.0).", - "league/flysystem-rackspace": "Required to use the Flysystem Rackspace driver (~1.0).", - "nexmo/client": "Required to use the Nexmo transport (~1.0).", - "pda/pheanstalk": "Required to use the beanstalk queue driver (~3.0).", - "predis/predis": "Required to use the redis cache and queue drivers (~1.0).", - "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (~2.0).", - "symfony/css-selector": "Required to use some of the crawler integration testing tools (~3.2).", - "symfony/dom-crawler": "Required to use most of the crawler integration testing tools (~3.2).", - "symfony/psr-http-message-bridge": "Required to psr7 bridging features (0.2.*)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.4-dev" - } - }, - "autoload": { - "files": [ - "src/Illuminate/Foundation/helpers.php", - "src/Illuminate/Support/helpers.php" - ], - "psr-4": { - "Illuminate\\": "src/Illuminate/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Laravel Framework.", - "homepage": "https://laravel.com", - "keywords": [ - "framework", - "laravel" - ], - "time": "2017-08-03T12:59:42+00:00" - }, - { - "name": "laravel/tinker", - "version": "v1.0.2", - "source": { - "type": "git", - "url": "https://github.com/laravel/tinker.git", - "reference": "203978fd67f118902acff95925847e70b72e3daf" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/laravel/tinker/203978fd67f118902acff95925847e70b72e3daf.zip", - "reference": "203978fd67f118902acff95925847e70b72e3daf", - "shasum": "" - }, - "require": { - "illuminate/console": "~5.1", - "illuminate/contracts": "~5.1", - "illuminate/support": "~5.1", - "php": ">=5.5.9", - "psy/psysh": "0.7.*|0.8.*", - "symfony/var-dumper": "~3.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0|~5.0" - }, - "suggest": { - "illuminate/database": "The Illuminate Database package (~5.1)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - }, - "laravel": { - "providers": [ - "Laravel\\Tinker\\TinkerServiceProvider" - ] - } - }, - "autoload": { - "psr-4": { - "Laravel\\Tinker\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "Powerful REPL for the Laravel framework.", - "keywords": [ - "REPL", - "Tinker", - "laravel", - "psysh" - ], - "time": "2017-07-13T13:11:05+00:00" - }, - { - "name": "league/flysystem", - "version": "1.0.41", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/flysystem.git", - "reference": "f400aa98912c561ba625ea4065031b7a41e5a155" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/thephpleague/flysystem/f400aa98912c561ba625ea4065031b7a41e5a155.zip", - "reference": "f400aa98912c561ba625ea4065031b7a41e5a155", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "conflict": { - "league/flysystem-sftp": "<1.0.6" - }, - "require-dev": { - "ext-fileinfo": "*", - "mockery/mockery": "~0.9", - "phpspec/phpspec": "^2.2", - "phpunit/phpunit": "~4.8" - }, - "suggest": { - "ext-fileinfo": "Required for MimeType", - "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", - "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3", - "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", - "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching", - "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", - "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", - "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib", - "league/flysystem-webdav": "Allows you to use WebDAV storage", - "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter", - "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", - "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "psr-4": { - "League\\Flysystem\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Frank de Jonge", - "email": "info@frenky.net" - } - ], - "description": "Filesystem abstraction: Many filesystems, one API.", - "keywords": [ - "Cloud Files", - "WebDAV", - "abstraction", - "aws", - "cloud", - "copy.com", - "dropbox", - "file systems", - "files", - "filesystem", - "filesystems", - "ftp", - "rackspace", - "remote", - "s3", - "sftp", - "storage" - ], - "time": "2017-08-06T17:41:04+00:00" - }, - { - "name": "maatwebsite/excel", - "version": "2.1.20", - "source": { - "type": "git", - "url": "https://github.com/Maatwebsite/Laravel-Excel.git", - "reference": "a8baf7de1030d261318f90fa5c273a47ef616b59" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/Maatwebsite/Laravel-Excel/a8baf7de1030d261318f90fa5c273a47ef616b59.zip", - "reference": "a8baf7de1030d261318f90fa5c273a47ef616b59", - "shasum": "" - }, - "require": { - "illuminate/cache": "5.0.*|5.1.*|5.2.*|5.3.*|5.4.*", - "illuminate/config": "5.0.*|5.1.*|5.2.*|5.3.*|5.4.*", - "illuminate/filesystem": "5.0.*|5.1.*|5.2.*|5.3.*|5.4.*", - "illuminate/support": "5.0.*|5.1.*|5.2.*|5.3.*|5.4.*", - "jeremeamia/superclosure": "^2.3", - "nesbot/carbon": "~1.0", - "php": ">=5.5", - "phpoffice/phpexcel": "1.8.*", - "tijsverkoyen/css-to-inline-styles": "~2.0" - }, - "require-dev": { - "mockery/mockery": "~0.9", - "orchestra/testbench": "3.1.*|3.2.*|3.3.*|3.4.*|3.5.*", - "phpseclib/phpseclib": "~1.0", - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "illuminate/http": "5.0.*|5.1.*|5.2.*|5.3.*|5.4.*", - "illuminate/queue": "5.0.*|5.1.*|5.2.*|5.3.*|5.4.*", - "illuminate/routing": "5.0.*|5.1.*|5.2.*|5.3.*|5.4.*", - "illuminate/view": "5.0.*|5.1.*|5.2.*|5.3.*|5.4.*" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "Maatwebsite\\Excel\\ExcelServiceProvider" - ], - "aliases": { - "Excel": "Maatwebsite\\Excel\\Facades\\Excel" - } - } - }, - "autoload": { - "classmap": [ - "src/Maatwebsite/Excel" - ], - "psr-0": { - "Maatwebsite\\Excel\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL" - ], - "authors": [ - { - "name": "Maatwebsite.nl", - "email": "patrick@maatwebsite.nl" - } - ], - "description": "An eloquent way of importing and exporting Excel and CSV in Laravel 4 with the power of PHPExcel", - "keywords": [ - "PHPExcel", - "batch", - "csv", - "excel", - "export", - "import", - "laravel" - ], - "time": "2017-07-26T18:04:04+00:00" - }, - { - "name": "monolog/monolog", - "version": "1.23.0", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/monolog.git", - "reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/Seldaek/monolog/fd8c787753b3a2ad11bc60c063cff1358a32a3b4.zip", - "reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "psr/log": "~1.0" - }, - "provide": { - "psr/log-implementation": "1.0.0" - }, - "require-dev": { - "aws/aws-sdk-php": "^2.4.9 || ^3.0", - "doctrine/couchdb": "~1.0@dev", - "graylog2/gelf-php": "~1.0", - "jakub-onderka/php-parallel-lint": "0.9", - "php-amqplib/php-amqplib": "~2.4", - "php-console/php-console": "^3.1.3", - "phpunit/phpunit": "~4.5", - "phpunit/phpunit-mock-objects": "2.3.0", - "ruflin/elastica": ">=0.90 <3.0", - "sentry/sentry": "^0.13", - "swiftmailer/swiftmailer": "^5.3|^6.0" - }, - "suggest": { - "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", - "doctrine/couchdb": "Allow sending log messages to a CouchDB server", - "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", - "ext-mongo": "Allow sending log messages to a MongoDB server", - "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", - "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", - "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", - "php-console/php-console": "Allow sending log messages to Google Chrome", - "rollbar/rollbar": "Allow sending log messages to Rollbar", - "ruflin/elastica": "Allow sending log messages to an Elastic Search server", - "sentry/sentry": "Allow sending log messages to a Sentry server" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Monolog\\": "src/Monolog" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Sends your logs to files, sockets, inboxes, databases and various web services", - "homepage": "http://github.com/Seldaek/monolog", - "keywords": [ - "log", - "logging", - "psr-3" - ], - "time": "2017-06-19T01:22:40+00:00" - }, - { - "name": "mtdowling/cron-expression", - "version": "v1.2.0", - "source": { - "type": "git", - "url": "https://github.com/mtdowling/cron-expression.git", - "reference": "9504fa9ea681b586028adaaa0877db4aecf32bad" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/mtdowling/cron-expression/9504fa9ea681b586028adaaa0877db4aecf32bad.zip", - "reference": "9504fa9ea681b586028adaaa0877db4aecf32bad", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.0|~5.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Cron\\": "src/Cron/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due", - "keywords": [ - "cron", - "schedule" - ], - "time": "2017-01-23T04:29:33+00:00" - }, - { - "name": "nesbot/carbon", - "version": "1.22.1", - "source": { - "type": "git", - "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "7cdf42c0b1cc763ab7e4c33c47a24e27c66bfccc" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/briannesbitt/Carbon/7cdf42c0b1cc763ab7e4c33c47a24e27c66bfccc.zip", - "reference": "7cdf42c0b1cc763ab7e4c33c47a24e27c66bfccc", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "symfony/translation": "~2.6 || ~3.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "~2", - "phpunit/phpunit": "~4.0 || ~5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.23-dev" - } - }, - "autoload": { - "psr-4": { - "Carbon\\": "src/Carbon/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Brian Nesbitt", - "email": "brian@nesbot.com", - "homepage": "http://nesbot.com" - } - ], - "description": "A simple API extension for DateTime.", - "homepage": "http://carbon.nesbot.com", - "keywords": [ - "date", - "datetime", - "time" - ], - "time": "2017-01-16T07:55:07+00:00" - }, - { - "name": "nikic/php-parser", - "version": "v3.1.0", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "4d4896e553f2094e657fe493506dc37c509d4e2b" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/nikic/PHP-Parser/4d4896e553f2094e657fe493506dc37c509d4e2b.zip", - "reference": "4d4896e553f2094e657fe493506dc37c509d4e2b", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.5" - }, - "require-dev": { - "phpunit/phpunit": "~4.0|~5.0" - }, - "bin": [ - "bin/php-parse" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "time": "2017-07-28T14:45:09+00:00" - }, - { - "name": "overtrue/laravel-wechat", - "version": "3.1.10", - "source": { - "type": "git", - "url": "https://github.com/overtrue/laravel-wechat.git", - "reference": "70b655714b5445f9be7f03a1c66c1b6deb26ef33" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/overtrue/laravel-wechat/70b655714b5445f9be7f03a1c66c1b6deb26ef33.zip", - "reference": "70b655714b5445f9be7f03a1c66c1b6deb26ef33", - "shasum": "" - }, - "require": { - "overtrue/wechat": "^3.3.3" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "Overtrue\\LaravelWechat\\ServiceProvider" - ], - "aliases": { - "EasyWeChat": "Overtrue\\LaravelWechat\\Facade" - } - } - }, - "autoload": { - "psr-4": { - "Overtrue\\LaravelWechat\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "overtrue", - "email": "anzhengchao@gmail.com" - } - ], - "description": "微信 SDK for Laravel", - "keywords": [ - "laravel", - "sdk", - "wechat", - "weixin" - ], - "time": "2017-07-03T09:53:13+00:00" - }, - { - "name": "overtrue/socialite", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/overtrue/socialite.git", - "reference": "fda55f0acef43a144799b1957a8f93d9f5deffce" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/overtrue/socialite/fda55f0acef43a144799b1957a8f93d9f5deffce.zip", - "reference": "fda55f0acef43a144799b1957a8f93d9f5deffce", - "shasum": "" - }, - "require": { - "guzzlehttp/guzzle": "~5.0|~6.0", - "php": ">=5.4.0", - "symfony/http-foundation": "~2.6|~2.7|~2.8|~3.0" - }, - "require-dev": { - "mockery/mockery": "~0.9", - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Overtrue\\Socialite\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "overtrue", - "email": "anzhengchao@gmail.com" - } - ], - "description": "A collection of OAuth 2 packages that extracts from laravel/socialite.", - "keywords": [ - "login", - "oauth", - "qq", - "social", - "wechat", - "weibo" - ], - "time": "2017-08-04T06:28:22+00:00" - }, - { - "name": "overtrue/wechat", - "version": "3.3.12", - "source": { - "type": "git", - "url": "https://github.com/overtrue/wechat.git", - "reference": "7cd51ceb6b44245b724bb565f94d72de7150dfa8" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/overtrue/wechat/7cd51ceb6b44245b724bb565f94d72de7150dfa8.zip", - "reference": "7cd51ceb6b44245b724bb565f94d72de7150dfa8", - "shasum": "" - }, - "require": { - "doctrine/cache": "^1.4", - "ext-openssl": "*", - "guzzlehttp/guzzle": "^6.2", - "monolog/monolog": "^1.17", - "overtrue/socialite": "^1.0.25", - "php": ">=5.5.0", - "pimple/pimple": "^3.0", - "symfony/http-foundation": "^2.6|^3.0", - "symfony/psr-http-message-bridge": "~0.3|^1.0" - }, - "require-dev": { - "mockery/mockery": "^0.9.9", - "overtrue/phplint": "dev-master", - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "EasyWeChat\\": "src/" - }, - "files": [ - "src/Payment/helpers.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "overtrue", - "email": "anzhengchao@gmail.com" - } - ], - "description": "微信SDK", - "keywords": [ - "sdk", - "wechat", - "weixin", - "weixin-sdk" - ], - "time": "2017-08-01T09:38:23+00:00" - }, - { - "name": "paragonie/random_compat", - "version": "v2.0.10", - "source": { - "type": "git", - "url": "https://github.com/paragonie/random_compat.git", - "reference": "634bae8e911eefa89c1abfbf1b66da679ac8f54d" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/paragonie/random_compat/634bae8e911eefa89c1abfbf1b66da679ac8f54d.zip", - "reference": "634bae8e911eefa89c1abfbf1b66da679ac8f54d", - "shasum": "" - }, - "require": { - "php": ">=5.2.0" - }, - "require-dev": { - "phpunit/phpunit": "4.*|5.*" - }, - "suggest": { - "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." - }, - "type": "library", - "autoload": { - "files": [ - "lib/random.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Paragon Initiative Enterprises", - "email": "security@paragonie.com", - "homepage": "https://paragonie.com" - } - ], - "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", - "keywords": [ - "csprng", - "pseudorandom", - "random" - ], - "time": "2017-03-13T16:27:32+00:00" - }, - { - "name": "phpoffice/phpexcel", - "version": "1.8.1", - "source": { - "type": "git", - "url": "https://github.com/PHPOffice/PHPExcel.git", - "reference": "372c7cbb695a6f6f1e62649381aeaa37e7e70b32" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/PHPOffice/PHPExcel/372c7cbb695a6f6f1e62649381aeaa37e7e70b32.zip", - "reference": "372c7cbb695a6f6f1e62649381aeaa37e7e70b32", - "shasum": "" - }, - "require": { - "ext-xml": "*", - "ext-xmlwriter": "*", - "php": ">=5.2.0" - }, - "type": "library", - "autoload": { - "psr-0": { - "PHPExcel": "Classes/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL" - ], - "authors": [ - { - "name": "Maarten Balliauw", - "homepage": "http://blog.maartenballiauw.be" - }, - { - "name": "Mark Baker" - }, - { - "name": "Franck Lefevre", - "homepage": "http://blog.rootslabs.net" - }, - { - "name": "Erik Tilt" - } - ], - "description": "PHPExcel - OpenXML - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine", - "homepage": "http://phpexcel.codeplex.com", - "keywords": [ - "OpenXML", - "excel", - "php", - "spreadsheet", - "xls", - "xlsx" - ], - "abandoned": "phpoffice/phpspreadsheet", - "time": "2015-05-01T07:00:55+00:00" - }, - { - "name": "pimple/pimple", - "version": "v3.2.2", - "source": { - "type": "git", - "url": "https://github.com/silexphp/Pimple.git", - "reference": "4d45fb62d96418396ec58ba76e6f065bca16e10a" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/silexphp/Pimple/4d45fb62d96418396ec58ba76e6f065bca16e10a.zip", - "reference": "4d45fb62d96418396ec58ba76e6f065bca16e10a", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "psr/container": "^1.0" - }, - "require-dev": { - "symfony/phpunit-bridge": "^3.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2.x-dev" - } - }, - "autoload": { - "psr-0": { - "Pimple": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Pimple, a simple Dependency Injection Container", - "homepage": "http://pimple.sensiolabs.org", - "keywords": [ - "container", - "dependency injection" - ], - "time": "2017-07-23T07:32:15+00:00" - }, - { - "name": "predis/predis", - "version": "v1.1.1", - "source": { - "type": "git", - "url": "https://github.com/nrk/predis.git", - "reference": "f0210e38881631afeafb56ab43405a92cafd9fd1" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/nrk/predis/f0210e38881631afeafb56ab43405a92cafd9fd1.zip", - "reference": "f0210e38881631afeafb56ab43405a92cafd9fd1", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "phpunit/phpunit": "~4.8" - }, - "suggest": { - "ext-curl": "Allows access to Webdis when paired with phpiredis", - "ext-phpiredis": "Allows faster serialization and deserialization of the Redis protocol" - }, - "type": "library", - "autoload": { - "psr-4": { - "Predis\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Daniele Alessandri", - "email": "suppakilla@gmail.com", - "homepage": "http://clorophilla.net" - } - ], - "description": "Flexible and feature-complete Redis client for PHP and HHVM", - "homepage": "http://github.com/nrk/predis", - "keywords": [ - "nosql", - "predis", - "redis" - ], - "time": "2016-06-16T16:22:20+00:00" - }, - { - "name": "psr/container", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/php-fig/container/b7ce3b176482dbbc1245ebf52b181af44c2cf55f.zip", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "time": "2017-02-14T16:28:37+00:00" - }, - { - "name": "psr/http-message", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/php-fig/http-message/f6561bf28d520154e4b0ec72be95418abe6d9363.zip", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "time": "2016-08-06T14:39:51+00:00" - }, - { - "name": "psr/log", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/php-fig/log/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d.zip", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "time": "2016-10-10T12:19:37+00:00" - }, - { - "name": "psy/psysh", - "version": "v0.8.11", - "source": { - "type": "git", - "url": "https://github.com/bobthecow/psysh.git", - "reference": "b193cd020e8c6b66cea6457826ae005e94e6d2c0" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/bobthecow/psysh/b193cd020e8c6b66cea6457826ae005e94e6d2c0.zip", - "reference": "b193cd020e8c6b66cea6457826ae005e94e6d2c0", - "shasum": "" - }, - "require": { - "dnoegel/php-xdg-base-dir": "0.1", - "jakub-onderka/php-console-highlighter": "0.3.*", - "nikic/php-parser": "~1.3|~2.0|~3.0", - "php": ">=5.3.9", - "symfony/console": "~2.3.10|^2.4.2|~3.0", - "symfony/var-dumper": "~2.7|~3.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "~1.11", - "hoa/console": "~3.16|~1.14", - "phpunit/phpunit": "~4.4|~5.0", - "symfony/finder": "~2.1|~3.0" - }, - "suggest": { - "ext-pcntl": "Enabling the PCNTL extension makes PsySH a lot happier :)", - "ext-pdo-sqlite": "The doc command requires SQLite to work.", - "ext-posix": "If you have PCNTL, you'll want the POSIX extension as well.", - "ext-readline": "Enables support for arrow-key history navigation, and showing and manipulating command history.", - "hoa/console": "A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit." - }, - "bin": [ - "bin/psysh" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-develop": "0.8.x-dev" - } - }, - "autoload": { - "files": [ - "src/Psy/functions.php" - ], - "psr-4": { - "Psy\\": "src/Psy/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Justin Hileman", - "email": "justin@justinhileman.info", - "homepage": "http://justinhileman.com" - } - ], - "description": "An interactive shell for modern PHP.", - "homepage": "http://psysh.org", - "keywords": [ - "REPL", - "console", - "interactive", - "shell" - ], - "time": "2017-07-29T19:30:02+00:00" - }, - { - "name": "ramsey/uuid", - "version": "3.7.0", - "source": { - "type": "git", - "url": "https://github.com/ramsey/uuid.git", - "reference": "0ef23d1b10cf1bc576e9d865a7e9c47982c5715e" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/ramsey/uuid/0ef23d1b10cf1bc576e9d865a7e9c47982c5715e.zip", - "reference": "0ef23d1b10cf1bc576e9d865a7e9c47982c5715e", - "shasum": "" - }, - "require": { - "paragonie/random_compat": "^1.0|^2.0", - "php": "^5.4 || ^7.0" - }, - "replace": { - "rhumsaa/uuid": "self.version" - }, - "require-dev": { - "apigen/apigen": "^4.1", - "codeception/aspect-mock": "^1.0 | ^2.0", - "doctrine/annotations": "~1.2.0", - "goaop/framework": "1.0.0-alpha.2 | ^1.0 | ^2.1", - "ircmaxell/random-lib": "^1.1", - "jakub-onderka/php-parallel-lint": "^0.9.0", - "mockery/mockery": "^0.9.4", - "moontoast/math": "^1.1", - "php-mock/php-mock-phpunit": "^0.3|^1.1", - "phpunit/phpunit": "^4.7|>=5.0 <5.4", - "satooshi/php-coveralls": "^0.6.1", - "squizlabs/php_codesniffer": "^2.3" - }, - "suggest": { - "ext-libsodium": "Provides the PECL libsodium extension for use with the SodiumRandomGenerator", - "ext-uuid": "Provides the PECL UUID extension for use with the PeclUuidTimeGenerator and PeclUuidRandomGenerator", - "ircmaxell/random-lib": "Provides RandomLib for use with the RandomLibAdapter", - "moontoast/math": "Provides support for converting UUID to 128-bit integer (in string form).", - "ramsey/uuid-console": "A console application for generating UUIDs with ramsey/uuid", - "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Ramsey\\Uuid\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marijn Huizendveld", - "email": "marijn.huizendveld@gmail.com" - }, - { - "name": "Thibaud Fabre", - "email": "thibaud@aztech.io" - }, - { - "name": "Ben Ramsey", - "email": "ben@benramsey.com", - "homepage": "https://benramsey.com" - } - ], - "description": "Formerly rhumsaa/uuid. A PHP 5.4+ library for generating RFC 4122 version 1, 3, 4, and 5 universally unique identifiers (UUID).", - "homepage": "https://github.com/ramsey/uuid", - "keywords": [ - "guid", - "identifier", - "uuid" - ], - "time": "2017-08-04T13:39:04+00:00" - }, - { - "name": "simplesoftwareio/simple-qrcode", - "version": "1.5.1", - "source": { - "type": "git", - "url": "https://github.com/SimpleSoftwareIO/simple-qrcode.git", - "reference": "0d8fbf73f7adc166ec5aabbf898b7327f6c69600" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/SimpleSoftwareIO/simple-qrcode/0d8fbf73f7adc166ec5aabbf898b7327f6c69600.zip", - "reference": "0d8fbf73f7adc166ec5aabbf898b7327f6c69600", - "shasum": "" - }, - "require": { - "bacon/bacon-qr-code": "1.0.*", - "ext-gd": "*", - "illuminate/support": ">=4.2.0", - "php": ">=5.4.0" - }, - "require-dev": { - "mockery/mockery": "0.9.*", - "phpunit/phpunit": "~5" - }, - "type": "library", - "autoload": { - "psr-0": { - "SimpleSoftwareIO\\QrCode\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Simple Software LLC", - "email": "support@simplesoftware.io" - } - ], - "description": "Simple QrCode is a QR code generator made for Laravel.", - "homepage": "http://www.simplesoftware.io", - "keywords": [ - "Simple", - "generator", - "laravel", - "qrcode", - "wrapper" - ], - "time": "2016-12-06T01:39:52+00:00" - }, - { - "name": "swiftmailer/swiftmailer", - "version": "v5.4.8", - "source": { - "type": "git", - "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "9a06dc570a0367850280eefd3f1dc2da45aef517" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/swiftmailer/swiftmailer/9a06dc570a0367850280eefd3f1dc2da45aef517.zip", - "reference": "9a06dc570a0367850280eefd3f1dc2da45aef517", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "mockery/mockery": "~0.9.1", - "symfony/phpunit-bridge": "~3.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.4-dev" - } - }, - "autoload": { - "files": [ - "lib/swift_required.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Chris Corbyn" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Swiftmailer, free feature-rich PHP mailer", - "homepage": "http://swiftmailer.org", - "keywords": [ - "email", - "mail", - "mailer" - ], - "time": "2017-05-01T15:54:03+00:00" - }, - { - "name": "symfony/console", - "version": "v3.3.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "b0878233cb5c4391347e5495089c7af11b8e6201" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/symfony/console/b0878233cb5c4391347e5495089c7af11b8e6201.zip", - "reference": "b0878233cb5c4391347e5495089c7af11b8e6201", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "symfony/debug": "~2.8|~3.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/dependency-injection": "<3.3" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~3.3", - "symfony/dependency-injection": "~3.3", - "symfony/event-dispatcher": "~2.8|~3.0", - "symfony/filesystem": "~2.8|~3.0", - "symfony/http-kernel": "~2.8|~3.0", - "symfony/process": "~2.8|~3.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/filesystem": "", - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Console Component", - "homepage": "https://symfony.com", - "time": "2017-07-29T21:27:59+00:00" - }, - { - "name": "symfony/css-selector", - "version": "v3.3.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/css-selector.git", - "reference": "4d882dced7b995d5274293039370148e291808f2" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/symfony/css-selector/4d882dced7b995d5274293039370148e291808f2.zip", - "reference": "4d882dced7b995d5274293039370148e291808f2", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\CssSelector\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jean-François Simon", - "email": "jeanfrancois.simon@sensiolabs.com" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony CssSelector Component", - "homepage": "https://symfony.com", - "time": "2017-05-01T15:01:29+00:00" - }, - { - "name": "symfony/debug", - "version": "v3.3.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "7c13ae8ce1e2adbbd574fc39de7be498e1284e13" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/symfony/debug/7c13ae8ce1e2adbbd574fc39de7be498e1284e13.zip", - "reference": "7c13ae8ce1e2adbbd574fc39de7be498e1284e13", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" - }, - "require-dev": { - "symfony/http-kernel": "~2.8|~3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Debug\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Debug Component", - "homepage": "https://symfony.com", - "time": "2017-07-28T15:27:31+00:00" - }, - { - "name": "symfony/event-dispatcher", - "version": "v3.3.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "67535f1e3fd662bdc68d7ba317c93eecd973617e" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/symfony/event-dispatcher/67535f1e3fd662bdc68d7ba317c93eecd973617e.zip", - "reference": "67535f1e3fd662bdc68d7ba317c93eecd973617e", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "conflict": { - "symfony/dependency-injection": "<3.3" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.8|~3.0", - "symfony/dependency-injection": "~3.3", - "symfony/expression-language": "~2.8|~3.0", - "symfony/stopwatch": "~2.8|~3.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony EventDispatcher Component", - "homepage": "https://symfony.com", - "time": "2017-06-09T14:53:08+00:00" - }, - { - "name": "symfony/finder", - "version": "v3.3.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "baea7f66d30854ad32988c11a09d7ffd485810c4" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/symfony/finder/baea7f66d30854ad32988c11a09d7ffd485810c4.zip", - "reference": "baea7f66d30854ad32988c11a09d7ffd485810c4", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Finder Component", - "homepage": "https://symfony.com", - "time": "2017-06-01T21:01:25+00:00" - }, - { - "name": "symfony/http-foundation", - "version": "v3.3.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/http-foundation.git", - "reference": "49e8cd2d59a7aa9bfab19e46de680c76e500a031" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/symfony/http-foundation/49e8cd2d59a7aa9bfab19e46de680c76e500a031.zip", - "reference": "49e8cd2d59a7aa9bfab19e46de680c76e500a031", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "symfony/polyfill-mbstring": "~1.1" - }, - "require-dev": { - "symfony/expression-language": "~2.8|~3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\HttpFoundation\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony HttpFoundation Component", - "homepage": "https://symfony.com", - "time": "2017-07-21T11:04:46+00:00" - }, - { - "name": "symfony/http-kernel", - "version": "v3.3.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/http-kernel.git", - "reference": "db10d05f1d95e4168e638db7a81c79616f568ea5" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/symfony/http-kernel/db10d05f1d95e4168e638db7a81c79616f568ea5.zip", - "reference": "db10d05f1d95e4168e638db7a81c79616f568ea5", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "psr/log": "~1.0", - "symfony/debug": "~2.8|~3.0", - "symfony/event-dispatcher": "~2.8|~3.0", - "symfony/http-foundation": "~3.3" - }, - "conflict": { - "symfony/config": "<2.8", - "symfony/dependency-injection": "<3.3", - "symfony/var-dumper": "<3.3", - "twig/twig": "<1.34|<2.4,>=2" - }, - "require-dev": { - "psr/cache": "~1.0", - "symfony/browser-kit": "~2.8|~3.0", - "symfony/class-loader": "~2.8|~3.0", - "symfony/config": "~2.8|~3.0", - "symfony/console": "~2.8|~3.0", - "symfony/css-selector": "~2.8|~3.0", - "symfony/dependency-injection": "~3.3", - "symfony/dom-crawler": "~2.8|~3.0", - "symfony/expression-language": "~2.8|~3.0", - "symfony/finder": "~2.8|~3.0", - "symfony/process": "~2.8|~3.0", - "symfony/routing": "~2.8|~3.0", - "symfony/stopwatch": "~2.8|~3.0", - "symfony/templating": "~2.8|~3.0", - "symfony/translation": "~2.8|~3.0", - "symfony/var-dumper": "~3.3" - }, - "suggest": { - "symfony/browser-kit": "", - "symfony/class-loader": "", - "symfony/config": "", - "symfony/console": "", - "symfony/dependency-injection": "", - "symfony/finder": "", - "symfony/var-dumper": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\HttpKernel\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony HttpKernel Component", - "homepage": "https://symfony.com", - "time": "2017-08-01T10:25:59+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.4.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "f29dca382a6485c3cbe6379f0c61230167681937" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/symfony/polyfill-mbstring/f29dca382a6485c3cbe6379f0c61230167681937.zip", - "reference": "f29dca382a6485c3cbe6379f0c61230167681937", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "time": "2017-06-09T14:24:12+00:00" - }, - { - "name": "symfony/polyfill-php56", - "version": "v1.4.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php56.git", - "reference": "bc0b7d6cb36b10cfabb170a3e359944a95174929" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/symfony/polyfill-php56/bc0b7d6cb36b10cfabb170a3e359944a95174929.zip", - "reference": "bc0b7d6cb36b10cfabb170a3e359944a95174929", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "symfony/polyfill-util": "~1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php56\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "time": "2017-06-09T08:25:21+00:00" - }, - { - "name": "symfony/polyfill-util", - "version": "v1.4.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-util.git", - "reference": "ebccbde4aad410f6438d86d7d261c6b4d2b9a51d" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/symfony/polyfill-util/ebccbde4aad410f6438d86d7d261c6b4d2b9a51d.zip", - "reference": "ebccbde4aad410f6438d86d7d261c6b4d2b9a51d", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Util\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony utilities for portability of PHP codes", - "homepage": "https://symfony.com", - "keywords": [ - "compat", - "compatibility", - "polyfill", - "shim" - ], - "time": "2017-06-09T08:25:21+00:00" - }, - { - "name": "symfony/process", - "version": "v3.3.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "07432804942b9f6dd7b7377faf9920af5f95d70a" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/symfony/process/07432804942b9f6dd7b7377faf9920af5f95d70a.zip", - "reference": "07432804942b9f6dd7b7377faf9920af5f95d70a", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Process Component", - "homepage": "https://symfony.com", - "time": "2017-07-13T13:05:09+00:00" - }, - { - "name": "symfony/psr-http-message-bridge", - "version": "v1.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/psr-http-message-bridge.git", - "reference": "66085f246d3893cbdbcec5f5ad15ac60546cf0de" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/symfony/psr-http-message-bridge/66085f246d3893cbdbcec5f5ad15ac60546cf0de.zip", - "reference": "66085f246d3893cbdbcec5f5ad15ac60546cf0de", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "psr/http-message": "~1.0", - "symfony/http-foundation": "~2.3|~3.0" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7|~3.0" - }, - "suggest": { - "psr/http-message-implementation": "To use the HttpFoundation factory", - "zendframework/zend-diactoros": "To use the Zend Diactoros factory" - }, - "type": "symfony-bridge", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Bridge\\PsrHttpMessage\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "PSR HTTP message bridge", - "homepage": "http://symfony.com", - "keywords": [ - "http", - "http-message", - "psr-7" - ], - "time": "2016-09-14T18:37:20+00:00" - }, - { - "name": "symfony/routing", - "version": "v3.3.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/routing.git", - "reference": "4aee1a917fd4859ff8b51b9fd1dfb790a5ecfa26" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/symfony/routing/4aee1a917fd4859ff8b51b9fd1dfb790a5ecfa26.zip", - "reference": "4aee1a917fd4859ff8b51b9fd1dfb790a5ecfa26", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "conflict": { - "symfony/config": "<2.8", - "symfony/dependency-injection": "<3.3", - "symfony/yaml": "<3.3" - }, - "require-dev": { - "doctrine/annotations": "~1.0", - "doctrine/common": "~2.2", - "psr/log": "~1.0", - "symfony/config": "~2.8|~3.0", - "symfony/dependency-injection": "~3.3", - "symfony/expression-language": "~2.8|~3.0", - "symfony/http-foundation": "~2.8|~3.0", - "symfony/yaml": "~3.3" - }, - "suggest": { - "doctrine/annotations": "For using the annotation loader", - "symfony/config": "For using the all-in-one router or any loader", - "symfony/dependency-injection": "For loading routes from a service", - "symfony/expression-language": "For using expression matching", - "symfony/http-foundation": "For using a Symfony Request object", - "symfony/yaml": "For using the YAML loader" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Routing\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Routing Component", - "homepage": "https://symfony.com", - "keywords": [ - "router", - "routing", - "uri", - "url" - ], - "time": "2017-07-21T17:43:13+00:00" - }, - { - "name": "symfony/translation", - "version": "v3.3.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/translation.git", - "reference": "35dd5fb003c90e8bd4d8cabdf94bf9c96d06fdc3" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/symfony/translation/35dd5fb003c90e8bd4d8cabdf94bf9c96d06fdc3.zip", - "reference": "35dd5fb003c90e8bd4d8cabdf94bf9c96d06fdc3", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/config": "<2.8", - "symfony/yaml": "<3.3" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.8|~3.0", - "symfony/intl": "^2.8.18|^3.2.5", - "symfony/yaml": "~3.3" - }, - "suggest": { - "psr/log": "To use logging capability in translator", - "symfony/config": "", - "symfony/yaml": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Translation\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Translation Component", - "homepage": "https://symfony.com", - "time": "2017-06-24T16:45:30+00:00" - }, - { - "name": "symfony/var-dumper", - "version": "v3.3.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/var-dumper.git", - "reference": "b2623bccb969ad595c2090f9be498b74670d0663" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/symfony/var-dumper/b2623bccb969ad595c2090f9be498b74670d0663.zip", - "reference": "b2623bccb969ad595c2090f9be498b74670d0663", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" - }, - "require-dev": { - "ext-iconv": "*", - "twig/twig": "~1.34|~2.4" - }, - "suggest": { - "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", - "ext-symfony_debug": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "autoload": { - "files": [ - "Resources/functions/dump.php" - ], - "psr-4": { - "Symfony\\Component\\VarDumper\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony mechanism for exploring and dumping PHP variables", - "homepage": "https://symfony.com", - "keywords": [ - "debug", - "dump" - ], - "time": "2017-07-28T06:06:09+00:00" - }, - { - "name": "tijsverkoyen/css-to-inline-styles", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/tijsverkoyen/CssToInlineStyles.git", - "reference": "ab03919dfd85a74ae0372f8baf9f3c7d5c03b04b" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/tijsverkoyen/CssToInlineStyles/ab03919dfd85a74ae0372f8baf9f3c7d5c03b04b.zip", - "reference": "ab03919dfd85a74ae0372f8baf9f3c7d5c03b04b", - "shasum": "" - }, - "require": { - "php": "^5.5 || ^7", - "symfony/css-selector": "^2.7|~3.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.8|5.1.*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "TijsVerkoyen\\CssToInlineStyles\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Tijs Verkoyen", - "email": "css_to_inline_styles@verkoyen.eu", - "role": "Developer" - } - ], - "description": "CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.", - "homepage": "https://github.com/tijsverkoyen/CssToInlineStyles", - "time": "2016-09-20T12:50:39+00:00" - }, - { - "name": "vlucas/phpdotenv", - "version": "v2.4.0", - "source": { - "type": "git", - "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/vlucas/phpdotenv/3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c.zip", - "reference": "3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "phpunit/phpunit": "^4.8 || ^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "autoload": { - "psr-4": { - "Dotenv\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause-Attribution" - ], - "authors": [ - { - "name": "Vance Lucas", - "email": "vance@vancelucas.com", - "homepage": "http://www.vancelucas.com" - } - ], - "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", - "keywords": [ - "dotenv", - "env", - "environment" - ], - "time": "2016-09-01T10:05:43+00:00" - } - ], - "packages-dev": [ - { - "name": "doctrine/instantiator", - "version": "1.0.5", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/doctrine/instantiator/8e884e78f9f0eb1329e445619e04456e64d8051d.zip", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", - "shasum": "" - }, - "require": { - "php": ">=5.3,<8.0-DEV" - }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", - "keywords": [ - "constructor", - "instantiate" - ], - "time": "2015-06-14T21:17:01+00:00" - }, - { - "name": "fzaninotto/faker", - "version": "v1.6.0", - "source": { - "type": "git", - "url": "https://github.com/fzaninotto/Faker.git", - "reference": "44f9a286a04b80c76a4e5fb7aad8bb539b920123" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/fzaninotto/Faker/44f9a286a04b80c76a4e5fb7aad8bb539b920123.zip", - "reference": "44f9a286a04b80c76a4e5fb7aad8bb539b920123", - "shasum": "" - }, - "require": { - "php": "^5.3.3|^7.0" - }, - "require-dev": { - "ext-intl": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~1.5" - }, - "type": "library", - "extra": { - "branch-alias": [] - }, - "autoload": { - "psr-4": { - "Faker\\": "src/Faker/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "François Zaninotto" - } - ], - "description": "Faker is a PHP library that generates fake data for you.", - "keywords": [ - "data", - "faker", - "fixtures" - ], - "time": "2016-04-29T12:21:54+00:00" - }, - { - "name": "hamcrest/hamcrest-php", - "version": "v1.2.2", - "source": { - "type": "git", - "url": "https://github.com/hamcrest/hamcrest-php.git", - "reference": "b37020aa976fa52d3de9aa904aa2522dc518f79c" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/hamcrest/hamcrest-php/b37020aa976fa52d3de9aa904aa2522dc518f79c.zip", - "reference": "b37020aa976fa52d3de9aa904aa2522dc518f79c", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "replace": { - "cordoval/hamcrest-php": "*", - "davedevelopment/hamcrest-php": "*", - "kodova/hamcrest-php": "*" - }, - "require-dev": { - "phpunit/php-file-iterator": "1.3.3", - "satooshi/php-coveralls": "dev-master" - }, - "type": "library", - "autoload": { - "classmap": [ - "hamcrest" - ], - "files": [ - "hamcrest/Hamcrest.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD" - ], - "description": "This is the PHP port of Hamcrest Matchers", - "keywords": [ - "test" - ], - "time": "2015-05-11T14:41:42+00:00" - }, - { - "name": "mockery/mockery", - "version": "0.9.9", - "source": { - "type": "git", - "url": "https://github.com/mockery/mockery.git", - "reference": "6fdb61243844dc924071d3404bb23994ea0b6856" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/mockery/mockery/6fdb61243844dc924071d3404bb23994ea0b6856.zip", - "reference": "6fdb61243844dc924071d3404bb23994ea0b6856", - "shasum": "" - }, - "require": { - "hamcrest/hamcrest-php": "~1.1", - "lib-pcre": ">=7.0", - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.9.x-dev" - } - }, - "autoload": { - "psr-0": { - "Mockery": "library/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Pádraic Brady", - "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" - }, - { - "name": "Dave Marshall", - "email": "dave.marshall@atstsolutions.co.uk", - "homepage": "http://davedevelopment.co.uk" - } - ], - "description": "Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succinct API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending.", - "homepage": "http://github.com/padraic/mockery", - "keywords": [ - "BDD", - "TDD", - "library", - "mock", - "mock objects", - "mockery", - "stub", - "test", - "test double", - "testing" - ], - "time": "2017-02-28T12:52:32+00:00" - }, - { - "name": "myclabs/deep-copy", - "version": "1.6.1", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/myclabs/DeepCopy/8e6e04167378abf1ddb4d3522d8755c5fd90d102.zip", - "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "doctrine/collections": "1.*", - "phpunit/phpunit": "~4.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "homepage": "https://github.com/myclabs/DeepCopy", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "time": "2017-04-12T18:52:22+00:00" - }, - { - "name": "phpdocumentor/reflection-common", - "version": "1.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/phpDocumentor/ReflectionCommon/144c307535e82c8fdcaacbcfc1d6d8eeb896687c.zip", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", - "shasum": "" - }, - "require": { - "php": ">=5.5" - }, - "require-dev": { - "phpunit/phpunit": "^4.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "time": "2015-12-27T11:43:31+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "3.2.2", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/phpDocumentor/ReflectionDocBlock/4aada1f93c72c35e22fb1383b47fee43b8f1d157.zip", - "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157", - "shasum": "" - }, - "require": { - "php": ">=5.5", - "phpdocumentor/reflection-common": "^1.0@dev", - "phpdocumentor/type-resolver": "^0.3.0", - "webmozart/assert": "^1.0" - }, - "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^4.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-08-08T06:39:58+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "0.3.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/phpDocumentor/TypeResolver/fb3933512008d8162b3cdf9e18dba9309b7c3773.zip", - "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773", - "shasum": "" - }, - "require": { - "php": "^5.5 || ^7.0", - "phpdocumentor/reflection-common": "^1.0" - }, - "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^5.2||^4.8.24" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "time": "2017-06-03T08:32:36+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "v1.7.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/phpspec/prophecy/93d39f1f7f9326d746203c7c056f300f7f126073.zip", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", - "sebastian/comparator": "^1.1|^2.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0" - }, - "require-dev": { - "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8 || ^5.6.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.6.x-dev" - } - }, - "autoload": { - "psr-0": { - "Prophecy\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "time": "2017-03-02T20:05:34+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "4.0.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/sebastianbergmann/php-code-coverage/ef7b2f56815df854e66ceaee8ebe9393ae36a40d.zip", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": "^5.6 || ^7.0", - "phpunit/php-file-iterator": "^1.3", - "phpunit/php-text-template": "^1.2", - "phpunit/php-token-stream": "^1.4.2 || ^2.0", - "sebastian/code-unit-reverse-lookup": "^1.0", - "sebastian/environment": "^1.3.2 || ^2.0", - "sebastian/version": "^1.0 || ^2.0" - }, - "require-dev": { - "ext-xdebug": "^2.1.4", - "phpunit/phpunit": "^5.7" - }, - "suggest": { - "ext-xdebug": "^2.5.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "time": "2017-04-02T07:44:40+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "1.4.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/sebastianbergmann/php-file-iterator/3cc8f69b3028d0f96a9078e6295d86e9bf019be5.zip", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "time": "2016-10-03T07:40:28+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/sebastianbergmann/php-text-template/31f8b717e51d9a2afca6c9f046f5d69fc27c8686.zip", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "time": "2015-06-21T13:50:34+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "1.0.9", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/sebastianbergmann/php-timer/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f.zip", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2017-02-26T11:10:40+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "1.4.11", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/sebastianbergmann/php-token-stream/e03f8f67534427a787e21a385a67ec3ca6978ea7.zip", - "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2017-02-27T10:12:30+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "5.7.21", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "3b91adfb64264ddec5a2dee9851f354aa66327db" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/sebastianbergmann/phpunit/3b91adfb64264ddec5a2dee9851f354aa66327db.zip", - "reference": "3b91adfb64264ddec5a2dee9851f354aa66327db", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "myclabs/deep-copy": "~1.3", - "php": "^5.6 || ^7.0", - "phpspec/prophecy": "^1.6.2", - "phpunit/php-code-coverage": "^4.0.4", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "^3.2", - "sebastian/comparator": "^1.2.4", - "sebastian/diff": "^1.4.3", - "sebastian/environment": "^1.3.4 || ^2.0", - "sebastian/exporter": "~2.0", - "sebastian/global-state": "^1.1", - "sebastian/object-enumerator": "~2.0", - "sebastian/resource-operations": "~1.0", - "sebastian/version": "~1.0.3|~2.0", - "symfony/yaml": "~2.1|~3.0" - }, - "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2" - }, - "require-dev": { - "ext-pdo": "*" - }, - "suggest": { - "ext-xdebug": "*", - "phpunit/php-invoker": "~1.1" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.7.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "time": "2017-06-21T08:11:54+00:00" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "3.4.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/sebastianbergmann/phpunit-mock-objects/a23b761686d50a560cc56233b9ecf49597cc9118.zip", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.6 || ^7.0", - "phpunit/php-text-template": "^1.2", - "sebastian/exporter": "^1.2 || ^2.0" - }, - "conflict": { - "phpunit/phpunit": "<5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.4" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "time": "2017-06-30T09:13:00+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/sebastianbergmann/code-unit-reverse-lookup/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18.zip", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04T06:30:41+00:00" - }, - { - "name": "sebastian/comparator", - "version": "1.2.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/sebastianbergmann/comparator/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be.zip", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2017-01-29T09:50:25+00:00" - }, - { - "name": "sebastian/diff", - "version": "1.4.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/sebastianbergmann/diff/7f066a26a962dbe58ddea9f72a4e82874a3975a4.zip", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], - "time": "2017-05-22T07:24:03+00:00" - }, - { - "name": "sebastian/environment", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/sebastianbergmann/environment/5795ffe5dc5b02460c3e34222fee8cbe245d8fac.zip", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "time": "2016-11-26T07:53:53+00:00" - }, - { - "name": "sebastian/exporter", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/sebastianbergmann/exporter/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4.zip", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~2.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2016-11-19T08:54:04+00:00" - }, - { - "name": "sebastian/global-state", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/sebastianbergmann/global-state/bc37d50fea7d017d3d340f230811c9f1d7280af4.zip", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "time": "2015-10-12T03:26:01+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/sebastianbergmann/object-enumerator/1311872ac850040a79c3c058bea3e22d0f09cbb7.zip", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", - "shasum": "" - }, - "require": { - "php": ">=5.6", - "sebastian/recursion-context": "~2.0" - }, - "require-dev": { - "phpunit/phpunit": "~5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-02-18T15:18:39+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/sebastianbergmann/recursion-context/2c3ba150cbec723aa057506e73a8d33bdb286c9a.zip", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-11-19T07:33:16+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/sebastianbergmann/resource-operations/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52.zip", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "shasum": "" - }, - "require": { - "php": ">=5.6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28T20:34:47+00:00" - }, - { - "name": "sebastian/version", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/sebastianbergmann/version/99732be0ddb3361e16ad77b68ba41efc8e979019.zip", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03T07:35:21+00:00" - }, - { - "name": "symfony/yaml", - "version": "v3.3.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "ddc23324e6cfe066f3dd34a37ff494fa80b617ed" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/symfony/yaml/ddc23324e6cfe066f3dd34a37ff494fa80b617ed.zip", - "reference": "ddc23324e6cfe066f3dd34a37ff494fa80b617ed", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "require-dev": { - "symfony/console": "~2.8|~3.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "time": "2017-07-23T12:43:26+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/webmozart/assert/2db61e59ff05fe5126d152bd0655c9ea113e550f.zip", - "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "time": "2016-11-23T20:04:58+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": ">=5.6.4" - }, - "platform-dev": [] -} diff --git a/config/queue.php b/config/queue.php index 4d83ebd..76311a1 100644 --- a/config/queue.php +++ b/config/queue.php @@ -15,6 +15,7 @@ return [ | */ + // 通过在.env中的 QUEUE_CONNECTION 选项,来决定选择何种驱动 'default' => env('QUEUE_DRIVER', 'sync'), /* @@ -60,7 +61,7 @@ return [ 'redis' => [ 'driver' => 'redis', 'connection' => 'default', - 'queue' => 'default', + 'queue' => env('REDIS_QUEUE', 'default'), 'retry_after' => 90, ], @@ -77,6 +78,7 @@ return [ | */ + // 队列有可能失败,失败的队列会写入到mysql的failed_jobs表里面 'failed' => [ 'database' => env('DB_CONNECTION', 'mysql'), 'table' => 'failed_jobs', diff --git a/lqycms.sql b/lqycms.sql index 0ec666f..b2692d9 100644 --- a/lqycms.sql +++ b/lqycms.sql @@ -1,6 +1,6 @@ /* SQLyog 企业版 - MySQL GUI v7.14 -MySQL - 5.7.14 : Database - lqycms +MySQL - 5.7.26 : Database - lqycms ********************************************************************* */ @@ -11,6 +11,8 @@ MySQL - 5.7.14 : Database - lqycms /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +CREATE DATABASE /*!32312 IF NOT EXISTS*/`lqycms` /*!40100 DEFAULT CHARACTER SET utf8 */; + USE `lqycms`; /*Table structure for table `ecs_push` */ @@ -26,8 +28,8 @@ CREATE TABLE `ecs_push` ( `objectId` varchar(200) DEFAULT NULL COMMENT 'leancloud返回的objectId', `link` varchar(200) DEFAULT NULL COMMENT '链接', `platform` tinyint(4) NOT NULL DEFAULT '3' COMMENT '平台类型', - `push_type` tinyint(4) DEFAULT '0' COMMENT '任务类型 1 定时任务 0 即时推送', - `message_type` tinyint(4) DEFAULT '1' COMMENT '消息类型 1 系统消息 2 物流消息', + `push_type` tinyint(4) DEFAULT '0' COMMENT '任务类型1定时任务0即时推送', + `message_type` tinyint(4) DEFAULT '1' COMMENT '消息类型1系统消息2物流消息', `isPush` tinyint(4) DEFAULT '0' COMMENT '定时任务是否已经推送', `push_at` timestamp NULL DEFAULT NULL COMMENT '定时推送时间', `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态 0:关闭 1:开启 默认开启', @@ -80,11 +82,11 @@ CREATE TABLE `fl_access` ( `role_id` int(11) unsigned NOT NULL DEFAULT '0', `menu_id` int(11) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=486 DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC; +) ENGINE=InnoDB AUTO_INCREMENT=560 DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC; /*Data for the table `fl_access` */ -insert into `fl_access`(`id`,`role_id`,`menu_id`) values (1,3,1),(2,3,11),(3,3,12),(4,3,13),(5,3,14),(6,3,15),(7,3,16),(8,3,17),(9,3,18),(10,3,19),(11,3,20),(12,3,21),(13,3,22),(14,3,23),(15,3,24),(16,3,25),(17,3,32),(18,3,33),(19,3,34),(20,3,35),(21,3,36),(22,3,37),(23,3,6),(24,3,78),(25,3,83),(26,1,1),(27,1,2),(28,1,3),(29,1,4),(30,1,5),(31,1,6),(32,1,7),(33,1,8),(34,1,9),(35,1,10),(36,1,11),(37,1,12),(38,1,13),(39,1,14),(40,1,15),(41,1,16),(42,1,17),(43,1,18),(44,1,19),(45,1,20),(46,1,21),(47,1,22),(48,1,23),(49,1,24),(50,1,25),(51,1,26),(52,1,27),(53,1,28),(54,1,29),(55,1,30),(56,1,31),(57,1,32),(58,1,33),(59,1,34),(60,1,35),(61,1,36),(62,1,37),(63,1,38),(64,1,39),(65,1,40),(66,1,41),(67,1,42),(68,1,43),(69,1,44),(70,1,45),(71,1,46),(72,1,47),(73,1,48),(74,1,49),(75,1,50),(76,1,51),(77,1,52),(78,1,53),(79,1,54),(80,1,55),(81,1,56),(82,1,57),(83,1,58),(84,1,59),(85,1,60),(86,1,61),(87,1,62),(88,1,63),(89,1,64),(90,1,65),(91,1,66),(92,1,67),(93,1,68),(94,1,69),(95,1,70),(96,1,71),(97,1,72),(98,1,73),(99,1,74),(100,1,75),(101,1,76),(102,1,77),(103,1,78),(104,1,79),(105,1,80),(106,1,81),(107,1,82),(108,1,83),(109,1,84),(110,1,85),(111,1,86),(112,1,87),(113,1,88),(114,1,89),(115,1,90),(116,1,91),(117,1,92),(118,1,93),(119,1,94),(120,1,95),(121,1,96),(122,1,97),(123,1,98),(124,1,99),(125,1,100),(126,1,101),(127,1,102),(128,1,103),(129,1,104),(130,1,105),(131,1,106),(132,1,107),(133,1,108),(134,1,109),(135,1,110),(136,1,111),(137,1,112),(138,1,113),(139,1,114),(140,1,115),(141,1,116),(142,1,117),(170,1,118),(171,1,119),(172,1,120),(173,1,121),(174,1,122),(175,1,123),(176,1,124),(177,1,125),(178,1,126),(179,1,127),(180,1,128),(181,1,129),(413,2,1),(414,2,11),(415,2,12),(416,2,13),(417,2,14),(418,2,15),(419,2,16),(420,2,17),(421,2,18),(422,2,19),(423,2,20),(424,2,21),(425,2,22),(426,2,23),(427,2,24),(428,2,25),(429,2,32),(430,2,33),(431,2,34),(432,2,35),(433,2,36),(434,2,37),(435,2,2),(436,2,38),(437,2,39),(438,2,40),(439,2,41),(440,2,42),(441,2,50),(442,2,43),(443,2,44),(444,2,45),(445,2,46),(446,2,47),(447,2,48),(448,2,49),(449,2,51),(450,2,107),(451,2,108),(452,2,109),(453,2,110),(454,2,111),(455,2,112),(456,2,3),(457,2,96),(458,2,97),(459,2,98),(460,2,99),(461,2,100),(462,2,101),(463,2,4),(464,2,84),(465,2,85),(466,2,86),(467,2,87),(468,2,88),(469,2,89),(470,2,90),(471,2,91),(472,2,92),(473,2,93),(474,2,94),(475,2,95),(476,2,102),(477,2,103),(478,2,118),(479,2,119),(480,2,5),(481,2,7),(482,2,8),(483,2,9),(484,2,10),(485,2,104); +insert into `fl_access`(`id`,`role_id`,`menu_id`) values (1,3,1),(2,3,11),(3,3,12),(4,3,13),(5,3,14),(6,3,15),(7,3,16),(8,3,17),(9,3,18),(10,3,19),(11,3,20),(12,3,21),(13,3,22),(14,3,23),(15,3,24),(16,3,25),(17,3,32),(18,3,33),(19,3,34),(20,3,35),(21,3,36),(22,3,37),(23,3,6),(24,3,78),(25,3,83),(26,1,1),(27,1,2),(28,1,3),(29,1,4),(30,1,5),(31,1,6),(32,1,7),(33,1,8),(34,1,9),(35,1,10),(36,1,11),(37,1,12),(38,1,13),(39,1,14),(40,1,15),(41,1,16),(42,1,17),(43,1,18),(44,1,19),(45,1,20),(46,1,21),(47,1,22),(48,1,23),(49,1,24),(50,1,25),(51,1,26),(52,1,27),(53,1,28),(54,1,29),(55,1,30),(56,1,31),(57,1,32),(58,1,33),(59,1,34),(60,1,35),(61,1,36),(62,1,37),(63,1,38),(64,1,39),(65,1,40),(66,1,41),(67,1,42),(68,1,43),(69,1,44),(70,1,45),(71,1,46),(72,1,47),(73,1,48),(74,1,49),(75,1,50),(76,1,51),(77,1,52),(78,1,53),(79,1,54),(80,1,55),(81,1,56),(82,1,57),(83,1,58),(84,1,59),(85,1,60),(86,1,61),(87,1,62),(88,1,63),(89,1,64),(90,1,65),(91,1,66),(92,1,67),(93,1,68),(94,1,69),(95,1,70),(96,1,71),(97,1,72),(98,1,73),(99,1,74),(100,1,75),(101,1,76),(102,1,77),(103,1,78),(104,1,79),(105,1,80),(106,1,81),(107,1,82),(108,1,83),(109,1,84),(110,1,85),(111,1,86),(112,1,87),(113,1,88),(114,1,89),(115,1,90),(116,1,91),(117,1,92),(118,1,93),(119,1,94),(120,1,95),(121,1,96),(122,1,97),(123,1,98),(124,1,99),(125,1,100),(126,1,101),(127,1,102),(128,1,103),(129,1,104),(130,1,105),(131,1,106),(132,1,107),(133,1,108),(134,1,109),(135,1,110),(136,1,111),(137,1,112),(138,1,113),(139,1,114),(140,1,115),(141,1,116),(142,1,117),(170,1,118),(171,1,119),(172,1,120),(173,1,121),(174,1,122),(175,1,123),(176,1,124),(177,1,125),(178,1,126),(179,1,127),(180,1,128),(181,1,129),(486,1,130),(487,2,1),(488,2,11),(489,2,12),(490,2,13),(491,2,14),(492,2,15),(493,2,16),(494,2,17),(495,2,18),(496,2,19),(497,2,20),(498,2,21),(499,2,22),(500,2,23),(501,2,24),(502,2,25),(503,2,32),(504,2,33),(505,2,34),(506,2,35),(507,2,36),(508,2,37),(509,2,2),(510,2,38),(511,2,39),(512,2,40),(513,2,41),(514,2,42),(515,2,50),(516,2,43),(517,2,44),(518,2,45),(519,2,46),(520,2,47),(521,2,48),(522,2,49),(523,2,51),(524,2,107),(525,2,108),(526,2,109),(527,2,110),(528,2,111),(529,2,112),(530,2,3),(531,2,96),(532,2,97),(533,2,98),(534,2,99),(535,2,100),(536,2,101),(537,2,4),(538,2,84),(539,2,85),(540,2,86),(541,2,87),(542,2,88),(543,2,89),(544,2,90),(545,2,91),(546,2,92),(547,2,93),(548,2,94),(549,2,95),(550,2,102),(551,2,103),(552,2,118),(553,2,119),(554,2,5),(555,2,7),(556,2,8),(557,2,9),(558,2,10),(559,2,104); /*Table structure for table `fl_admin` */ @@ -92,21 +94,21 @@ DROP TABLE IF EXISTS `fl_admin`; CREATE TABLE `fl_admin` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `username` varchar(30) NOT NULL DEFAULT '' COMMENT 'admin888', + `name` varchar(30) NOT NULL DEFAULT '' COMMENT 'admin888', `email` varchar(30) NOT NULL DEFAULT '' COMMENT '邮箱', - `logintime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '登录时间', + `login_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '登录时间', `pwd` char(32) NOT NULL DEFAULT '' COMMENT 'admin', `role_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '角色id', `status` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '用户状态 0:正常; 1:禁用 ;2:未验证', `mobile` varchar(20) NOT NULL DEFAULT '' COMMENT '手机号', `avatar` varchar(150) NOT NULL DEFAULT '' COMMENT '头像', - `create_at` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注册时间', + `add_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注册时间', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='管理员'; /*Data for the table `fl_admin` */ -insert into `fl_admin`(`id`,`username`,`email`,`logintime`,`pwd`,`role_id`,`status`,`mobile`,`avatar`,`create_at`) values (1,'admin888','admin@qq.com',1553765903,'21232f297a57a5a743894a0e4a801fc3',1,0,'','',4294967295),(2,'abc','abc@qq.com',1497285296,'e10adc3949ba59abbe56e057f20f883e',2,0,'','',4294967295),(3,'xyz','xyz@qq.com',0,'e10adc3949ba59abbe56e057f20f883e',1,0,'','',4294967295); +insert into `fl_admin`(`id`,`name`,`email`,`login_time`,`pwd`,`role_id`,`status`,`mobile`,`avatar`,`add_time`) values (1,'admin888','admin@qq.com',1600061998,'e10adc3949ba59abbe56e057f20f883e',1,0,'','',4294967295),(2,'abc','abc@qq.com',1497285296,'e10adc3949ba59abbe56e057f20f883e',2,0,'','',4294967295),(3,'xyz','xyz@qq.com',0,'e10adc3949ba59abbe56e057f20f883e',1,0,'','',4294967295); /*Table structure for table `fl_admin_role` */ @@ -138,7 +140,7 @@ CREATE TABLE `fl_appsign` ( `app_secret` varchar(128) NOT NULL DEFAULT '', `type` tinyint(4) unsigned NOT NULL DEFAULT '0' COMMENT '0:app, 1:admin, 2:weixin, 3:wap, 4: pc', `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updated_at` timestamp NOT NULL, + `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COMMENT='接口应用认证信息'; @@ -155,7 +157,7 @@ CREATE TABLE `fl_arctype` ( `pid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '父级栏目id', `addtime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间', `name` varchar(30) NOT NULL DEFAULT '' COMMENT '栏目名称', - `seotitle` varchar(150) NOT NULL DEFAULT '' COMMENT 'seo标题', + `seotitle` varchar(150) NOT NULL DEFAULT '' COMMENT 'SEO标题', `keywords` varchar(60) NOT NULL DEFAULT '' COMMENT '关键词', `description` varchar(255) NOT NULL DEFAULT '' COMMENT '描述', `content` mediumtext COMMENT '内容', @@ -183,7 +185,7 @@ DROP TABLE IF EXISTS `fl_article`; CREATE TABLE `fl_article` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `typeid` int(5) unsigned NOT NULL DEFAULT '0' COMMENT '栏目id', + `typeid` int(5) unsigned NOT NULL DEFAULT '0' COMMENT '栏目ID', `tuijian` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '推荐等级', `click` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '点击量', `title` varchar(150) NOT NULL DEFAULT '' COMMENT '标题', @@ -194,7 +196,7 @@ CREATE TABLE `fl_article` ( `pubdate` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', `addtime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间', `keywords` varchar(60) NOT NULL DEFAULT '' COMMENT '关键词', - `seotitle` varchar(150) NOT NULL DEFAULT '' COMMENT 'seo标题', + `seotitle` varchar(150) NOT NULL DEFAULT '' COMMENT 'SEO标题', `description` varchar(250) NOT NULL DEFAULT '' COMMENT '描述', `ischeck` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否审核,默认0审核', `typeid2` int(5) unsigned NOT NULL DEFAULT '0' COMMENT '副栏目id', @@ -207,7 +209,7 @@ CREATE TABLE `fl_article` ( /*Data for the table `fl_article` */ -insert into `fl_article`(`id`,`typeid`,`tuijian`,`click`,`title`,`body`,`writer`,`source`,`litpic`,`pubdate`,`addtime`,`keywords`,`seotitle`,`description`,`ischeck`,`typeid2`,`user_id`,`listorder`) values (1,4,0,467,'移动网站建设常见问题','

    移动网站兴起时间不长,站长有很多相似的问题。在2014年11月份的百度移动搜索沙龙上,移动专家针对站长提问较多的问题进行了统一回答,与往期沙龙的零星回答合并整理如下:


    问:我的移动站内容和PC站是一样的,这样需不需要屏蔽百度的PC搜索蜘蛛?


    答:由于百度的PC搜索和移动搜索共用同一个spider,都带有baidu标示,不要进行屏蔽。Spider在抓取时会对页面进行识别,自动判断是PC页还是mobile页,因此建议站长使用规范的html5/xhtml协议语言来建设移动站。


    问:手机站使用xhtml与html5开发,对搜索引擎是否有区别?


    答:大家使用手机搜索时会发现用2G的情况下移动搜索会给你到极速版,就是保证你得到结果的速度足够快,但是结果样式比较简单。一般情况下极速版我们会优先给Xhtml的结果,触屏版优先给html5,效果更加炫酷。


    问:如果是URL、PC访问和移动访问分别识别不同的模版,例如我们有一个URL,PC访问是是这个模版,手机访问是那个模版。那么我们是使用相同的URL好,还是单独的做一个M站好?


    答:理想状态下同一套url是最优的。目前受限于机制问题,还有待进一步解决,预期14年底能够完成。目前仍然建议大家移动站使用单独的m链接。同时,暂时不要使用类似这样的url:http://m.site.com?src=http://www.site.com。


    问:感谢,我们是这样理解吧,未来的话如果以用户习惯来说,是同一个URL好?


    答:理想的技术角度看,是同一个url更好,但是目前尽量仍然使用单独的m链接。


    问:一个站点有M站和PC站,采用完全相同的TDK,是否有问题,手机站的SEO规则是否跟PC站相同?


    答:TDK代表标题、摘要、关键词是吧?先理解一下。是这样的,PC端和移动端搜索结果展现标题和摘要的字数限制等都是不同的,PC端30多个中文汉字才截断,移动端不到20个就折行了,20多个就省略看不到了。所以,建议移动站使用单独的TDK。


    问:如果两个站点它的TDK都是完全相同的,每一个页面,会不会导致站点被惩罚?


    答:这里说的两个站如果指同一个站点的PC和移动,肯定是不会导致被惩罚的。


    问:外链对手机站是否有效果?


    答:外链还是有效果的,但不要做那些垃圾外链,比如说论坛的标签里面或者说买卖链接或者是说批量的发链接有可能被惩罚。正常交换一下链接是有帮助的。0和1是明显不同的。


    问:百度移动搜索对我的移动站收录较少,该如何做?


    答:1.如果您同时具有PC站,且PC与移动站是一一对应的关系,请利用开放适配工具进行提交,既可以帮助移动站的收录又可以帮助您将PC站的排名转移至移动搜索;2.如果您只有移动站,也可以通过我们的移动sitemap工具向百度进行提交。

    ','','','',1476454862,1476063853,'移动,网站建设,常见问题','','移动网站兴起时间不长,站长有很多相似的问题。在2014年11月份的百度移动搜索沙龙上,移动专家针对站长提问较多的问题进行了统一回答,与往期沙龙的零星回答合并整理如下:问:我的',0,0,0,50),(2,2,1,353,'对百度搜索引擎友好的网站结构','

    我们在做网站结构相关SEO工作时,都应该考虑以下四个问题:

    1,Baiduspider能不能找到所有网页

    2,Baiduspider是否知道哪个网页是重要的

    3,Baiduspider能否顺利提取网页内容

    4,Baiduspider能否在网页中提炼有用信息 


    下面讲的内容便是解决前两个问题的:


    一,友好的网站结构


    1,扁平or树型:一说到网站结构,大家都会提到扁平结构和树型结构,言必称“结构扁平化”,这些指的是物理结构,即基于内容聚合的目录及文件位置决定的结构。其实对于百度搜索引擎来说,只要结构合理、有逻辑性、内容有规律可循都可以,都是友好的。


    2,链接结构:相对于物理结构,就要说到逻辑结构:即通过内部链接形成的链接结构,逻辑结构才是搜索引擎最关注的。对于一个网站来说,网页仅仅可以通过首页——目录1——目录2一层一层follow到是远远不够的,一个优秀的链接结构应该是网状的。


    1)首页链接应该链向重要的频道页,频道页再链向下面的节点页或普通页面。同时,频道页、节点页和普通页面都应该可以链回到首页

    2)无论哪些页面之间互相链接,都需要一个描述恰当的锚文本

    3)链接不要放在JS、FLASH等搜索引擎不可见的位置,使用图片做链接入口应该完善alt标签

       *百度搜索引擎目前仅支持对部分JS和FLASH进行解析,绝大多数放在JS和FLASH里的链接都是获取不到的

    4)为重要页面留更多入口。百度搜索引擎认为,获得更多内部投票的网页相对来说更加重要

    5) “离首页越近”的网页,越容易受到百度重视。这个“近”指的是页面离首页的点击距离。即使URL所在目录层级较深,只要在首页有入口,百度也认为这是一个非常重要的页面。

    6)不要产生可怕的孤岛页面。虽然百度在提交入口、社会化挖掘方面做了许多工作,但链接抓取依然是百度获得新页面的最重要渠道


    二,通过导航让百度更好地认识站点


    对于用户,导航要解决的问题是:我在网站的什么位置,我想看上一级、甚至上上一级更多内容的入口在哪里;对于spider,导航要解决的问题是:这个页面属于哪个领域,要表达的主题是什么。所以说,清晰的导航系统不仅有助于提高用户体验,对SEO的意义也是重大的,所有SEO做得出色的网站基本都拥有清晰明确的导航。


    1,导航内容搜索引擎可见:有网站的导航对用户来说美观友好,对百度来说却是不可见的。目前百度还不能搞定所有的JS和FLASH,保险起见,还是使用HTML的好。图片虽然美丽,作为导航也是对搜索引擎不友好的行为。


    2,导航稳定:导航内容应该是相对固定的,不要让导航成为“滚动条”。


    3,重要网页尽可能地在导航处可以follow到:百度认为主导航中出现的链接,其重要性仅次于网站首页,所以应该尽量将站内的页面在主导航中安排个位置。当然,主导航上也不可能放过多的内容,哪些链接可以上主导航还需要SEO人员进行平衡。


    4,巧用面包屑导航:上面说到,导航对于用户来说,解决了“想看上一级、甚至上上一级更多内容”的问题,这个导航指的就是面包屑导航。面包屑导航可以使结构复杂庞大的大中型网站变得清晰轻盈,在spider进行页面解析时会着重查看面包屑导航内容,强烈建议使用。


    三,合理的domain结构


    除了在网站建设的时候站长会思考到底使用二级域名还是子目录,在网站运营的过程中,也会考虑是否要把子目录的内容拆分成二级域名。因为很多SEO人员认为二级域名相对独立,其首页会得到百度的重视,能获得更好的排位——其实这是一个片面的错误观点,百度会通过很多指标对同domain下的二级域名和子目录进行重要程度判断,并没有武断地认为谁天生就会比谁强一些。


    当SEO认为站内结构已经阻碍了网站高速发展就会考虑改版,最常见的改版便是将子目录移出主站点、单独形成二级域名。但大家都知道,改版肯定会对站点的收录排名和流量造成影响,一定要谨慎。那么在什么情况下才真的需要将子目录换成二级域名呢?其实只有一点:即子目录的内容足够丰富,且与主域的主题关联性不强!


    四,url结构很重要


    1,url结构规律化:同一个网页有不同url,会造成多个url同时被用户推荐导致权值分散;同时百度最终选择展现的那个url不一定符合你的预期。站点应该尽量不把sessionid和统计代码等不必要的内容放在url,如果一定要这样做可以通过robots禁止百度抓取这些非规范url


    2,最好能让用户从url即可判断出网页内容,便于蜘蛛解析的同时便于用户间传播


    3,url尽量短


    ●蜘蛛喜欢:http://tieba.baidu.com.com/f?kw=百度

    ●蜘蛛不喜欢:http://tieba.baidu.com/f?ct=&tn=&rn=&ln=&cn=0&kw=百度&rs2=&un=&rs1=&rs5=&sn=&rs6=&nvselectvalue=0&oword=百度&tb=cn


    4,不要添加蜘蛛难以解析的字符,如

    http://mp3.XXX.com/albumlist/234254;;;;;;;%B9&CE%EDWF%.html

    http://news.xxx.com/1233,242,111,0.shtml


    5,动态参数不要太多太复杂,目前百度对动态url已经有了很好的处理,但是参数过多过复杂的url有可能被蜘蛛认为不重要而抛弃。

    ','','','/images/3.jpg',1476454546,1476063905,'对,百度,搜索引擎,友,好的,网站,结构','','我们在做网站结构相关SEO工作时,都应该考虑以下四个问题:1,Baiduspider能不能找到所有网页2,Baiduspider是否知道哪个网页是重要的3,Baiduspider能否顺利提取网页内容4,Baiduspider能否在网页',0,0,0,50),(3,1,1,379,'在移动搜索展现端获得良好表现的注意事项','

    移动网站优化和PC网站的很多方面都是相似甚至相同的,但由于移动搜索界面大小受限,移动网站在标题和摘要的撰写上有很多有别有PC端的情况。


    1,有吸引力的title


    用户在百度移动搜索中输入query搜索到你的页面时,title作为最重要的内容展现在搜索结果中,主题明确、吸引眼球的title能够使用户第一时间理解你页面的主题是否符合他的需求,进而更快捷地从众多搜索结果中选择你点击你。所以,移动网页的TITLE应该是:


    ●主题明确;


    ●简洁扼要,不罗列,尽量不超过17个中文汉字,否则会折行;


    ●如果你的品牌知名度高,品牌词最好能够展现出来;


    ●在与内容相符的前提下,吸引眼球


    2,不唯一的description,


    作为搜索结果摘要的重要选择目标之一,一定不要采用默认形式,用适当的语言对页面进行进一步描述,对title的进一步补充,能够使用户更进一步理解你页面的内容与其需求是否匹配,让你的目标用户更快找到你点击你。


    ●对title的进一步补充,准确描述页面内容,但不堆砌关键词,否则可能被认为有作弊嫌疑;


    ●ž每个页面要有不同的description,尽量不适用默认一样的;


    ●适当的长度,超出会被截断.

    ','','','',1496551932,1476063946,'在,移动,搜索,展现,端,获得,良好,表现,的,注意事项','','移动网站优化和PC网站的很多方面都是相似甚至相同的,但由于移动搜索界面大小受限,移动网站在标题和摘要的撰写上有很多有别有PC端的情况。1,有吸引力的title用户在百度移动搜索中输',0,0,1,50),(4,2,0,248,'撰写搜索引擎喜欢的标题','

    通过观察可以发现,那些可以从搜索引擎获得大批流量的站点来说,SEO思维渗透到了每个岗位,产品人员在提交项目MRD时,网页标题的写法是必不可少的一部分;编辑对文章内容负责的同时,要设计出吸引用户和搜索引擎的标题;而不是单纯地把优化工作全部扔给SEO人员。所以,今天我们想跟产品人员和编辑说说网页标题该怎么写。


    一,标题的结构


    1,标题字数控制在60个字节内:从以往的经验看,检索用户比较喜欢50个字节左右的标题;对于产品人员和编辑来说,过短的标题有可能无法全面表达网页主题;对于搜索引擎来说,标题过长意味着“超标”,只会保留前60个字节的内容。


    【反面case】福州到北京旅游_北京旅游天气如何_北京旅游景点介绍_北京好玩吗_现在去北京旅游会热吗


    2,重要内容放在标题的最前面:在众多检索结果中,用户的目光往往聚焦在标题前半段,所以重要信息内容放在标题前部非常重要。


    【正面case】关之琳否认脑癌发作称洗牙遭误会|关之琳|癌症_凤凰娱乐


    3,放置网站名称,增加曝光机会:有些站点已经在某领域有了一定的知名度和权威性,其站名名称已经成为一种品牌,可以将该品牌词体现在标题中,用户在面对众多结果时,更倾向于选择点击自己熟知网站提供的信息。即使网站目前的知名度还不够,更不应该放过每个品牌曝光的机会。


    【正面case:】【单电和微单的区别】-蜂鸟网


    【正面case】法国卢浮宫博物馆藏文物精品在中国国家博物馆展出-新华网


    二,标题放什么内容更吸引用户


    用户在百度搜索框输入关键词后,百度在对相关网页进行排序时,网页标题内容是其考虑的重要因素。同时,搜索结果页内通常会有10个结果,用户往往是通过标题和摘要来决定要点击开哪个结果。标题上关键词的选择至关重要。


    1,与网页内容最相关的关键词:首先,标题应该和网页内容相对应,即标题上的内容,可以在网页主体部分得到展示。一般来说,如果网页主要部分是一篇文章,网页标题的主要内容往往是文章标题;如果网页是一个综合信息的集合页,我们也要找到这些信息的共同点,通过一两个关键词将其表现在网页标题上。


    【正面case】婴儿哭闹的原因_婴儿期0-1岁_育儿知识_宝宝树


    2,选择用户更常用的关键词:同一个物品有不同的名称、同一件事情也有不同的描述,选择哪个放在title上呢?虽然百度有强大的关键词分析算法,但我们还是推荐大家使用搜索引擎用户最常用的那个。关键词的热度可以通过百度指数进行查询,目前网络上还有一些其它工具,大家也可以参考一下。


    如佳能有一款单反相机,标准全称是“5dmarkii”,简称“5D2”,广大搜索爱好者亲切地称之为“无敌兔”。从字面上看,“5dmarkii”输入起来比较麻烦。再看一下它们的百度指数:


    “5dmarkii”:257

    “5D2”:875

    “无敌兔”:467


    很明显,“5D2”由于指向清晰、朗朗上口且容易输入,最受搜索引擎用户喜爱


    3,选择能满足用户明确需求的关键词:能体现用户明确需求的关键词往往字数偏长,SEO人员一般称此为长尾关键词,如“杭州两日游路线”“从上海到西塘怎么走”等。我们的产品人员和编辑应该一方面了解用户需求,一方面制作可以满足用户需求的网页,通过将含有用户明确需求的关键词写在标题上来吸引搜索引擎用户的点击。


    【正面case】【宝宝补锌】儿童缺锌怎么办_怎样给孩子补锌-摇篮网


    4,在真实的前提下体现时效性:在标题放时效性关键词最重要的前提是:网页里真的有时效性内容,否则非常容易被搜索引擎惩罚。


    【正面case】2014-10月8万套北京北京二手房价格,真房价没水分!「链家」


    5,直击用户痛点,引发共鸣:还以上面那个case为例,虚假房源和房价一直是二手房买方心中的痛,“2014-10月8万套北京北京二手房价格,真房价没水分!「链家」”直面用户痛点,再配上“链家”的招牌,点击率一直居高不下。当然,这已经超越了SEO的范畴,相信编辑人员在这方面有更多经验。


    三,设计标题时避免做下面的事情


    1,欺骗用户和搜索引擎:有些网站在标题上放置过多重复意义的关键词,甚至放置与内容无关的热门关键词以吸引甚至欺骗用户和搜索引擎,这样很容易被搜索引擎判为作弊而受到惩罚,是一件非常危险的事情。所以:千万不要在标题中体现网页内没有的内容。


    【反面case1】青蛇完整_青蛇完整全集在线观看_青蛇完整完整版视频——该网页仅仅提供了片花视频


    【反面case2】李小璐不雅视频引撞脸门2万抵3万拒绝“撞楼”——该网页主要介绍的是楼盘信息


    2,避免多网页使用同一个标题:原则上每个网页都应该有自己独特的标题,如果整个网站的标题全部一致,将失去向搜索引擎表达含义的重要机会。

    ','','','/images/1.jpg',1476453850,1476063980,'撰写,搜索引擎,喜欢,的,标题','','通过观察可以发现,那些可以从搜索引擎获得大批流量的站点来说,SEO思维渗透到了每个岗位,产品人员在提交项目MRD时,网页标题的写法是必不可少的一部分;编辑对文章内容负责的同时',0,0,0,50),(5,3,0,337,'Baiduspider主要抓取策略类型','

    Baiduspider在抓取过程中面对的是一个超级复杂的网络环境,为了使系统可以抓取到尽可能多的有价值资源并保持系统及实际环境中页面的一致性同时不给网站体验造成压力,会设计多种复杂的抓取策略。以下做简单介绍:


    1、抓取友好性


    互联网资源庞大的数量级,这就要求抓取系统尽可能的高效利用带宽,在有限的硬件和带宽资源下尽可能多的抓取到有价值资源。这就造成了另一个问题,耗费被抓网站的带宽造成访问压力,如果程度过大将直接影响被抓网站的正常用户访问行为。因此,在抓取过程中就要进行一定的抓取压力控制,达到既不影响网站的正常用户访问又能尽量多的抓取到有价值资源的目的。


    通常情况下,最基本的是基于ip的压力控制。这是因为如果基于域名,可能存在一个域名对多个ip(很多大网站)或多个域名对应同一个ip(小网站共享ip)的问题。实际中,往往根据ip及域名的多种条件进行压力调配控制。同时,站长平台也推出了压力反馈工具,站长可以人工调配对自己网站的抓取压力,这时百度spider将优先按照站长的要求进行抓取压力控制。


    对同一个站点的抓取速度控制一般分为两类:其一,一段时间内的抓取频率;其二,一段时间内的抓取流量。同一站点不同的时间抓取速度也会不同,例如夜深人静月黑风高时候抓取的可能就会快一些,也视具体站点类型而定,主要思想是错开正常用户访问高峰,不断的调整。对于不同站点,也需要不同的抓取速度。


    2、常用抓取返回码示意


    简单介绍几种百度支持的返回码:


    1)最常见的404代表“NOTFOUND”,认为网页已经失效,通常将在库中删除,同时短期内如果spider再次发现这条url也不会抓取;


    2)503代表“ServiceUnavailable”,认为网页临时不可访问,通常网站临时关闭,带宽有限等会产生这种情况。对于网页返回503状态码,百度spider不会把这条url直接删除,同时短期内将会反复访问几次,如果网页已恢复,则正常抓取;如果继续返回503,那么这条url仍会被认为是失效链接,从库中删除。


    3)403代表“Forbidden”,认为网页目前禁止访问。如果是新url,spider暂时不抓取,短期内同样会反复访问几次;如果是已收录url,不会直接删除,短期内同样反复访问几次。如果网页正常访问,则正常抓取;如果仍然禁止访问,那么这条url也会被认为是失效链接,从库中删除。


    4)301代表是“MovedPermanently”,认为网页重定向至新url。当遇到站点迁移、域名更换、站点改版的情况时,我们推荐使用301返回码,同时使用站长平台网站改版工具,以减少改版对网站流量造成的损失。


    3、多种url重定向的识别


    互联网中一部分网页因为各种各样的原因存在url重定向状态,为了对这部分资源正常抓取,就要求spider对url重定向进行识别判断,同时防止作弊行为。重定向可分为三类:http30x重定向、metarefresh重定向和js重定向。另外,百度也支持Canonical标签,在效果上可以认为也是一种间接的重定向。


    4、抓取优先级调配


    由于互联网资源规模的巨大以及迅速的变化,对于搜索引擎来说全部抓取到并合理的更新保持一致性几乎是不可能的事情,因此这就要求抓取系统设计一套合理的抓取优先级调配策略。主要包括:深度优先遍历策略、宽度优先遍历策略、pr优先策略、反链策略、社会化分享指导策略等等。每个策略各有优劣,在实际情况中往往是多种策略结合使用以达到最优的抓取效果。


    5、重复url的过滤


    spider在抓取过程中需要判断一个页面是否已经抓取过了,如果还没有抓取再进行抓取网页的行为并放在已抓取网址集合中。判断是否已经抓取其中涉及到最核心的是快速查找并对比,同时涉及到url归一化识别,例如一个url中包含大量无效参数而实际是同一个页面,这将视为同一个url来对待。


    6、暗网数据的获取


    互联网中存在着大量的搜索引擎暂时无法抓取到的数据,被称为暗网数据。一方面,很多网站的大量数据是存在于网络数据库中,spider难以采用抓取网页的方式获得完整内容;另一方面,由于网络环境、网站本身不符合规范、孤岛等等问题,也会造成搜索引擎无法抓取。目前来说,对于暗网数据的获取主要思路仍然是通过开放平台采用数据提交的方式来解决,例如“百度站长平台”“百度开放平台”等等。


    7、抓取反作弊


    spider在抓取过程中往往会遇到所谓抓取黑洞或者面临大量低质量页面的困扰,这就要求抓取系统中同样需要设计一套完善的抓取反作弊系统。例如分析url特征、分析页面大小及内容、分析站点规模对应抓取规模等等。

    ','','','',1476454079,1476064033,'Baiduspider,主要,抓取,策略,类型','','Baiduspider在抓取过程中面对的是一个超级复杂的网络环境,为了使系统可以抓取到尽可能多的有价值资源并保持系统及实际环境中页面的一致性同时不给网站体验造成压力,会设计多种复杂',0,0,0,50),(6,1,0,396,'百度移动搜索优化前期准备工作','

    域名:


    与PC网站一样,域名是用户对一个网站的第一印象。一个好的移动域名,不仅容易记忆、易于输入,还能方便用户向其他人推荐。


    域名应尽量简短易懂,越短的域名记忆成本越低,越容易理解的域名能让用户更直观了解网站主旨。移动站域名建议多采用m.a.com/3g.a.com/wap.a.com等,避免使用过于复杂或技术性的形式,例如adcbxxx.a.com/html5.a.com等。


    服务器:


    选择正规空间服务商,避免与大量垃圾网站共用IP,保证网站访问速度和稳定性。其他这里不再赘述,默认有PC网站基础。


    网站语言:


    根据终端以及技术的发展,我们强烈建议使用html5作为移动站建站语言,并且根据不同终端机型进行自动适配。

    ','','','',1476454177,1476064079,'百度,移动,搜索,优化,前期,准备工作','','域名:与PC网站一样,域名是用户对一个网站的第一印象。一个好的移动域名,不仅容易记忆、易于输入,还能方便用户向其他人推荐。域名应尽量简短易懂,越短的域名记忆成本越低,越',0,0,0,50),(7,4,0,225,'Baiduspider抓取过程中涉及的网络协议','

    百度搜索引擎会设计复杂的抓取策略,其实搜索引擎与资源提供者之间存在相互依赖的关系,其中搜索引擎需要站长为其提供资源,否则搜索引擎就无法满足用户检索需求;而站长需要通过搜索引擎将自己的内容推广出去获取更多的受众。spider抓取系统直接涉及互联网资源提供者的利益,为了使搜素引擎与站长能够达到双赢,在抓取过程中双方必须遵守一定的规范,以便于双方的数据处理及对接。这种过程中遵守的规范也就是日常中我们所说的一些网络协议。


    以下简单列举:


    http协议:超文本传输协议,是互联网上应用最为广泛的一种网络协议,客户端和服务器端请求和应答的标准。客户端一般情况是指终端用户,服务器端即指网站。终端用户通过浏览器、蜘蛛等向服务器指定端口发送http请求。发送http请求会返回对应的httpheader信息,可以看到包括是否成功、服务器类型、网页最近更新时间等内容。


    https协议:实际是加密版http,一种更加安全的数据传输协议。


    UA属性:UA即user-agent,是http协议中的一个属性,代表了终端的身份,向服务器端表明我是谁来干嘛,进而服务器端可以根据不同的身份来做出不同的反馈结果。


    robots协议:robots.txt是搜索引擎访问一个网站时要访问的第一个文件,用以来确定哪些是被允许抓取的哪些是被禁止抓取的。robots.txt必须放在网站根目录下,且文件名要小写。详细的robots.txt写法可参考http://www.robotstxt.org。百度严格按照robots协议执行,另外,同样支持网页内容中添加的名为robots的meta标签,index、follow、nofollow等指令。

    ','','','',1476454131,1476064125,'Baiduspider,抓取,过程中,涉及,的,网络,协议','','百度搜索引擎会设计复杂的抓取策略,其实搜索引擎与资源提供者之间存在相互依赖的关系,其中搜索引擎需要站长为其提供资源,否则搜索引擎就无法满足用户检索需求;而站长需要通过',0,0,0,50),(8,4,1,281,'如何在百度移动搜索获得良好的排序','

    同PC端的需求一样,收录问题解决后面临的就是排序问题了。在介绍排序原则之前先简休介绍一下移动搜索结果的构成,移动搜索主要有如下几类结果构成:移动页面、转码页面、PC页面。


    整体上,移动搜索的结果是由PC搜索结果加入更多的移动端特征后进一步调整而来,优先对移动页面进行排序。其中,移动页面结果包括移动适配提交的与PC一一对应的移动页以及单独的移动页面。百度移动搜索引擎中为更好满足用户信息需求,会同时为用户提供PC网页和mobile网页,但目前大多数PC页在移动终端中直接浏览的体验较差(交互、兼容和流量等)。因此,我们会对百度搜索结果中缺乏可替代mobile资源的PC页进行格式转换,变为适合手机浏览的mobile网页,使其能在移动终端浏览器有较好的浏览体验,这便是转码页面。其他PC页面,是百度经过各种策略识别发现其没有对应的移动页面资源、且转码后体验不佳的情况下保留的一种结果类型。对于后两者我们强烈建议站长进行移动化。


    下面我们主要来说说如何才能在百度移动搜索获得良好的排序:


    1,需要主旨明确的标题:


    网页的title用于告诉用户和搜索引擎这个网页的主题是什么,搜索引擎判断一个页面内容权重时,title是主要因素之一。每个页面的内容都是不同的,都应该有独一无二的title。移动站的标题应该注意如下:


    1)主题明确,涵盖页面主旨内容;


    2)不罗列关键词,使用户能够快速分辨出主题,最好不超过17个中文汉字,否则在搜索结果中会被折行,超过24个会被截断;


    3)重要内容往左放,保持语义通顺;


    4)使用用户熟知或习惯用语


    百度建议不同层级页面的标题按照如下的形式来命名:


    ●首页标题:网站名称_核心服务or核心产品


    ●频道页标题:(频道核心服务_)频道名称_网站名称


    ●详情页标题:文章标题_频道名称_网站名称


    2,优质的原创内容建设、整合系列服务:


    网站的服务对象是用户,搜索引擎只是网站普通用户中的一员,因此,一切从用户角度出发提供用户需要的原创内容、整合系列服务非常重要,每天保持一定数量的原创内容更新,同时可以对优质内容、系列服务进行整合形成专题。但是,鉴于技术的现状,仍然要注意如下几点:


    1)不要使用ajax技术在希望搜索引擎可读的地方;


    2)不将主要内容创建在iframe框架中;


    3)移动端很多内容使用图片,搜索引擎目前无法理解复杂图片,请使用alt标签进行标记;


    3,做好终端适配:


    随着移动互联网的发展,越来越多的用户使用移动设备访问网站,百度移动搜索会对移动站给予优先排序的机会,对于有PC网站的站长,我们强烈建议您做以下工作:


    1、做好自适配,将移动终端的访问自主适配跳转至移动版站点;


    2、为了更快地告知百度移动搜索您PC网站与移动站内容的一一对应关系,建议使用站长平台移动适配工具进行适配关系提交。


    3、同时还可以使用如下Meta标签协议规范:


    ●如果该网页只适合在电脑上进行浏览,例如(http://www.sina.com.cn/),在html中加入如下meta:


    <meta name="applicable-device" content="pc">


    ●如果该网页只适合在移动设备上进行浏览,例如(http://3g.sina.com.cn/),在html中加入如下meta:


    <meta name="applicable-device" content="mobile">


    ●如果网页采用了响应式网页设计,例如(http://cdc.tencent.com/)不需要经过url自适配跳转就可以根据浏览器的屏幕大小自适应的展现合适的效果,同时适合在移动设备和电脑上进行浏览,在html中加入如下meta:


    <meta name="applicable-device" content="pc,mobile">


    4,地理信息标注有助于获得更精准的流量:


    为了方便用户根据自身位置查找或使用本地信息与服务,百度移动搜索将根据用户地理位置信息优先将具有地域属性的内容展现给用户,如果是提供地域性信息服务的站点,可以通过为自己网页添加地理位置信息Meta标注,让目标用户在百度移动搜索中更快的找到您网站的内容。具体用法可见下一小节《如何为移动站点添加地理位置信息》


    5,尽量快的加载速度:


    移动互联网上,网站的打开速度对用户体验的影响更加凸显。实验表明一个页面的打开时间超过4~5s,绝大部分用户选择关闭。因此,加载速度也是百度移动搜索中一个重要的排序因素,站长需要在这方面进行专项优化。


    6,搜索结果转码:


    在移动终端中直接浏览PC页面体验较差(交互、兼容和流量等)。为改善搜索用户的浏览体验,我们会对搜索结果中缺乏可替代移动资源的PC页(无移动站)进行格式转换,变为适合手机浏览的移动网页。如想了解更多可参考:转码声明。我们强烈建议没有移动化的站长进行网站移动化,提交移动适配,将转码流量领回家。

    ','','','',1476454326,1476064196,'如,何在,百度,移动,搜索,获得,良,好的,排序','','同PC端的需求一样,收录问题解决后面临的就是排序问题了。在介绍排序原则之前先简休介绍一下移动搜索结果的构成,移动搜索主要有如下几类结果构成:移动页面、转码页面、PC页面。整',0,0,0,50),(9,2,3,404,'网页优化的大忌','

    网页进行正常优化,有助于搜索引擎更好地了解网页主体内容,而网页优化同样是一柄双刃剑,搞不好会造成费力不讨好、甚至被搜索引擎惩罚的后果。在百度看来,网页优化的大忌有三点:


    1,关键词过度堆彻:有些站点为了提高网站的相关性,在TITLE、description、keywords等地方进行关键词堆彻,非旦无法起到优化作用,还有可能被惩罚。


    *隐藏关键词我们就不用说了,完全是黑帽SEO的范畴,已不在优化之列。


    2,关键词过度优化:一些网页过度强调文章中的关键词,甚至将关键词生硬地穿插在文章中,这些都极容易被搜索引擎识别并惩罚。


    3,经常改变网页的TITLE和Description:每一次更换网页的TITLE和Description等标签,都有一个百度发现解析记录的过程,没有一个准确的时间段可以描述,如果这个过程时间很短可能不会造成恶劣影响,但如果时间较长,则有可能影响搜索用户的体验。所以说,网页的各种标签应该在网站建设阶段设计好。

    ','','','/images/2.jpg',1476453839,1476064241,'网页,优化,的,大忌','','网页进行正常优化,有助于搜索引擎更好地了解网页主体内容,而网页优化同样是一柄双刃剑,搞不好会造成费力不讨好、甚至被搜索引擎惩罚的后果。在百度看来,网页优化的大忌有三点',0,0,0,50),(10,3,0,394,'百度优先建重要库的原则','

    Baiduspider抓了多少页面并不是最重要的,重要的是有多少页面被建索引库,即我们常说的“建库”。众所周知,搜索引擎的索引库是分层级的,优质的网页会被分配到重要索引库,普通网页会待在普通库,再差一些的网页会被分配到低级库去当补充材料。目前60%的检索需求只调用重要索引库即可满足,这也就解释了为什么有些网站的收录量超高流量却一直不理想。


    那么,哪些网页可以进入优质索引库呢。其实总的原则就是一个:对用户的价值。包括却不仅于:


    1,有时效性且有价值的页面:在这里,时效性和价值是并列关系,缺一不可。有些站点为了产生时效性内容页面做了大量采集工作,产生了一堆无价值面页,也是百度不愿看到的.


    2,内容优质的专题页面:专题页面的内容不一定完全是原创的,即可以很好地把各方内容整合在一起,或者增加一些新鲜的内容,比如观点和评论,给用户更丰富全面的内容。


    3,高价值原创内容页面:百度把原创定义为花费一定成本、大量经验积累提取后形成的文章。千万不要再问我们伪原创是不是原创。


    4,重要个人页面:这里仅举一个例子,科比在新浪微博开户了,即使他不经常更新,但对于百度来说,它仍然是一个极重要的页面。

    ','','','',1476454498,1476064284,'百度,优先,建,重要,库,的,原则','','Baiduspider抓了多少页面并不是最重要的,重要的是有多少页面被建索引库,即我们常说的“建库”。众所周知,搜索引擎的索引库是分层级的,优质的网页会被分配到重要索引库,普通网页',0,0,0,50),(11,3,0,486,'禁止百度移动搜索对网页进行转码的方法','

    在百度移动搜索引擎中,为了更好地满足用户需求,会同时为用户提供PC网页和mobile网页,但目前受交互、兼容和流量等因素影响,PC页在移动终端中的直接浏览体验较差。因此,百度移动搜索对缺乏可替代mobile资源的PC页进行格式转码,将其转换为适合手机浏览的mobile页,使其能够在移动终端浏览器有较好的浏览体验。为了最大程度改善PC页在手机上的浏览体验,转码时会去除PC页中不能在手机浏览器上浏览的内容,并改善不适用mobile的交互功能。目前不仅百度移动搜索提供转码技术,各大搜索引擎均有并提供类似的技术。


    那么,如果站长不希望自己的站点被转码、依然希望手机端用户浏览PC页该如何操作呢?可以使用no-transform协议,no-transform协议为如下两种形式:


    第一种,HTTPResponse中显式声明Cache-control为no-transform。


    第二种,meta标签中显式声明Cache-control为no-tranform,格式为:


    <head>


    <meta http-equiv="Cache-Control" content="no-transform"/>


    </head>


    如果站点不希望页面被转码,可添加此协议,当用户通过百度移动搜索进入该网站时会进入原网页浏览。


    还有一种情况,即站点本身有对应的mobile页面所以不希望被转码时,建议站长使用百度移动搜索的移动适配服务,百度会帮助用户直接进入对应的mobile页面。

    ','','','',1476454369,1476064353,'禁止,百度,移动,搜索,对,网页,进行,转,码,的,方法','','在百度移动搜索引擎中,为了更好地满足用户需求,会同时为用户提供PC网页和mobile网页,但目前受交互、兼容和流量等因素影响,PC页在移动终端中的直接浏览体验较差。因此,百度移动搜',0,0,0,50),(12,4,0,384,'网站内容创作的大忌','

    网站制作内容是一件持续性投入的工作,在人力、技术、财力上都需要较大投入,一些站点急于求成寻找捷径,制作了很多垃圾内容,最终被搜索引擎惩罚,可谓得不偿失。希望站长抛弃以下行为,从《百度网页搜索质量白皮书》中寻找答案。


    1,站内大量重复内容:很多网站,尤其是商业网站,往往使用同一个模板,不同网页的主体内容高度相似或相同,仅一些TITLE等标签进行了改变。比如一些招投标网站,为了让更多的地区得到投标内容,他们制作了大量页面,标题采用地区+内容的方式,而页面的主体内容都是完全相同的。再如下图,同样仅标题和图片不同,主体内容相对,对于百度搜索引擎来说,都属于站内大量重复内容。


    2,利用与站点无关的热词引流:有些网站,尤其是新闻源站点紧盯百度的时效性热词,与自己网站文章的标题进行整合,其实就是我们常说的标题党,如“李娜退役隐情体育明星豪宅全揭秘”,用户点击后自然看不到关于李娜退役隐情的内容。此种行为一经发现,网站会被取消新闻源资格,即使内容真的是原创,也会因此行为遭受牵连。


    3,制作低质静态搜索结果页或TAG标签页:很多网站都采用了将站内搜索结果页转为静态页面的方式,整合站点资源,以期形成相关性得分高的页面。但实际来看,很多站点通过站内搜索或者tag生成的页面相关性并不好,或者说产生了许多对百度搜索结果造成负面影响的页面。如果整个目录都存在这样的现象,那么被惩罚的可能性就非常大了。如下方截图,用户搜“列车时刻表”,这样的页面对他来说毫无价值。该页面所在的目录或站点做了很多类似内容的页面,且已经对作用造成恶劣影响时,极容易受到搜索引擎的惩罚。


    4,不负责任的采集:首先需要澄清的是,百度说的拒绝采集,指的是大量复制互联网上已有内容,对采集的内容不加整理即全部推至线上的“偷懒”行为。对于将采集来的内容进行再加工高效整合后,产出内容丰富的高质量网页,百度没有拒绝理由。所以,我们说,百度不喜欢不负责任的偷懒采集行为。


    5,伪原创:上面我们说百度不喜欢不负责任的采集,于是有些人开始动起了伪装原创的脑筋。采集内容后对部分关键词进行批量修改,企图让百度认为这些都是独特内容,然而内容已经是面目全非,甚至无法读通——这也是百度不喜欢的,风险很大。还是刚才说的观点,百度不排斥站点采集内容,关键是如何应用采集的内容和数据,如何整合成用户和搜索引擎都需要的内容才是站长应该考虑的内容。

    ','','','',1483178699,1476454002,'网站,内容,创作,的,大忌','','网站制作内容是一件持续性投入的工作,在人力、技术、财力上都需要较大投入,一些站点急于求成寻找捷径,制作了很多垃圾内容,最终被搜索引擎惩罚,可谓得不偿失。希望站长抛弃以',1,0,1,50),(13,3,0,464,'获得流量的基础——良好收录','

    搜索引擎作为网站的普通访客,对网站的抓取索引、对站点/页面的价值判定以及排序,都是从用户体验出发。因此,原则上网站任何对用户体验的改进,都是对搜索引擎的改进。但是限于当前整体的网络环境以及技术性原因,落实用户体验的具体手段也是需要考虑对搜索引擎友好性的,使之在满足用户体验的前提下也会让搜索引擎更易理解处理。那么,面向移动搜索引擎的网站建设,主要分为三个部分:如何更好的让百度移动搜索收录网站中的内容、如何在移动搜索中获得更好的排名、如何让用户从众多的搜索结果中快速地找到并点击你的网站。简单来说,就是收录、排序、展现。下面我们将从收录开始介绍:


    机器可读:


    与PCspider一样,百度通过一个叫Baiduspider2.0的程序抓取移动互联网上的网页,经过处理后建入移动索引中。当前Baiduspider只能读懂文本内容,flash、图片等非文本内容暂时不能很好处理,放置在flash、图片中的文字,百度只能简单识别。建议使用文本而不是flash、图片、Javascript等来显示重要的内容或链接,搜索引擎暂时无法识别Flash、图片、复杂Javascript中的内容;同时仅存在于flash、Javascript中包含链接指向的网页,百度移动搜索同样可能无法收录。不要在希望搜索引擎可读的地方使用Ajax技术,比如标题、导航、内容等等。


    结构扁平:


    移动站点同样应该有清晰的结构以及更浅的链接深度,这能够使用户快速地获取有用信息,也能使搜索引擎快速理解网站中的每一个页面所处的结构层次。网站结构建议采用树型结构,树型结构通常分为以下三个层级:首页——频道——详情页。


    网状链接:


    理想的网站结构是树型扁平,从首页到内容页的层级尽量少,这样更有利于搜索引擎进行处理。同时,网站内的链接也应该采用网状结构,网站上每个网页都要有指向上、下级网页以及相关内容的链接,避免出现链接孤岛:首页有到频道页的链接,频道页有到首页和普通内容页的链接、普通内容页有到上级频道以及首页的链接、内容相关的网页间互相有链接。网站中每一个网页,都应该是网站结构的一部分,都应该能通过其他网页链接到,这样才能使baiduspider尽可能全地遍历网站内容。同时,重要内容应该距离首页更近,有利于价值传递。


    简单易懂的URL:


    具有良好描述性、规范、简单的URL,有利于用户更方便地记忆和直观判断网页内容,也有利于搜索引擎更有效地抓取和理解网页。网站设计之初,就应该有合理的URL规划。我们认为:


    1、对于移动站首页一般采用m.a.com/3g.a.com/wap.a.com;


    2、频道页采用m.a.com/n1/、m.a.com/n2/(其对应于PC站点的频道n2.a.com),当然,n1、n2直接可读更佳;


    3、详情页的URL尽量短,减少无效参数,例如统计参数等,保证同一页面只有一套URL地址,不同形式的URL301跳转到正常URL上;


    4、Robots封禁baiduspider抓取您不想展示给用户的URL形式以及不愿被百度抓取的私密数据。


    涵盖主旨的anchor:


    anchor即锚文本,对一个链接的描述性文字,锚文本写得越简洁明确,用户越易明白该指向网页的主旨内容。用户发现你的网页是从其他网页上的链接,锚文本是该网页的唯一介绍。跟普通用户相同,搜索引擎spider在刚发现一个网页时,锚文本也是对该页面理解的唯一因素,同时对于最终的排序起到具有一定的作用。


    合理的返回码:


    百度spider在进行抓取和处理时,是根据http协议规范来设置相应逻辑的,常用的几个返回码如下:


    404,百度会认为网页已失效已删除,通常在索引中删除,短期内spider再次遇到也不会抓取。建议内容删除、网页失效等的情况下使用404返回码,告知百度spider该页面已失效。同时网站中尽量减少死链的累计。如果网站临时关闭或抓取压力过大,不要直接返回404,使用503。


    301,永久性重定向,百度会认为当前URL永久跳转至新URL。当网站改版、更换域名等情况下,建议使用301,同时配合使用站长平台的网站改版工具。


    503,百度会认为临时不可访问,不会直接删除,短期内再来检查几次。如果网站临时性关闭建议使用503。

    ','','','',1476454233,1476064847,'获得,流量,的,基础,—,—,良好,收录','','搜索引擎作为网站的普通访客,对网站的抓取索引、对站点/页面的价值判定以及排序,都是从用户体验出发。因此,原则上网站任何对用户体验的改进,都是对搜索引擎的改进。但是限于当',0,0,0,50),(14,4,0,330,'知名站点优化注意事项','

    百度需要优质站点为搜索引擎数据库源源不断地输入物料,同时优质站点也需要从百度获得搜索引擎用户,并将这些搜索引擎用户转化为自己的用户。知名站点可以视为优质站点的一部分,是指已经有较高用户知名度的网站。那么,站点越是知名,就越应从长远考虑,以用户体验为重,积极、合理的进行网站优化,远离作弊和恶意SEO行为,建立与百度更加稳固的合作关系。


    但我们经常可以遗憾地看到一些知名站点使用了不够合理的内容建设方式,比如:大量不同内容的页面均使用同一标题;通过图片的方式展现网页中的重要信息(新闻、联系电话等);重要页面通过flash建设,未使用文字说明等。


    类似的方式,都会使搜索引擎对网站内容的理解造成困难,最终影响网站在搜索引擎中的表现。我们建议您采取对搜索引擎友好的方式进行网站建设,具体内容可参考《百度搜索引擎优化指南》以及《百度搜索引擎网页质量白皮书》。


    知名站点对搜索引擎,乃至整个互联网欢迎的影响通常是巨大的,若使用恶意的作弊行为,其产生的影响也就越坏。例如:


    ●出售首页的友情链接。


    ●大量采集其他网站的内容,原创内容比例极低,甚至大量采集网站主题无关的内容,或机器批量生成没有价值的页面。


    ●网站被大量广告内容占领。


    知名站点一旦有恶意的作弊行为,所产生的恶劣影响将是巨大的,有可能会受到搜索引擎更为严格的惩罚。知名站点更应从长远考虑,提升用户口碑,用高质量的内容赢得用户青睐。不应为了短期的流量,不顾用户的体验,做有损品牌形象的事情。


    此外,知名站点也是各路作弊者的“众矢之的”,容易被恶意利用。站点越知名,被利用的价值就越大。我们建议您建立防范意识,避免由于被作弊者利用引起的不必要风险。


    ●您的站点是否足够安全?当网站被黑客攻击时,是否有足够的应对机制?


    ●由用户贡献内容的功能,是否做好了应对作弊的措施?


    ●对于不想让搜索引擎收录的内容,是否在robot.txt中清晰指明?

    ','百度站长','','',1483178708,1476453609,'知名,站点,优化,注意事项','','百度需要优质站点为搜索引擎数据库源源不断地输入物料,同时优质站点也需要从百度获得搜索引擎用户,并将这些搜索引擎用户转化为自己的用户。知名站点可以视为优质站点的一部分,',0,0,1,50),(15,3,0,432,'获得关键词数据的渠道有哪些','

    上面说到了站点收集关键词的方向,那么通过什么渠道可以获取关键词数据呢。关键词收集也可以叫关键词拓展,其实就是思路的拓展。这个思路在工作岗位中的表现不同:产品运营的角度,可能是个不断深挖行业用户需求、了解需求、站在用户角度想问题设计产品;而从搜索营销、seo角度它则成为深挖行业用户需求的具体体现。那么获取关键词数据的主要渠道有哪些呢:


    1,公开渠道:


    1)几家搜索引擎搜索结果相关搜索、SUG


    2)几家大的社交、媒体(微博)的相关搜索


    3)各搜索引擎的风云榜


    4)竞价关键词获取工具(搜索引擎一般都提供)


    5)百度司南工具


    6)cnzz数据中心(http://data.cnzz.com/);


    2,通过站内工具:


    1)Log日志关键词数据;


    2)站内搜索关键词数据;


    3)商务通、商桥等在线咨询工具内的关键词;


    3,观察竞争对手:


    1)竞争对手网站上的tag页;


    2)竞争对手(尤其是对seo很重视的)站点title;


    3)竞争对手竞价关键词;


    4)竞争对手页面keyword;


    4,购买:


    1)寻找数据公司、工具服务商,购买数据


    5,常识拓展:


    1)问答类(百度知道、知乎)相关问题的提问挖掘


    2)内容评论中的需求挖掘,主题下的评论一定是跟这个主题紧密相关的关注点、bbs评论


    3)通过了解行业用户组合关键词,如:地区+关键词


    最后,就像大家知道的那样,即便这项工作真的很重要,但在如今碎片需求满足程度和信息内容大爆发的情况下,关注关键词背后的深层需求的分析、内容的差异提供、需求针对的产品细化,比不停的扩大关键词量要更重要的多。

    ','','','',1522304646,1476453964,'获得,关键词,数据,的,渠道,有,哪些','','上面说到了站点收集关键词的方向,那么通过什么渠道可以获取关键词数据呢。关键词收集也可以叫关键词拓展,其实就是思路的拓展。这个思路在工作岗位中的表现不同:产品运营的角度',0,0,1,50); +insert into `fl_article`(`id`,`typeid`,`tuijian`,`click`,`title`,`body`,`writer`,`source`,`litpic`,`pubdate`,`addtime`,`keywords`,`seotitle`,`description`,`ischeck`,`typeid2`,`user_id`,`listorder`) values (1,4,0,467,'移动网站建设常见问题','

    移动网站兴起时间不长,站长有很多相似的问题。在2014年11月份的百度移动搜索沙龙上,移动专家针对站长提问较多的问题进行了统一回答,与往期沙龙的零星回答合并整理如下:


    问:我的移动站内容和PC站是一样的,这样需不需要屏蔽百度的PC搜索蜘蛛?


    答:由于百度的PC搜索和移动搜索共用同一个spider,都带有baidu标示,不要进行屏蔽。Spider在抓取时会对页面进行识别,自动判断是PC页还是mobile页,因此建议站长使用规范的html5/xhtml协议语言来建设移动站。


    问:手机站使用xhtml与html5开发,对搜索引擎是否有区别?


    答:大家使用手机搜索时会发现用2G的情况下移动搜索会给你到极速版,就是保证你得到结果的速度足够快,但是结果样式比较简单。一般情况下极速版我们会优先给Xhtml的结果,触屏版优先给html5,效果更加炫酷。


    问:如果是URL、PC访问和移动访问分别识别不同的模版,例如我们有一个URL,PC访问是是这个模版,手机访问是那个模版。那么我们是使用相同的URL好,还是单独的做一个M站好?


    答:理想状态下同一套url是最优的。目前受限于机制问题,还有待进一步解决,预期14年底能够完成。目前仍然建议大家移动站使用单独的m链接。同时,暂时不要使用类似这样的url:http://m.site.com?src=http://www.site.com。


    问:感谢,我们是这样理解吧,未来的话如果以用户习惯来说,是同一个URL好?


    答:理想的技术角度看,是同一个url更好,但是目前尽量仍然使用单独的m链接。


    问:一个站点有M站和PC站,采用完全相同的TDK,是否有问题,手机站的SEO规则是否跟PC站相同?


    答:TDK代表标题、摘要、关键词是吧?先理解一下。是这样的,PC端和移动端搜索结果展现标题和摘要的字数限制等都是不同的,PC端30多个中文汉字才截断,移动端不到20个就折行了,20多个就省略看不到了。所以,建议移动站使用单独的TDK。


    问:如果两个站点它的TDK都是完全相同的,每一个页面,会不会导致站点被惩罚?


    答:这里说的两个站如果指同一个站点的PC和移动,肯定是不会导致被惩罚的。


    问:外链对手机站是否有效果?


    答:外链还是有效果的,但不要做那些垃圾外链,比如说论坛的标签里面或者说买卖链接或者是说批量的发链接有可能被惩罚。正常交换一下链接是有帮助的。0和1是明显不同的。


    问:百度移动搜索对我的移动站收录较少,该如何做?


    答:1.如果您同时具有PC站,且PC与移动站是一一对应的关系,请利用开放适配工具进行提交,既可以帮助移动站的收录又可以帮助您将PC站的排名转移至移动搜索;2.如果您只有移动站,也可以通过我们的移动sitemap工具向百度进行提交。

    ','','','',1476454862,1476063853,'移动,网站建设,常见问题','','移动网站兴起时间不长,站长有很多相似的问题。在2014年11月份的百度移动搜索沙龙上,移动专家针对站长提问较多的问题进行了统一回答,与往期沙龙的零星回答合并整理如下:问:我的',0,0,0,50),(2,2,1,353,'对百度搜索引擎友好的网站结构','

    我们在做网站结构相关SEO工作时,都应该考虑以下四个问题:

    1,Baiduspider能不能找到所有网页

    2,Baiduspider是否知道哪个网页是重要的

    3,Baiduspider能否顺利提取网页内容

    4,Baiduspider能否在网页中提炼有用信息 


    下面讲的内容便是解决前两个问题的:


    一,友好的网站结构


    1,扁平or树型:一说到网站结构,大家都会提到扁平结构和树型结构,言必称“结构扁平化”,这些指的是物理结构,即基于内容聚合的目录及文件位置决定的结构。其实对于百度搜索引擎来说,只要结构合理、有逻辑性、内容有规律可循都可以,都是友好的。


    2,链接结构:相对于物理结构,就要说到逻辑结构:即通过内部链接形成的链接结构,逻辑结构才是搜索引擎最关注的。对于一个网站来说,网页仅仅可以通过首页——目录1——目录2一层一层follow到是远远不够的,一个优秀的链接结构应该是网状的。


    1)首页链接应该链向重要的频道页,频道页再链向下面的节点页或普通页面。同时,频道页、节点页和普通页面都应该可以链回到首页

    2)无论哪些页面之间互相链接,都需要一个描述恰当的锚文本

    3)链接不要放在JS、FLASH等搜索引擎不可见的位置,使用图片做链接入口应该完善alt标签

       *百度搜索引擎目前仅支持对部分JS和FLASH进行解析,绝大多数放在JS和FLASH里的链接都是获取不到的

    4)为重要页面留更多入口。百度搜索引擎认为,获得更多内部投票的网页相对来说更加重要

    5) “离首页越近”的网页,越容易受到百度重视。这个“近”指的是页面离首页的点击距离。即使URL所在目录层级较深,只要在首页有入口,百度也认为这是一个非常重要的页面。

    6)不要产生可怕的孤岛页面。虽然百度在提交入口、社会化挖掘方面做了许多工作,但链接抓取依然是百度获得新页面的最重要渠道


    二,通过导航让百度更好地认识站点


    对于用户,导航要解决的问题是:我在网站的什么位置,我想看上一级、甚至上上一级更多内容的入口在哪里;对于spider,导航要解决的问题是:这个页面属于哪个领域,要表达的主题是什么。所以说,清晰的导航系统不仅有助于提高用户体验,对SEO的意义也是重大的,所有SEO做得出色的网站基本都拥有清晰明确的导航。


    1,导航内容搜索引擎可见:有网站的导航对用户来说美观友好,对百度来说却是不可见的。目前百度还不能搞定所有的JS和FLASH,保险起见,还是使用HTML的好。图片虽然美丽,作为导航也是对搜索引擎不友好的行为。


    2,导航稳定:导航内容应该是相对固定的,不要让导航成为“滚动条”。


    3,重要网页尽可能地在导航处可以follow到:百度认为主导航中出现的链接,其重要性仅次于网站首页,所以应该尽量将站内的页面在主导航中安排个位置。当然,主导航上也不可能放过多的内容,哪些链接可以上主导航还需要SEO人员进行平衡。


    4,巧用面包屑导航:上面说到,导航对于用户来说,解决了“想看上一级、甚至上上一级更多内容”的问题,这个导航指的就是面包屑导航。面包屑导航可以使结构复杂庞大的大中型网站变得清晰轻盈,在spider进行页面解析时会着重查看面包屑导航内容,强烈建议使用。


    三,合理的domain结构


    除了在网站建设的时候站长会思考到底使用二级域名还是子目录,在网站运营的过程中,也会考虑是否要把子目录的内容拆分成二级域名。因为很多SEO人员认为二级域名相对独立,其首页会得到百度的重视,能获得更好的排位——其实这是一个片面的错误观点,百度会通过很多指标对同domain下的二级域名和子目录进行重要程度判断,并没有武断地认为谁天生就会比谁强一些。


    当SEO认为站内结构已经阻碍了网站高速发展就会考虑改版,最常见的改版便是将子目录移出主站点、单独形成二级域名。但大家都知道,改版肯定会对站点的收录排名和流量造成影响,一定要谨慎。那么在什么情况下才真的需要将子目录换成二级域名呢?其实只有一点:即子目录的内容足够丰富,且与主域的主题关联性不强!


    四,url结构很重要


    1,url结构规律化:同一个网页有不同url,会造成多个url同时被用户推荐导致权值分散;同时百度最终选择展现的那个url不一定符合你的预期。站点应该尽量不把sessionid和统计代码等不必要的内容放在url,如果一定要这样做可以通过robots禁止百度抓取这些非规范url


    2,最好能让用户从url即可判断出网页内容,便于蜘蛛解析的同时便于用户间传播


    3,url尽量短


    ●蜘蛛喜欢:http://tieba.baidu.com.com/f?kw=百度

    ●蜘蛛不喜欢:http://tieba.baidu.com/f?ct=&tn=&rn=&ln=&cn=0&kw=百度&rs2=&un=&rs1=&rs5=&sn=&rs6=&nvselectvalue=0&oword=百度&tb=cn


    4,不要添加蜘蛛难以解析的字符,如

    http://mp3.XXX.com/albumlist/234254;;;;;;;%B9&CE%EDWF%.html

    http://news.xxx.com/1233,242,111,0.shtml


    5,动态参数不要太多太复杂,目前百度对动态url已经有了很好的处理,但是参数过多过复杂的url有可能被蜘蛛认为不重要而抛弃。

    ','','','/images/3.jpg',1476454546,1476063905,'对,百度,搜索引擎,友,好的,网站,结构','','我们在做网站结构相关SEO工作时,都应该考虑以下四个问题:1,Baiduspider能不能找到所有网页2,Baiduspider是否知道哪个网页是重要的3,Baiduspider能否顺利提取网页内容4,Baiduspider能否在网页',0,0,0,50),(3,1,1,379,'在移动搜索展现端获得良好表现的注意事项','

    移动网站优化和PC网站的很多方面都是相似甚至相同的,但由于移动搜索界面大小受限,移动网站在标题和摘要的撰写上有很多有别有PC端的情况。


    1,有吸引力的title


    用户在百度移动搜索中输入query搜索到你的页面时,title作为最重要的内容展现在搜索结果中,主题明确、吸引眼球的title能够使用户第一时间理解你页面的主题是否符合他的需求,进而更快捷地从众多搜索结果中选择你点击你。所以,移动网页的TITLE应该是:


    ●主题明确;


    ●简洁扼要,不罗列,尽量不超过17个中文汉字,否则会折行;


    ●如果你的品牌知名度高,品牌词最好能够展现出来;


    ●在与内容相符的前提下,吸引眼球


    2,不唯一的description,


    作为搜索结果摘要的重要选择目标之一,一定不要采用默认形式,用适当的语言对页面进行进一步描述,对title的进一步补充,能够使用户更进一步理解你页面的内容与其需求是否匹配,让你的目标用户更快找到你点击你。


    ●对title的进一步补充,准确描述页面内容,但不堆砌关键词,否则可能被认为有作弊嫌疑;


    ●ž每个页面要有不同的description,尽量不适用默认一样的;


    ●适当的长度,超出会被截断.

    ','','','',1496551932,1476063946,'在,移动,搜索,展现,端,获得,良好,表现,的,注意事项','','移动网站优化和PC网站的很多方面都是相似甚至相同的,但由于移动搜索界面大小受限,移动网站在标题和摘要的撰写上有很多有别有PC端的情况。1,有吸引力的title用户在百度移动搜索中输',0,0,1,50),(4,2,0,248,'撰写搜索引擎喜欢的标题','

    通过观察可以发现,那些可以从搜索引擎获得大批流量的站点来说,SEO思维渗透到了每个岗位,产品人员在提交项目MRD时,网页标题的写法是必不可少的一部分;编辑对文章内容负责的同时,要设计出吸引用户和搜索引擎的标题;而不是单纯地把优化工作全部扔给SEO人员。所以,今天我们想跟产品人员和编辑说说网页标题该怎么写。


    一,标题的结构


    1,标题字数控制在60个字节内:从以往的经验看,检索用户比较喜欢50个字节左右的标题;对于产品人员和编辑来说,过短的标题有可能无法全面表达网页主题;对于搜索引擎来说,标题过长意味着“超标”,只会保留前60个字节的内容。


    【反面case】福州到北京旅游_北京旅游天气如何_北京旅游景点介绍_北京好玩吗_现在去北京旅游会热吗


    2,重要内容放在标题的最前面:在众多检索结果中,用户的目光往往聚焦在标题前半段,所以重要信息内容放在标题前部非常重要。


    【正面case】关之琳否认脑癌发作称洗牙遭误会|关之琳|癌症_凤凰娱乐


    3,放置网站名称,增加曝光机会:有些站点已经在某领域有了一定的知名度和权威性,其站名名称已经成为一种品牌,可以将该品牌词体现在标题中,用户在面对众多结果时,更倾向于选择点击自己熟知网站提供的信息。即使网站目前的知名度还不够,更不应该放过每个品牌曝光的机会。


    【正面case:】【单电和微单的区别】-蜂鸟网


    【正面case】法国卢浮宫博物馆藏文物精品在中国国家博物馆展出-新华网


    二,标题放什么内容更吸引用户


    用户在百度搜索框输入关键词后,百度在对相关网页进行排序时,网页标题内容是其考虑的重要因素。同时,搜索结果页内通常会有10个结果,用户往往是通过标题和摘要来决定要点击开哪个结果。标题上关键词的选择至关重要。


    1,与网页内容最相关的关键词:首先,标题应该和网页内容相对应,即标题上的内容,可以在网页主体部分得到展示。一般来说,如果网页主要部分是一篇文章,网页标题的主要内容往往是文章标题;如果网页是一个综合信息的集合页,我们也要找到这些信息的共同点,通过一两个关键词将其表现在网页标题上。


    【正面case】婴儿哭闹的原因_婴儿期0-1岁_育儿知识_宝宝树


    2,选择用户更常用的关键词:同一个物品有不同的名称、同一件事情也有不同的描述,选择哪个放在title上呢?虽然百度有强大的关键词分析算法,但我们还是推荐大家使用搜索引擎用户最常用的那个。关键词的热度可以通过百度指数进行查询,目前网络上还有一些其它工具,大家也可以参考一下。


    如佳能有一款单反相机,标准全称是“5dmarkii”,简称“5D2”,广大搜索爱好者亲切地称之为“无敌兔”。从字面上看,“5dmarkii”输入起来比较麻烦。再看一下它们的百度指数:


    “5dmarkii”:257

    “5D2”:875

    “无敌兔”:467


    很明显,“5D2”由于指向清晰、朗朗上口且容易输入,最受搜索引擎用户喜爱


    3,选择能满足用户明确需求的关键词:能体现用户明确需求的关键词往往字数偏长,SEO人员一般称此为长尾关键词,如“杭州两日游路线”“从上海到西塘怎么走”等。我们的产品人员和编辑应该一方面了解用户需求,一方面制作可以满足用户需求的网页,通过将含有用户明确需求的关键词写在标题上来吸引搜索引擎用户的点击。


    【正面case】【宝宝补锌】儿童缺锌怎么办_怎样给孩子补锌-摇篮网


    4,在真实的前提下体现时效性:在标题放时效性关键词最重要的前提是:网页里真的有时效性内容,否则非常容易被搜索引擎惩罚。


    【正面case】2014-10月8万套北京北京二手房价格,真房价没水分!「链家」


    5,直击用户痛点,引发共鸣:还以上面那个case为例,虚假房源和房价一直是二手房买方心中的痛,“2014-10月8万套北京北京二手房价格,真房价没水分!「链家」”直面用户痛点,再配上“链家”的招牌,点击率一直居高不下。当然,这已经超越了SEO的范畴,相信编辑人员在这方面有更多经验。


    三,设计标题时避免做下面的事情


    1,欺骗用户和搜索引擎:有些网站在标题上放置过多重复意义的关键词,甚至放置与内容无关的热门关键词以吸引甚至欺骗用户和搜索引擎,这样很容易被搜索引擎判为作弊而受到惩罚,是一件非常危险的事情。所以:千万不要在标题中体现网页内没有的内容。


    【反面case1】青蛇完整_青蛇完整全集在线观看_青蛇完整完整版视频——该网页仅仅提供了片花视频


    【反面case2】李小璐不雅视频引撞脸门2万抵3万拒绝“撞楼”——该网页主要介绍的是楼盘信息


    2,避免多网页使用同一个标题:原则上每个网页都应该有自己独特的标题,如果整个网站的标题全部一致,将失去向搜索引擎表达含义的重要机会。

    ','','','/images/1.jpg',1476453850,1476063980,'撰写,搜索引擎,喜欢,的,标题','','通过观察可以发现,那些可以从搜索引擎获得大批流量的站点来说,SEO思维渗透到了每个岗位,产品人员在提交项目MRD时,网页标题的写法是必不可少的一部分;编辑对文章内容负责的同时',0,0,0,50),(5,3,0,337,'Baiduspider主要抓取策略类型','

    Baiduspider在抓取过程中面对的是一个超级复杂的网络环境,为了使系统可以抓取到尽可能多的有价值资源并保持系统及实际环境中页面的一致性同时不给网站体验造成压力,会设计多种复杂的抓取策略。以下做简单介绍:


    1、抓取友好性


    互联网资源庞大的数量级,这就要求抓取系统尽可能的高效利用带宽,在有限的硬件和带宽资源下尽可能多的抓取到有价值资源。这就造成了另一个问题,耗费被抓网站的带宽造成访问压力,如果程度过大将直接影响被抓网站的正常用户访问行为。因此,在抓取过程中就要进行一定的抓取压力控制,达到既不影响网站的正常用户访问又能尽量多的抓取到有价值资源的目的。


    通常情况下,最基本的是基于ip的压力控制。这是因为如果基于域名,可能存在一个域名对多个ip(很多大网站)或多个域名对应同一个ip(小网站共享ip)的问题。实际中,往往根据ip及域名的多种条件进行压力调配控制。同时,站长平台也推出了压力反馈工具,站长可以人工调配对自己网站的抓取压力,这时百度spider将优先按照站长的要求进行抓取压力控制。


    对同一个站点的抓取速度控制一般分为两类:其一,一段时间内的抓取频率;其二,一段时间内的抓取流量。同一站点不同的时间抓取速度也会不同,例如夜深人静月黑风高时候抓取的可能就会快一些,也视具体站点类型而定,主要思想是错开正常用户访问高峰,不断的调整。对于不同站点,也需要不同的抓取速度。


    2、常用抓取返回码示意


    简单介绍几种百度支持的返回码:


    1)最常见的404代表“NOTFOUND”,认为网页已经失效,通常将在库中删除,同时短期内如果spider再次发现这条url也不会抓取;


    2)503代表“ServiceUnavailable”,认为网页临时不可访问,通常网站临时关闭,带宽有限等会产生这种情况。对于网页返回503状态码,百度spider不会把这条url直接删除,同时短期内将会反复访问几次,如果网页已恢复,则正常抓取;如果继续返回503,那么这条url仍会被认为是失效链接,从库中删除。


    3)403代表“Forbidden”,认为网页目前禁止访问。如果是新url,spider暂时不抓取,短期内同样会反复访问几次;如果是已收录url,不会直接删除,短期内同样反复访问几次。如果网页正常访问,则正常抓取;如果仍然禁止访问,那么这条url也会被认为是失效链接,从库中删除。


    4)301代表是“MovedPermanently”,认为网页重定向至新url。当遇到站点迁移、域名更换、站点改版的情况时,我们推荐使用301返回码,同时使用站长平台网站改版工具,以减少改版对网站流量造成的损失。


    3、多种url重定向的识别


    互联网中一部分网页因为各种各样的原因存在url重定向状态,为了对这部分资源正常抓取,就要求spider对url重定向进行识别判断,同时防止作弊行为。重定向可分为三类:http30x重定向、metarefresh重定向和js重定向。另外,百度也支持Canonical标签,在效果上可以认为也是一种间接的重定向。


    4、抓取优先级调配


    由于互联网资源规模的巨大以及迅速的变化,对于搜索引擎来说全部抓取到并合理的更新保持一致性几乎是不可能的事情,因此这就要求抓取系统设计一套合理的抓取优先级调配策略。主要包括:深度优先遍历策略、宽度优先遍历策略、pr优先策略、反链策略、社会化分享指导策略等等。每个策略各有优劣,在实际情况中往往是多种策略结合使用以达到最优的抓取效果。


    5、重复url的过滤


    spider在抓取过程中需要判断一个页面是否已经抓取过了,如果还没有抓取再进行抓取网页的行为并放在已抓取网址集合中。判断是否已经抓取其中涉及到最核心的是快速查找并对比,同时涉及到url归一化识别,例如一个url中包含大量无效参数而实际是同一个页面,这将视为同一个url来对待。


    6、暗网数据的获取


    互联网中存在着大量的搜索引擎暂时无法抓取到的数据,被称为暗网数据。一方面,很多网站的大量数据是存在于网络数据库中,spider难以采用抓取网页的方式获得完整内容;另一方面,由于网络环境、网站本身不符合规范、孤岛等等问题,也会造成搜索引擎无法抓取。目前来说,对于暗网数据的获取主要思路仍然是通过开放平台采用数据提交的方式来解决,例如“百度站长平台”“百度开放平台”等等。


    7、抓取反作弊


    spider在抓取过程中往往会遇到所谓抓取黑洞或者面临大量低质量页面的困扰,这就要求抓取系统中同样需要设计一套完善的抓取反作弊系统。例如分析url特征、分析页面大小及内容、分析站点规模对应抓取规模等等。

    ','','','',1476454079,1476064033,'Baiduspider,主要,抓取,策略,类型','','Baiduspider在抓取过程中面对的是一个超级复杂的网络环境,为了使系统可以抓取到尽可能多的有价值资源并保持系统及实际环境中页面的一致性同时不给网站体验造成压力,会设计多种复杂',0,0,0,50),(6,1,0,396,'百度移动搜索优化前期准备工作','

    域名:


    与PC网站一样,域名是用户对一个网站的第一印象。一个好的移动域名,不仅容易记忆、易于输入,还能方便用户向其他人推荐。


    域名应尽量简短易懂,越短的域名记忆成本越低,越容易理解的域名能让用户更直观了解网站主旨。移动站域名建议多采用m.a.com/3g.a.com/wap.a.com等,避免使用过于复杂或技术性的形式,例如adcbxxx.a.com/html5.a.com等。


    服务器:


    选择正规空间服务商,避免与大量垃圾网站共用IP,保证网站访问速度和稳定性。其他这里不再赘述,默认有PC网站基础。


    网站语言:


    根据终端以及技术的发展,我们强烈建议使用html5作为移动站建站语言,并且根据不同终端机型进行自动适配。

    ','','','',1476454177,1476064079,'百度,移动,搜索,优化,前期,准备工作','','域名:与PC网站一样,域名是用户对一个网站的第一印象。一个好的移动域名,不仅容易记忆、易于输入,还能方便用户向其他人推荐。域名应尽量简短易懂,越短的域名记忆成本越低,越',0,0,0,50),(7,4,0,225,'Baiduspider抓取过程中涉及的网络协议','

    百度搜索引擎会设计复杂的抓取策略,其实搜索引擎与资源提供者之间存在相互依赖的关系,其中搜索引擎需要站长为其提供资源,否则搜索引擎就无法满足用户检索需求;而站长需要通过搜索引擎将自己的内容推广出去获取更多的受众。spider抓取系统直接涉及互联网资源提供者的利益,为了使搜素引擎与站长能够达到双赢,在抓取过程中双方必须遵守一定的规范,以便于双方的数据处理及对接。这种过程中遵守的规范也就是日常中我们所说的一些网络协议。


    以下简单列举:


    http协议:超文本传输协议,是互联网上应用最为广泛的一种网络协议,客户端和服务器端请求和应答的标准。客户端一般情况是指终端用户,服务器端即指网站。终端用户通过浏览器、蜘蛛等向服务器指定端口发送http请求。发送http请求会返回对应的httpheader信息,可以看到包括是否成功、服务器类型、网页最近更新时间等内容。


    https协议:实际是加密版http,一种更加安全的数据传输协议。


    UA属性:UA即user-agent,是http协议中的一个属性,代表了终端的身份,向服务器端表明我是谁来干嘛,进而服务器端可以根据不同的身份来做出不同的反馈结果。


    robots协议:robots.txt是搜索引擎访问一个网站时要访问的第一个文件,用以来确定哪些是被允许抓取的哪些是被禁止抓取的。robots.txt必须放在网站根目录下,且文件名要小写。详细的robots.txt写法可参考http://www.robotstxt.org。百度严格按照robots协议执行,另外,同样支持网页内容中添加的名为robots的meta标签,index、follow、nofollow等指令。

    ','','','',1476454131,1476064125,'Baiduspider,抓取,过程中,涉及,的,网络,协议','','百度搜索引擎会设计复杂的抓取策略,其实搜索引擎与资源提供者之间存在相互依赖的关系,其中搜索引擎需要站长为其提供资源,否则搜索引擎就无法满足用户检索需求;而站长需要通过',0,0,0,50),(8,4,1,281,'如何在百度移动搜索获得良好的排序','

    同PC端的需求一样,收录问题解决后面临的就是排序问题了。在介绍排序原则之前先简休介绍一下移动搜索结果的构成,移动搜索主要有如下几类结果构成:移动页面、转码页面、PC页面。


    整体上,移动搜索的结果是由PC搜索结果加入更多的移动端特征后进一步调整而来,优先对移动页面进行排序。其中,移动页面结果包括移动适配提交的与PC一一对应的移动页以及单独的移动页面。百度移动搜索引擎中为更好满足用户信息需求,会同时为用户提供PC网页和mobile网页,但目前大多数PC页在移动终端中直接浏览的体验较差(交互、兼容和流量等)。因此,我们会对百度搜索结果中缺乏可替代mobile资源的PC页进行格式转换,变为适合手机浏览的mobile网页,使其能在移动终端浏览器有较好的浏览体验,这便是转码页面。其他PC页面,是百度经过各种策略识别发现其没有对应的移动页面资源、且转码后体验不佳的情况下保留的一种结果类型。对于后两者我们强烈建议站长进行移动化。


    下面我们主要来说说如何才能在百度移动搜索获得良好的排序:


    1,需要主旨明确的标题:


    网页的title用于告诉用户和搜索引擎这个网页的主题是什么,搜索引擎判断一个页面内容权重时,title是主要因素之一。每个页面的内容都是不同的,都应该有独一无二的title。移动站的标题应该注意如下:


    1)主题明确,涵盖页面主旨内容;


    2)不罗列关键词,使用户能够快速分辨出主题,最好不超过17个中文汉字,否则在搜索结果中会被折行,超过24个会被截断;


    3)重要内容往左放,保持语义通顺;


    4)使用用户熟知或习惯用语


    百度建议不同层级页面的标题按照如下的形式来命名:


    ●首页标题:网站名称_核心服务or核心产品


    ●频道页标题:(频道核心服务_)频道名称_网站名称


    ●详情页标题:文章标题_频道名称_网站名称


    2,优质的原创内容建设、整合系列服务:


    网站的服务对象是用户,搜索引擎只是网站普通用户中的一员,因此,一切从用户角度出发提供用户需要的原创内容、整合系列服务非常重要,每天保持一定数量的原创内容更新,同时可以对优质内容、系列服务进行整合形成专题。但是,鉴于技术的现状,仍然要注意如下几点:


    1)不要使用ajax技术在希望搜索引擎可读的地方;


    2)不将主要内容创建在iframe框架中;


    3)移动端很多内容使用图片,搜索引擎目前无法理解复杂图片,请使用alt标签进行标记;


    3,做好终端适配:


    随着移动互联网的发展,越来越多的用户使用移动设备访问网站,百度移动搜索会对移动站给予优先排序的机会,对于有PC网站的站长,我们强烈建议您做以下工作:


    1、做好自适配,将移动终端的访问自主适配跳转至移动版站点;


    2、为了更快地告知百度移动搜索您PC网站与移动站内容的一一对应关系,建议使用站长平台移动适配工具进行适配关系提交。


    3、同时还可以使用如下Meta标签协议规范:


    ●如果该网页只适合在电脑上进行浏览,例如(http://www.sina.com.cn/),在html中加入如下meta:


    <meta name="applicable-device" content="pc">


    ●如果该网页只适合在移动设备上进行浏览,例如(http://3g.sina.com.cn/),在html中加入如下meta:


    <meta name="applicable-device" content="mobile">


    ●如果网页采用了响应式网页设计,例如(http://cdc.tencent.com/)不需要经过url自适配跳转就可以根据浏览器的屏幕大小自适应的展现合适的效果,同时适合在移动设备和电脑上进行浏览,在html中加入如下meta:


    <meta name="applicable-device" content="pc,mobile">


    4,地理信息标注有助于获得更精准的流量:


    为了方便用户根据自身位置查找或使用本地信息与服务,百度移动搜索将根据用户地理位置信息优先将具有地域属性的内容展现给用户,如果是提供地域性信息服务的站点,可以通过为自己网页添加地理位置信息Meta标注,让目标用户在百度移动搜索中更快的找到您网站的内容。具体用法可见下一小节《如何为移动站点添加地理位置信息》


    5,尽量快的加载速度:


    移动互联网上,网站的打开速度对用户体验的影响更加凸显。实验表明一个页面的打开时间超过4~5s,绝大部分用户选择关闭。因此,加载速度也是百度移动搜索中一个重要的排序因素,站长需要在这方面进行专项优化。


    6,搜索结果转码:


    在移动终端中直接浏览PC页面体验较差(交互、兼容和流量等)。为改善搜索用户的浏览体验,我们会对搜索结果中缺乏可替代移动资源的PC页(无移动站)进行格式转换,变为适合手机浏览的移动网页。如想了解更多可参考:转码声明。我们强烈建议没有移动化的站长进行网站移动化,提交移动适配,将转码流量领回家。

    ','','','',1476454326,1476064196,'如,何在,百度,移动,搜索,获得,良,好的,排序','','同PC端的需求一样,收录问题解决后面临的就是排序问题了。在介绍排序原则之前先简休介绍一下移动搜索结果的构成,移动搜索主要有如下几类结果构成:移动页面、转码页面、PC页面。整',0,0,0,50),(9,2,3,404,'网页优化的大忌','

    网页进行正常优化,有助于搜索引擎更好地了解网页主体内容,而网页优化同样是一柄双刃剑,搞不好会造成费力不讨好、甚至被搜索引擎惩罚的后果。在百度看来,网页优化的大忌有三点:


    1,关键词过度堆彻:有些站点为了提高网站的相关性,在TITLE、description、keywords等地方进行关键词堆彻,非旦无法起到优化作用,还有可能被惩罚。


    *隐藏关键词我们就不用说了,完全是黑帽SEO的范畴,已不在优化之列。


    2,关键词过度优化:一些网页过度强调文章中的关键词,甚至将关键词生硬地穿插在文章中,这些都极容易被搜索引擎识别并惩罚。


    3,经常改变网页的TITLE和Description:每一次更换网页的TITLE和Description等标签,都有一个百度发现解析记录的过程,没有一个准确的时间段可以描述,如果这个过程时间很短可能不会造成恶劣影响,但如果时间较长,则有可能影响搜索用户的体验。所以说,网页的各种标签应该在网站建设阶段设计好。

    ','','','/images/2.jpg',1476453839,1476064241,'网页,优化,的,大忌','','网页进行正常优化,有助于搜索引擎更好地了解网页主体内容,而网页优化同样是一柄双刃剑,搞不好会造成费力不讨好、甚至被搜索引擎惩罚的后果。在百度看来,网页优化的大忌有三点',0,0,0,50),(10,3,0,394,'百度优先建重要库的原则','

    Baiduspider抓了多少页面并不是最重要的,重要的是有多少页面被建索引库,即我们常说的“建库”。众所周知,搜索引擎的索引库是分层级的,优质的网页会被分配到重要索引库,普通网页会待在普通库,再差一些的网页会被分配到低级库去当补充材料。目前60%的检索需求只调用重要索引库即可满足,这也就解释了为什么有些网站的收录量超高流量却一直不理想。


    那么,哪些网页可以进入优质索引库呢。其实总的原则就是一个:对用户的价值。包括却不仅于:


    1,有时效性且有价值的页面:在这里,时效性和价值是并列关系,缺一不可。有些站点为了产生时效性内容页面做了大量采集工作,产生了一堆无价值面页,也是百度不愿看到的.


    2,内容优质的专题页面:专题页面的内容不一定完全是原创的,即可以很好地把各方内容整合在一起,或者增加一些新鲜的内容,比如观点和评论,给用户更丰富全面的内容。


    3,高价值原创内容页面:百度把原创定义为花费一定成本、大量经验积累提取后形成的文章。千万不要再问我们伪原创是不是原创。


    4,重要个人页面:这里仅举一个例子,科比在新浪微博开户了,即使他不经常更新,但对于百度来说,它仍然是一个极重要的页面。

    ','','','',1476454498,1476064284,'百度,优先,建,重要,库,的,原则','','Baiduspider抓了多少页面并不是最重要的,重要的是有多少页面被建索引库,即我们常说的“建库”。众所周知,搜索引擎的索引库是分层级的,优质的网页会被分配到重要索引库,普通网页',0,0,0,50),(11,3,0,486,'禁止百度移动搜索对网页进行转码的方法','

    在百度移动搜索引擎中,为了更好地满足用户需求,会同时为用户提供PC网页和mobile网页,但目前受交互、兼容和流量等因素影响,PC页在移动终端中的直接浏览体验较差。因此,百度移动搜索对缺乏可替代mobile资源的PC页进行格式转码,将其转换为适合手机浏览的mobile页,使其能够在移动终端浏览器有较好的浏览体验。为了最大程度改善PC页在手机上的浏览体验,转码时会去除PC页中不能在手机浏览器上浏览的内容,并改善不适用mobile的交互功能。目前不仅百度移动搜索提供转码技术,各大搜索引擎均有并提供类似的技术。


    那么,如果站长不希望自己的站点被转码、依然希望手机端用户浏览PC页该如何操作呢?可以使用no-transform协议,no-transform协议为如下两种形式:


    第一种,HTTPResponse中显式声明Cache-control为no-transform。


    第二种,meta标签中显式声明Cache-control为no-tranform,格式为:


    <head>


    <meta http-equiv="Cache-Control" content="no-transform"/>


    </head>


    如果站点不希望页面被转码,可添加此协议,当用户通过百度移动搜索进入该网站时会进入原网页浏览。


    还有一种情况,即站点本身有对应的mobile页面所以不希望被转码时,建议站长使用百度移动搜索的移动适配服务,百度会帮助用户直接进入对应的mobile页面。

    ','','','',1476454369,1476064353,'禁止,百度,移动,搜索,对,网页,进行,转,码,的,方法','','在百度移动搜索引擎中,为了更好地满足用户需求,会同时为用户提供PC网页和mobile网页,但目前受交互、兼容和流量等因素影响,PC页在移动终端中的直接浏览体验较差。因此,百度移动搜',0,0,0,50),(12,4,0,384,'网站内容创作的大忌','

    网站制作内容是一件持续性投入的工作,在人力、技术、财力上都需要较大投入,一些站点急于求成寻找捷径,制作了很多垃圾内容,最终被搜索引擎惩罚,可谓得不偿失。希望站长抛弃以下行为,从《百度网页搜索质量白皮书》中寻找答案。


    1,站内大量重复内容:很多网站,尤其是商业网站,往往使用同一个模板,不同网页的主体内容高度相似或相同,仅一些TITLE等标签进行了改变。比如一些招投标网站,为了让更多的地区得到投标内容,他们制作了大量页面,标题采用地区+内容的方式,而页面的主体内容都是完全相同的。再如下图,同样仅标题和图片不同,主体内容相对,对于百度搜索引擎来说,都属于站内大量重复内容。


    2,利用与站点无关的热词引流:有些网站,尤其是新闻源站点紧盯百度的时效性热词,与自己网站文章的标题进行整合,其实就是我们常说的标题党,如“李娜退役隐情体育明星豪宅全揭秘”,用户点击后自然看不到关于李娜退役隐情的内容。此种行为一经发现,网站会被取消新闻源资格,即使内容真的是原创,也会因此行为遭受牵连。


    3,制作低质静态搜索结果页或TAG标签页:很多网站都采用了将站内搜索结果页转为静态页面的方式,整合站点资源,以期形成相关性得分高的页面。但实际来看,很多站点通过站内搜索或者tag生成的页面相关性并不好,或者说产生了许多对百度搜索结果造成负面影响的页面。如果整个目录都存在这样的现象,那么被惩罚的可能性就非常大了。如下方截图,用户搜“列车时刻表”,这样的页面对他来说毫无价值。该页面所在的目录或站点做了很多类似内容的页面,且已经对作用造成恶劣影响时,极容易受到搜索引擎的惩罚。


    4,不负责任的采集:首先需要澄清的是,百度说的拒绝采集,指的是大量复制互联网上已有内容,对采集的内容不加整理即全部推至线上的“偷懒”行为。对于将采集来的内容进行再加工高效整合后,产出内容丰富的高质量网页,百度没有拒绝理由。所以,我们说,百度不喜欢不负责任的偷懒采集行为。


    5,伪原创:上面我们说百度不喜欢不负责任的采集,于是有些人开始动起了伪装原创的脑筋。采集内容后对部分关键词进行批量修改,企图让百度认为这些都是独特内容,然而内容已经是面目全非,甚至无法读通——这也是百度不喜欢的,风险很大。还是刚才说的观点,百度不排斥站点采集内容,关键是如何应用采集的内容和数据,如何整合成用户和搜索引擎都需要的内容才是站长应该考虑的内容。

    ','','','',1483178699,1476454002,'网站,内容,创作,的,大忌','','网站制作内容是一件持续性投入的工作,在人力、技术、财力上都需要较大投入,一些站点急于求成寻找捷径,制作了很多垃圾内容,最终被搜索引擎惩罚,可谓得不偿失。希望站长抛弃以',1,0,1,50),(13,3,0,464,'获得流量的基础——良好收录','

    搜索引擎作为网站的普通访客,对网站的抓取索引、对站点/页面的价值判定以及排序,都是从用户体验出发。因此,原则上网站任何对用户体验的改进,都是对搜索引擎的改进。但是限于当前整体的网络环境以及技术性原因,落实用户体验的具体手段也是需要考虑对搜索引擎友好性的,使之在满足用户体验的前提下也会让搜索引擎更易理解处理。那么,面向移动搜索引擎的网站建设,主要分为三个部分:如何更好的让百度移动搜索收录网站中的内容、如何在移动搜索中获得更好的排名、如何让用户从众多的搜索结果中快速地找到并点击你的网站。简单来说,就是收录、排序、展现。下面我们将从收录开始介绍:


    机器可读:


    与PCspider一样,百度通过一个叫Baiduspider2.0的程序抓取移动互联网上的网页,经过处理后建入移动索引中。当前Baiduspider只能读懂文本内容,flash、图片等非文本内容暂时不能很好处理,放置在flash、图片中的文字,百度只能简单识别。建议使用文本而不是flash、图片、Javascript等来显示重要的内容或链接,搜索引擎暂时无法识别Flash、图片、复杂Javascript中的内容;同时仅存在于flash、Javascript中包含链接指向的网页,百度移动搜索同样可能无法收录。不要在希望搜索引擎可读的地方使用Ajax技术,比如标题、导航、内容等等。


    结构扁平:


    移动站点同样应该有清晰的结构以及更浅的链接深度,这能够使用户快速地获取有用信息,也能使搜索引擎快速理解网站中的每一个页面所处的结构层次。网站结构建议采用树型结构,树型结构通常分为以下三个层级:首页——频道——详情页。


    网状链接:


    理想的网站结构是树型扁平,从首页到内容页的层级尽量少,这样更有利于搜索引擎进行处理。同时,网站内的链接也应该采用网状结构,网站上每个网页都要有指向上、下级网页以及相关内容的链接,避免出现链接孤岛:首页有到频道页的链接,频道页有到首页和普通内容页的链接、普通内容页有到上级频道以及首页的链接、内容相关的网页间互相有链接。网站中每一个网页,都应该是网站结构的一部分,都应该能通过其他网页链接到,这样才能使baiduspider尽可能全地遍历网站内容。同时,重要内容应该距离首页更近,有利于价值传递。


    简单易懂的URL:


    具有良好描述性、规范、简单的URL,有利于用户更方便地记忆和直观判断网页内容,也有利于搜索引擎更有效地抓取和理解网页。网站设计之初,就应该有合理的URL规划。我们认为:


    1、对于移动站首页一般采用m.a.com/3g.a.com/wap.a.com;


    2、频道页采用m.a.com/n1/、m.a.com/n2/(其对应于PC站点的频道n2.a.com),当然,n1、n2直接可读更佳;


    3、详情页的URL尽量短,减少无效参数,例如统计参数等,保证同一页面只有一套URL地址,不同形式的URL301跳转到正常URL上;


    4、Robots封禁baiduspider抓取您不想展示给用户的URL形式以及不愿被百度抓取的私密数据。


    涵盖主旨的anchor:


    anchor即锚文本,对一个链接的描述性文字,锚文本写得越简洁明确,用户越易明白该指向网页的主旨内容。用户发现你的网页是从其他网页上的链接,锚文本是该网页的唯一介绍。跟普通用户相同,搜索引擎spider在刚发现一个网页时,锚文本也是对该页面理解的唯一因素,同时对于最终的排序起到具有一定的作用。


    合理的返回码:


    百度spider在进行抓取和处理时,是根据http协议规范来设置相应逻辑的,常用的几个返回码如下:


    404,百度会认为网页已失效已删除,通常在索引中删除,短期内spider再次遇到也不会抓取。建议内容删除、网页失效等的情况下使用404返回码,告知百度spider该页面已失效。同时网站中尽量减少死链的累计。如果网站临时关闭或抓取压力过大,不要直接返回404,使用503。


    301,永久性重定向,百度会认为当前URL永久跳转至新URL。当网站改版、更换域名等情况下,建议使用301,同时配合使用站长平台的网站改版工具。


    503,百度会认为临时不可访问,不会直接删除,短期内再来检查几次。如果网站临时性关闭建议使用503。

    ','','','',1476454233,1476064847,'获得,流量,的,基础,—,—,良好,收录','','搜索引擎作为网站的普通访客,对网站的抓取索引、对站点/页面的价值判定以及排序,都是从用户体验出发。因此,原则上网站任何对用户体验的改进,都是对搜索引擎的改进。但是限于当',0,0,0,50),(14,4,0,330,'知名站点优化注意事项','

    百度需要优质站点为搜索引擎数据库源源不断地输入物料,同时优质站点也需要从百度获得搜索引擎用户,并将这些搜索引擎用户转化为自己的用户。知名站点可以视为优质站点的一部分,是指已经有较高用户知名度的网站。那么,站点越是知名,就越应从长远考虑,以用户体验为重,积极、合理的进行网站优化,远离作弊和恶意SEO行为,建立与百度更加稳固的合作关系。


    但我们经常可以遗憾地看到一些知名站点使用了不够合理的内容建设方式,比如:大量不同内容的页面均使用同一标题;通过图片的方式展现网页中的重要信息(新闻、联系电话等);重要页面通过flash建设,未使用文字说明等。


    类似的方式,都会使搜索引擎对网站内容的理解造成困难,最终影响网站在搜索引擎中的表现。我们建议您采取对搜索引擎友好的方式进行网站建设,具体内容可参考《百度搜索引擎优化指南》以及《百度搜索引擎网页质量白皮书》。


    知名站点对搜索引擎,乃至整个互联网欢迎的影响通常是巨大的,若使用恶意的作弊行为,其产生的影响也就越坏。例如:


    ●出售首页的友情链接。


    ●大量采集其他网站的内容,原创内容比例极低,甚至大量采集网站主题无关的内容,或机器批量生成没有价值的页面。


    ●网站被大量广告内容占领。


    知名站点一旦有恶意的作弊行为,所产生的恶劣影响将是巨大的,有可能会受到搜索引擎更为严格的惩罚。知名站点更应从长远考虑,提升用户口碑,用高质量的内容赢得用户青睐。不应为了短期的流量,不顾用户的体验,做有损品牌形象的事情。


    此外,知名站点也是各路作弊者的“众矢之的”,容易被恶意利用。站点越知名,被利用的价值就越大。我们建议您建立防范意识,避免由于被作弊者利用引起的不必要风险。


    ●您的站点是否足够安全?当网站被黑客攻击时,是否有足够的应对机制?


    ●由用户贡献内容的功能,是否做好了应对作弊的措施?


    ●对于不想让搜索引擎收录的内容,是否在robot.txt中清晰指明?

    ','百度站长','','',1483178708,1476453609,'知名,站点,优化,注意事项','','百度需要优质站点为搜索引擎数据库源源不断地输入物料,同时优质站点也需要从百度获得搜索引擎用户,并将这些搜索引擎用户转化为自己的用户。知名站点可以视为优质站点的一部分,',0,0,1,50),(15,3,0,433,'获得关键词数据的渠道有哪些','

    上面说到了站点收集关键词的方向,那么通过什么渠道可以获取关键词数据呢。关键词收集也可以叫关键词拓展,其实就是思路的拓展。这个思路在工作岗位中的表现不同:产品运营的角度,可能是个不断深挖行业用户需求、了解需求、站在用户角度想问题设计产品;而从搜索营销、seo角度它则成为深挖行业用户需求的具体体现。那么获取关键词数据的主要渠道有哪些呢:


    1,公开渠道:


    1)几家搜索引擎搜索结果相关搜索、SUG


    2)几家大的社交、媒体(微博)的相关搜索


    3)各搜索引擎的风云榜


    4)竞价关键词获取工具(搜索引擎一般都提供)


    5)百度司南工具


    6)cnzz数据中心(http://data.cnzz.com/);


    2,通过站内工具:


    1)Log日志关键词数据;


    2)站内搜索关键词数据;


    3)商务通、商桥等在线咨询工具内的关键词;


    3,观察竞争对手:


    1)竞争对手网站上的tag页;


    2)竞争对手(尤其是对seo很重视的)站点title;


    3)竞争对手竞价关键词;


    4)竞争对手页面keyword;


    4,购买:


    1)寻找数据公司、工具服务商,购买数据


    5,常识拓展:


    1)问答类(百度知道、知乎)相关问题的提问挖掘


    2)内容评论中的需求挖掘,主题下的评论一定是跟这个主题紧密相关的关注点、bbs评论


    3)通过了解行业用户组合关键词,如:地区+关键词


    最后,就像大家知道的那样,即便这项工作真的很重要,但在如今碎片需求满足程度和信息内容大爆发的情况下,关注关键词背后的深层需求的分析、内容的差异提供、需求针对的产品细化,比不停的扩大关键词量要更重要的多。

    ','','','',1522304646,1476453964,'获得,关键词,数据,的,渠道,有,哪些','','上面说到了站点收集关键词的方向,那么通过什么渠道可以获取关键词数据呢。关键词收集也可以叫关键词拓展,其实就是思路的拓展。这个思路在工作岗位中的表现不同:产品运营的角度',0,0,1,50); /*Table structure for table `fl_attachment` */ @@ -315,6 +317,22 @@ CREATE TABLE `fl_comment` ( /*Data for the table `fl_comment` */ +/*Table structure for table `fl_failed_jobs` */ + +DROP TABLE IF EXISTS `fl_failed_jobs`; + +CREATE TABLE `fl_failed_jobs` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `connection` text COLLATE utf8mb4_unicode_ci NOT NULL, + `queue` text COLLATE utf8mb4_unicode_ci NOT NULL, + `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL, + `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL, + `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='任务执行失败表'; + +/*Data for the table `fl_failed_jobs` */ + /*Table structure for table `fl_feedback` */ DROP TABLE IF EXISTS `fl_feedback`; @@ -328,11 +346,11 @@ CREATE TABLE `fl_feedback` ( `mobile` varchar(20) NOT NULL DEFAULT '' COMMENT '手机号码,选填', `type` varchar(20) NOT NULL DEFAULT '' COMMENT '意见反馈类型,选填', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; /*Data for the table `fl_feedback` */ -insert into `fl_feedback`(`id`,`content`,`add_time`,`user_id`,`title`,`mobile`,`type`) values (1,'发过火对光反射',4294967295,127,'','',''),(3,'content六角恐龙',4294967295,1,'title螺丝款计划','',''),(4,'asfa',4294967295,3,'','',''),(7,'撒大哥发的撒',1527054191,1,'标题打算','',''); +insert into `fl_feedback`(`id`,`content`,`add_time`,`user_id`,`title`,`mobile`,`type`) values (1,'内容内容内容',1599902268,1,'标题标题标题','13599123456','产品建议'); /*Table structure for table `fl_friendlink` */ @@ -341,15 +359,15 @@ DROP TABLE IF EXISTS `fl_friendlink`; CREATE TABLE `fl_friendlink` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `webname` varchar(60) NOT NULL DEFAULT '' COMMENT '友情链接名称', - `url` varchar(100) NOT NULL DEFAULT '' COMMENT '友情链接url', - `group_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '分组id', + `url` varchar(100) NOT NULL DEFAULT '' COMMENT '友情链接URL', + `group_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '分组ID', `listorder` int(5) unsigned NOT NULL DEFAULT '0' COMMENT '排序', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='友情链接表'; /*Data for the table `fl_friendlink` */ -insert into `fl_friendlink`(`id`,`webname`,`url`,`group_id`,`listorder`) values (1,'股票知识','http://www.1104.org/',0,0),(2,'炒股入门知识','http://www.pe7.org/',0,0); +insert into `fl_friendlink`(`id`,`webname`,`url`,`group_id`,`listorder`) values (1,'百度','https://www.baidu.com/',0,0),(2,'知乎','https://www.zhihu.com/',0,0); /*Table structure for table `fl_goods` */ @@ -357,7 +375,7 @@ DROP TABLE IF EXISTS `fl_goods`; CREATE TABLE `fl_goods` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `typeid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '栏目id', + `typeid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '栏目ID', `tuijian` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '推荐等级', `click` int(8) unsigned NOT NULL DEFAULT '0' COMMENT '点击量', `title` varchar(150) NOT NULL DEFAULT '' COMMENT '标题', @@ -368,7 +386,7 @@ CREATE TABLE `fl_goods` ( `pubdate` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间', `keywords` varchar(60) NOT NULL DEFAULT '' COMMENT '关键词', - `seotitle` varchar(150) NOT NULL DEFAULT '' COMMENT 'seo标题', + `seotitle` varchar(150) NOT NULL DEFAULT '' COMMENT 'SEO标题', `description` varchar(240) NOT NULL DEFAULT '' COMMENT '描述', `status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '商品状态 0正常 1已删除 2下架 3申请上架', `shipping_fee` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '运费', @@ -394,7 +412,7 @@ CREATE TABLE `fl_goods` ( /*Data for the table `fl_goods` */ -insert into `fl_goods`(`id`,`typeid`,`tuijian`,`click`,`title`,`body`,`sn`,`price`,`litpic`,`pubdate`,`add_time`,`keywords`,`seotitle`,`description`,`status`,`shipping_fee`,`market_price`,`goods_number`,`user_id`,`sale`,`cost_price`,`goods_weight`,`point`,`comments`,`promote_start_date`,`promote_price`,`promote_end_date`,`goods_img`,`warn_number`,`spec`,`listorder`,`brand_id`) values (1,2,1,5726,'示例产品一','

    是的发生

    ','sn123456','45000.00','/uploads/2018/04/1.jpg',1512273964,1496577749,'示例,产品,一','','是的发生',0,'0.00','50000.00',99,1,123,'0.00','0.00',0,0,0,'0.00',0,'/uploads/2017/06/201706041951031181.jpg',0,'',50,0),(2,1,1,58,'示例产品二','说的是','sn987','1.00','/uploads/2018/04/2.jpg',1496578330,1496578313,'产品,示例,二','','',0,'3.00','2.00',105,1,67,'0.00','0.00',0,0,0,'0.00',0,'/uploads/2017/06/201706042011354141.jpg',0,'',50,0),(3,1,0,49,'示例产品三','是的发生','sn232143','5.10','/uploads/2018/04/3.jpg',1496578380,1496578380,'示例,产品,三','','',0,'3.00','4.00',103,1,99,'0.00','0.00',0,0,0,'0.00',0,'/uploads/2017/06/201706042012428057.jpg',0,'',50,1),(4,1,0,140,'示例产品四','

    电热熔

    ','sn9809702','5.00','/uploads/2018/04/4.jpg',1519736409,1496578429,'示例,产品,四','','电热熔',0,'3.00','6.00',89,1,345,'0.00','0.00',0,0,1518435963,'2.00',1519905139,'/uploads/2017/06/201706042013331349.jpg',0,'',50,0),(5,1,0,69,'示例产品五','

    就回家好看

    ','kjkhk3','989.00','/uploads/2018/04/5.jpg',1527237789,1522849066,'示例,产品,五','','就回家好看',0,'898.00','98.00',8987,1,1234,'0.00','0.00',0,0,1523281235,'909.00',1524750039,'/uploads/2018/04/5.jpg',1,'',50,0); +insert into `fl_goods`(`id`,`typeid`,`tuijian`,`click`,`title`,`body`,`sn`,`price`,`litpic`,`pubdate`,`add_time`,`keywords`,`seotitle`,`description`,`status`,`shipping_fee`,`market_price`,`goods_number`,`user_id`,`sale`,`cost_price`,`goods_weight`,`point`,`comments`,`promote_start_date`,`promote_price`,`promote_end_date`,`goods_img`,`warn_number`,`spec`,`listorder`,`brand_id`) values (1,2,1,5726,'示例产品一','

    是的发生

    ','sn123456','45000.00','/uploads/2018/04/1.jpg',1512273964,1496577749,'示例,产品,一','','是的发生',0,'0.00','50000.00',99,1,123,'0.00','0.00',0,0,0,'0.00',0,'/uploads/2017/06/201706041951031181.jpg',0,'',50,0),(2,1,1,59,'示例产品二','说的是','sn987','1.00','/uploads/2018/04/2.jpg',1496578330,1496578313,'产品,示例,二','','',0,'3.00','2.00',105,1,67,'0.00','0.00',0,0,0,'0.00',0,'/uploads/2017/06/201706042011354141.jpg',0,'',50,0),(3,1,0,51,'示例产品三','是的发生','sn232143','5.10','/uploads/2018/04/3.jpg',1496578380,1496578380,'示例,产品,三','','',0,'3.00','4.00',103,1,99,'0.00','0.00',0,0,0,'0.00',0,'/uploads/2017/06/201706042012428057.jpg',0,'',50,1),(4,1,0,141,'示例产品四','

    电热熔

    ','sn9809702','5.00','/uploads/2018/04/4.jpg',1519736409,1496578429,'示例,产品,四','','电热熔',0,'3.00','6.00',89,1,345,'0.00','0.00',0,0,1518435963,'2.00',1519905139,'/uploads/2017/06/201706042013331349.jpg',0,'',50,0),(5,1,0,77,'示例产品五','

    就回家好看

    ','kjkhk3','989.00','/uploads/2018/04/5.jpg',1527237789,1522849066,'示例,产品,五','','就回家好看',0,'898.00','98.00',8987,1,1234,'0.00','0.00',0,0,1523281235,'909.00',1524750039,'/uploads/2018/04/5.jpg',1,'',50,0); /*Table structure for table `fl_goods_brand` */ @@ -405,7 +423,7 @@ CREATE TABLE `fl_goods_brand` ( `pid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '父级id', `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间', `title` varchar(150) NOT NULL DEFAULT '' COMMENT '名称', - `seotitle` varchar(150) NOT NULL DEFAULT '' COMMENT 'seo标题', + `seotitle` varchar(150) NOT NULL DEFAULT '' COMMENT 'SEO标题', `keywords` varchar(60) NOT NULL DEFAULT '' COMMENT '关键词', `description` varchar(240) NOT NULL DEFAULT '' COMMENT '描述', `content` text COMMENT '内容', @@ -466,7 +484,7 @@ CREATE TABLE `fl_goods_type` ( `pid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '父级栏目id', `addtime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间', `name` varchar(30) NOT NULL DEFAULT '' COMMENT '栏目名称', - `seotitle` varchar(150) NOT NULL DEFAULT '' COMMENT 'seo标题', + `seotitle` varchar(150) NOT NULL DEFAULT '' COMMENT 'SEO标题', `keywords` varchar(60) NOT NULL DEFAULT '' COMMENT '关键词', `description` varchar(255) NOT NULL DEFAULT '' COMMENT '描述', `content` text COMMENT '内容', @@ -508,6 +526,24 @@ CREATE TABLE `fl_guestbook` ( insert into `fl_guestbook`(`id`,`title`,`addtime`,`msg`,`status`,`name`,`phone`,`email`) values (3,'在移动搜索展现端获得良好表现的注意事项',1476063946,'移动网站优化和PC网站的很多方面都是相似甚至相同的,但由于移动搜索界面大小受限,移动网站在标题和摘要的撰写上有很多有别有PC端的情况。1,有吸引力的title用户在百度移动搜索中输',0,'','',''),(4,'撰写搜索引擎喜欢的标题',1476063980,'通过观察可以发现,那些可以从搜索引擎获得大批流量的站点来说,SEO思维渗透到了每个岗位,产品人员在提交项目MRD时,网页标题的写法是必不可少的一部分;编辑对文章内容负责的同时',0,'','',''),(5,'Baiduspider主要抓取策略类型',1476064033,'Baiduspider在抓取过程中面对的是一个超级复杂的网络环境,为了使系统可以抓取到尽可能多的有价值资源并保持系统及实际环境中页面的一致性同时不给网站体验造成压力,会设计多种复杂',0,'','',''),(6,'百度移动搜索优化前期准备工作',1476064079,'域名:与PC网站一样,域名是用户对一个网站的第一印象。一个好的移动域名,不仅容易记忆、易于输入,还能方便用户向其他人推荐。域名应尽量简短易懂,越短的域名记忆成本越低,越',0,'','',''),(9,'网页优化的大忌',1476064241,'网页进行正常优化,有助于搜索引擎更好地了解网页主体内容,而网页优化同样是一柄双刃剑,搞不好会造成费力不讨好、甚至被搜索引擎惩罚的后果。在百度看来,网页优化的大忌有三点',0,'','',''),(10,'百度优先建重要库的原则',1476064284,'Baiduspider抓了多少页面并不是最重要的,重要的是有多少页面被建索引库,即我们常说的“建库”。众所周知,搜索引擎的索引库是分层级的,优质的网页会被分配到重要索引库,普通网页',0,'','',''); +/*Table structure for table `fl_jobs` */ + +DROP TABLE IF EXISTS `fl_jobs`; + +CREATE TABLE `fl_jobs` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `queue` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL, + `attempts` tinyint(3) unsigned NOT NULL, + `reserved_at` int(10) unsigned DEFAULT NULL, + `available_at` int(10) unsigned NOT NULL, + `created_at` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `jobs_queue_index` (`queue`(250)) +) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='队列任务表'; + +/*Data for the table `fl_jobs` */ + /*Table structure for table `fl_keyword` */ DROP TABLE IF EXISTS `fl_keyword`; @@ -546,6 +582,27 @@ CREATE TABLE `fl_kuaidi` ( insert into `fl_kuaidi`(`id`,`name`,`code`,`money`,`country`,`des`,`tel`,`website`,`listorder`,`status`) values (1,'顺丰','shunfeng','0.00','','','95338','http://www.sf-express.com',50,0),(2,'EMS','ems','0.00','CN','','11183','http://www.ems.com.cn/',50,0),(3,'申通','shentong','0.00','','','95543','http://www.sto.cn',50,0),(4,'圆通','yuantong','0.00','','','95554','http://www.yto.net.cn/',50,0),(5,'中通','zhongtong','0.00','','','95311','http://www.zto.cn',50,0),(6,'汇通','huitongkuaidi','0.00','','特指百世汇通、百世快递,百世物流(百世快运)请用baishiwuliu','95320','http://www.800bestex.com/',50,0),(7,'韵达','yunda','0.00','','','95546','http://www.yundaex.com',50,0),(8,'宅急送','zhaijisong','0.00','','','400-6789-000','http://www.zjs.com.cn',50,0),(9,'德邦','debangwuliu','0.00','','','95353','http://www.deppon.com',50,0),(10,'天天','tiantian','0.00','','','400-188-8888','http://www.ttkdex.com',50,0),(11,'全峰','quanfengkuaidi','0.00','','','400-100-0001','http://www.qfkd.com.cn',50,0),(12,'邮政小包','youzhengguonei','0.00','','','','',50,0),(13,'国通快递','guotongkuaidi','0.00','','','','',50,0),(14,'快捷快递','kuaijiesudi','0.00','','','','',50,0); +/*Table structure for table `fl_log` */ + +DROP TABLE IF EXISTS `fl_log`; + +CREATE TABLE `fl_log` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '类型:默认0未知,1fladmin,2index,3api,4wap,5weixin', + `ip` varchar(15) NOT NULL DEFAULT '0' COMMENT 'IP', + `domain_name` varchar(60) NOT NULL DEFAULT '' COMMENT '域名', + `url` varchar(255) NOT NULL DEFAULT '' COMMENT 'URL', + `http_method` varchar(10) NOT NULL DEFAULT '' COMMENT '请求方式', + `content` varchar(255) NOT NULL DEFAULT '' COMMENT '操作内容', + `http_referer` varchar(255) NOT NULL DEFAULT '' COMMENT '上个页面的URL', + `login_name` varchar(60) NOT NULL DEFAULT '' COMMENT '管理员名称', + `login_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '管理员ID', + `add_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +/*Data for the table `fl_log` */ + /*Table structure for table `fl_menu` */ DROP TABLE IF EXISTS `fl_menu`; @@ -564,11 +621,11 @@ CREATE TABLE `fl_menu` ( PRIMARY KEY (`id`), KEY `status` (`status`), KEY `parentid` (`pid`) -) ENGINE=InnoDB AUTO_INCREMENT=130 DEFAULT CHARSET=utf8 COMMENT='后台菜单表'; +) ENGINE=InnoDB AUTO_INCREMENT=131 DEFAULT CHARSET=utf8 COMMENT='后台菜单表'; /*Data for the table `fl_menu` */ -insert into `fl_menu`(`id`,`name`,`pid`,`action`,`data`,`type`,`icon`,`des`,`status`,`listorder`) values (1,'文章管理',0,'article_default','',0,'glyphicon glyphicon-pencil','',1,0),(2,'商品管理',0,'goods_default','',0,'glyphicon glyphicon-shopping-cart','',1,10),(3,'菜单管理',0,'menu_default','',0,'glyphicon glyphicon-th-list','',1,20),(4,'用户管理',0,'user_default','',0,'glyphicon glyphicon-user','',1,30),(5,'批量维护',0,'extension_default','',0,'glyphicon glyphicon-cloud','',1,40),(6,'设置',0,'sysconfig_default','',0,'glyphicon glyphicon-wrench','',1,1000),(7,'页面跳转',5,'admin_jump','',1,'','',0,1),(8,'后台首页',5,'admin','',1,'','',0,2),(9,'更新系统参数配置',5,'admin_index_upconfig','',1,'','',0,3),(10,'更新缓存',5,'admin_index_upcache','',1,'','',0,4),(11,'文章列表',1,'admin_article','',1,'','',1,50),(12,'发布文章',1,'admin_article_add','',1,'','',1,50),(13,'发布文章提交',12,'admin_article_doadd','',1,'','',0,50),(14,'文章修改',1,'admin_article_edit','',1,'','',0,50),(15,'文章修改提交',14,'admin_article_doedit','',1,'','',0,50),(16,'文章删除',1,'admin_article_del','',1,'','',0,50),(17,'重复文档检测',1,'admin_article_repetarc','',1,'','',1,50),(18,'文章推荐',1,'admin_article_recommendarc','',1,'','',0,50),(19,'文章是否存在',1,'admin_article_articleexists','',1,'','',0,50),(20,'文章栏目',1,'admin_category','',1,'','',1,50),(21,'文章栏目添加',20,'admin_category_add','',1,'','',0,50),(22,'文章栏目添加提交',21,'admin_category_doadd','',1,'','',0,50),(23,'文章栏目修改',20,'admin_category_edit','',1,'','',0,50),(24,'文章栏目修改提交',23,'admin_category_doedit','',1,'','',0,50),(25,'文章栏目删除',20,'admin_category_del','',1,'','',0,50),(26,'Tag标签管理',5,'admin_tag','',1,'','',1,50),(27,'Tag标签添加',26,'admin_tag_add','',1,'','',0,50),(28,'Tag标签添加提交',27,'admin_tag_doadd','',1,'','',0,50),(29,'Tag标签修改',26,'admin_tag_edit','',1,'','',0,50),(30,'Tag标签修改提交',29,'admin_tag_doedit','',1,'','',0,50),(31,'Tag标签删除',26,'admin_tag_del','',1,'','',0,50),(32,'单页管理',1,'admin_page','',1,'','',1,50),(33,'单页添加',32,'admin_page_add','',1,'','',0,50),(34,'单页添加提交',33,'admin_page_doadd','',1,'','',0,50),(35,'单页修改',32,'admin_page_edit','',1,'','',0,50),(36,'单页修改提交',35,'admin_page_doedit','',1,'','',0,50),(37,'单页删除',32,'admin_page_del','',1,'','',0,50),(38,'商品列表',2,'admin_goods','',1,'','',1,50),(39,'商品添加',2,'admin_goods_add','',1,'','',1,50),(40,'商品添加提交',39,'admin_goods_doadd','',1,'','',0,50),(41,'商品修改',2,'admin_goods_edit','',1,'','',0,50),(42,'商品修改提交',41,'admin_goods_doedit','',1,'','',0,50),(43,'商品删除',2,'admin_goods_del','',1,'','',0,50),(44,'重复商品',2,'admin_goods_recommendarc','',1,'','',0,50),(45,'商品是否存在',2,'admin_goods_goodsexists','',1,'','',0,50),(46,'商品分类',2,'admin_goodstype','',1,'','',1,50),(47,'商品分类添加',46,'admin_goodstype_add','',1,'','',1,50),(48,'商品分类添加提交',47,'admin_goodstype_doadd','',1,'','',0,50),(49,'商品分类修改',46,'admin_producttype_edit','',1,'','',0,50),(50,'商品分类修改提交',42,'admin_producttype_doedit','',1,'','',0,50),(51,'商品分类删除',46,'admin_goodstype_del','',1,'','',0,50),(52,'友情链接',5,'admin_friendlink','',1,'','',1,50),(53,'友情链接添加',52,'admin_friendlink_add','',1,'','',0,50),(54,'友情链接添加提交',53,'admin_friendlink_doadd','',1,'','',0,50),(55,'友情链接修改',52,'admin_friendlink_edit','',1,'','',0,50),(56,'友情链接修改提交',55,'admin_friendlink_doedit','',1,'','',0,50),(57,'友情链接删除',52,'admin_friendlink_del','',1,'','',0,50),(58,'关键词管理',5,'admin_keyword','',1,'','',1,50),(59,'关键词添加',58,'admin_keyword_add','',1,'','',0,50),(60,'关键词添加提交',59,'admin_keyword_doadd','',1,'','',0,50),(61,'关键词修改',58,'admin_keyword_edit','',1,'','',0,50),(62,'关键词修改提交',61,'admin_keyword_doedit','',1,'','',0,50),(63,'关键词删除',58,'admin_keyword_del','',1,'','',0,50),(64,'搜索关键词',5,'admin_searchword','',1,'','',1,50),(65,'搜索关键词添加',64,'admin_searchword_add','',1,'','',0,50),(66,'搜索关键词添加提交',65,'admin_searchword_doadd','',1,'','',0,50),(67,'搜索关键词修改',64,'admin_searchword_edit','',1,'','',0,50),(68,'搜索关键词修改提交',67,'admin_searchword_doedit','',1,'','',0,50),(69,'搜索关键词删除',64,'admin_searchword_del','',1,'','',0,50),(70,'轮播图',5,'admin_slide','',1,'','',1,50),(71,'轮播图添加',70,'admin_slide_add','',1,'','',0,50),(72,'轮播图添加提交',71,'admin_slide_doadd','',1,'','',0,50),(73,'轮播图修改',70,'admin_slide_edit','',1,'','',0,50),(74,'轮播图修改提交',73,'admin_slide_doedit','',1,'','',0,50),(75,'轮播图删除',70,'admin_slide_del','',1,'','',0,50),(76,'在线留言',5,'admin_guestbook','',1,'','',1,50),(77,'在线留言删除',76,'admin_guestbook_del','',1,'','',0,50),(78,'系统基本参数',6,'admin_sysconfig','',1,'','',1,50),(79,'系统参数添加',78,'admin_sysconfig_add','',1,'','',0,50),(80,'系统参数添加提交',79,'admin_sysconfig_doadd','',1,'','',0,50),(81,'系统参数修改',78,'admin_sysconfig_edit','',1,'','',0,50),(82,'系统参数修改提交',81,'admin_sysconfig_doedit','',1,'','',0,50),(83,'系统参数删除',78,'admin_sysconfig_del','',1,'','',0,50),(84,'管理员',4,'admin_admin','',1,'','',1,50),(85,'管理员添加',84,'admin_admin_add','',1,'','',0,50),(86,'管理员添加提交',85,'admin_admin_doadd','',1,'','',0,50),(87,'管理员修改',84,'admin_admin_edit','',1,'','',0,50),(88,'管理员修改提交',87,'admin_admin_doedit','',1,'','',0,50),(89,'管理员删除',84,'admin_admin_del','',1,'','',0,50),(90,'角色管理',4,'admin_adminrole','',1,'','',1,50),(91,'角色添加',90,'admin_adminrole_add','',1,'','',0,50),(92,'角色添加修改',91,'admin_adminrole_doadd','',1,'','',0,50),(93,'角色修改',90,'admin_adminrole_edit','',1,'','',0,50),(94,'角色修改提交',93,'admin_adminrole_doedit','',1,'','',0,50),(95,'角色删除',90,'admin_adminrole_del','',1,'','',0,50),(96,'后台菜单',3,'admin_menu','',1,'','',1,50),(97,'菜单添加',96,'admin_menu_add','',1,'','',0,50),(98,'菜单添加提交',97,'admin_menu_doadd','',1,'','',0,50),(99,'菜单修改',96,'admin_menu_edit','',1,'','',0,50),(100,'菜单修改提交',99,'admin_menu_doedit','',1,'','',0,50),(101,'菜单删除',96,'admin_menu_del','',1,'','',0,50),(102,'权限设置',90,'admin_adminrole_permissions','',1,'','',0,50),(103,'权限设置提交',102,'admin_adminrole_dopermissions','',1,'','',0,50),(104,'欢迎页面',5,'admin_welcome','',1,'','',0,5),(105,'微信开发管理',0,'weixin_default','',0,'glyphicon glyphicon-th-large','',1,50),(106,'微信自定义菜单',105,'admin_weixinmenu','',1,'','',1,50),(107,'商品品牌',2,'admin_goodsbrand','',1,'','',1,50),(108,'品牌添加',107,'admin_goodsbrand_add','',1,'','',0,50),(109,'品牌添加提交',108,'admin_goodsbrand_doadd','',1,'','',0,50),(110,'品牌修改',107,'admin_goodsbrand_edit','',1,'','',0,50),(111,'品牌修改提交',110,'admin_goodsbrand_doedit','',1,'','',0,50),(112,'品牌删除',107,'admin_goodsbrand_del','',1,'','',0,50),(113,'订单管理',0,'order_default','',0,'glyphicon glyphicon-credit-card','',1,50),(114,'订单列表',113,'admin_order','',1,'','',1,50),(115,'订单详情',113,'admin_order_detail','',1,'','',0,50),(116,'订单修改',113,'admin_order_edit','',1,'','',0,50),(117,'订单修改提交',116,'admin_order_doedit','',1,'','',0,50),(118,'会员管理',4,'admin_user','',1,'','',1,50),(119,'提现申请',4,'admin_userwithdraw','',1,'','',1,50),(120,'意见反馈',5,'admin_feedback','',1,'','',1,50),(121,'意见反馈删除',120,'admin_feedback_del','',1,'','',0,50),(122,'快递管理',113,'admin_kuaidi','',1,'','',1,50),(123,'快递添加',122,'admin_kuaidi_add','',1,'','',0,50),(124,'快递修改',122,'admin_kuaidi_edit','',1,'','',0,50),(125,'快递删除',122,'admin_kuaidi_del','',1,'','',0,50),(126,'优惠券管理',2,'admin_bonus','',1,'','',1,50),(127,'优惠券添加',126,'admin_bonus_add','',1,'','',0,50),(128,'优惠券啊修改',126,'admin_bonus_edit','',1,'','',0,50),(129,'优惠券删除',126,'admin_bonus_del','',1,'','',0,50); +insert into `fl_menu`(`id`,`name`,`pid`,`action`,`data`,`type`,`icon`,`des`,`status`,`listorder`) values (1,'文章管理',0,'article_default','',0,'glyphicon glyphicon-pencil','',1,0),(2,'商品管理',0,'goods_default','',0,'glyphicon glyphicon-shopping-cart','',1,10),(3,'菜单管理',0,'menu_default','',0,'glyphicon glyphicon-th-list','',1,20),(4,'用户管理',0,'user_default','',0,'glyphicon glyphicon-user','',1,30),(5,'批量维护',0,'extension_default','',0,'glyphicon glyphicon-cloud','',1,40),(6,'设置',0,'sysconfig_default','',0,'glyphicon glyphicon-wrench','',1,1000),(7,'页面跳转',5,'admin_jump','',1,'','',0,1),(8,'后台首页',5,'admin','',1,'','',0,2),(9,'更新系统参数配置',5,'admin_index_upconfig','',1,'','',0,3),(10,'更新缓存',5,'admin_index_upcache','',1,'','',0,4),(11,'文章列表',1,'admin_article','',1,'','',1,50),(12,'发布文章',1,'admin_article_add','',1,'','',1,50),(13,'发布文章提交',12,'admin_article_doadd','',1,'','',0,50),(14,'文章修改',1,'admin_article_edit','',1,'','',0,50),(15,'文章修改提交',14,'admin_article_doedit','',1,'','',0,50),(16,'文章删除',1,'admin_article_del','',1,'','',0,50),(17,'重复文档检测',1,'admin_article_repetarc','',1,'','',1,50),(18,'文章推荐',1,'admin_article_recommendarc','',1,'','',0,50),(19,'文章是否存在',1,'admin_article_articleexists','',1,'','',0,50),(20,'文章栏目',1,'admin_category','',1,'','',1,50),(21,'文章栏目添加',20,'admin_category_add','',1,'','',0,50),(22,'文章栏目添加提交',21,'admin_category_doadd','',1,'','',0,50),(23,'文章栏目修改',20,'admin_category_edit','',1,'','',0,50),(24,'文章栏目修改提交',23,'admin_category_doedit','',1,'','',0,50),(25,'文章栏目删除',20,'admin_category_del','',1,'','',0,50),(26,'Tag标签管理',5,'admin_tag','',1,'','',1,50),(27,'Tag标签添加',26,'admin_tag_add','',1,'','',0,50),(28,'Tag标签添加提交',27,'admin_tag_doadd','',1,'','',0,50),(29,'Tag标签修改',26,'admin_tag_edit','',1,'','',0,50),(30,'Tag标签修改提交',29,'admin_tag_doedit','',1,'','',0,50),(31,'Tag标签删除',26,'admin_tag_del','',1,'','',0,50),(32,'单页管理',1,'admin_page','',1,'','',1,50),(33,'单页添加',32,'admin_page_add','',1,'','',0,50),(34,'单页添加提交',33,'admin_page_doadd','',1,'','',0,50),(35,'单页修改',32,'admin_page_edit','',1,'','',0,50),(36,'单页修改提交',35,'admin_page_doedit','',1,'','',0,50),(37,'单页删除',32,'admin_page_del','',1,'','',0,50),(38,'商品列表',2,'admin_goods','',1,'','',1,50),(39,'商品添加',2,'admin_goods_add','',1,'','',1,50),(40,'商品添加提交',39,'admin_goods_doadd','',1,'','',0,50),(41,'商品修改',2,'admin_goods_edit','',1,'','',0,50),(42,'商品修改提交',41,'admin_goods_doedit','',1,'','',0,50),(43,'商品删除',2,'admin_goods_del','',1,'','',0,50),(44,'重复商品',2,'admin_goods_recommendarc','',1,'','',0,50),(45,'商品是否存在',2,'admin_goods_goodsexists','',1,'','',0,50),(46,'商品分类',2,'admin_goodstype','',1,'','',1,50),(47,'商品分类添加',46,'admin_goodstype_add','',1,'','',1,50),(48,'商品分类添加提交',47,'admin_goodstype_doadd','',1,'','',0,50),(49,'商品分类修改',46,'admin_producttype_edit','',1,'','',0,50),(50,'商品分类修改提交',42,'admin_producttype_doedit','',1,'','',0,50),(51,'商品分类删除',46,'admin_goodstype_del','',1,'','',0,50),(52,'友情链接',5,'admin_friendlink','',1,'','',1,50),(53,'友情链接添加',52,'admin_friendlink_add','',1,'','',0,50),(54,'友情链接添加提交',53,'admin_friendlink_doadd','',1,'','',0,50),(55,'友情链接修改',52,'admin_friendlink_edit','',1,'','',0,50),(56,'友情链接修改提交',55,'admin_friendlink_doedit','',1,'','',0,50),(57,'友情链接删除',52,'admin_friendlink_del','',1,'','',0,50),(58,'关键词管理',5,'admin_keyword','',1,'','',1,50),(59,'关键词添加',58,'admin_keyword_add','',1,'','',0,50),(60,'关键词添加提交',59,'admin_keyword_doadd','',1,'','',0,50),(61,'关键词修改',58,'admin_keyword_edit','',1,'','',0,50),(62,'关键词修改提交',61,'admin_keyword_doedit','',1,'','',0,50),(63,'关键词删除',58,'admin_keyword_del','',1,'','',0,50),(64,'搜索关键词',5,'admin_searchword','',1,'','',1,50),(65,'搜索关键词添加',64,'admin_searchword_add','',1,'','',0,50),(66,'搜索关键词添加提交',65,'admin_searchword_doadd','',1,'','',0,50),(67,'搜索关键词修改',64,'admin_searchword_edit','',1,'','',0,50),(68,'搜索关键词修改提交',67,'admin_searchword_doedit','',1,'','',0,50),(69,'搜索关键词删除',64,'admin_searchword_del','',1,'','',0,50),(70,'轮播图',5,'admin_slide','',1,'','',1,50),(71,'轮播图添加',70,'admin_slide_add','',1,'','',0,50),(72,'轮播图添加提交',71,'admin_slide_doadd','',1,'','',0,50),(73,'轮播图修改',70,'admin_slide_edit','',1,'','',0,50),(74,'轮播图修改提交',73,'admin_slide_doedit','',1,'','',0,50),(75,'轮播图删除',70,'admin_slide_del','',1,'','',0,50),(76,'在线留言',5,'admin_guestbook','',1,'','',1,50),(77,'在线留言删除',76,'admin_guestbook_del','',1,'','',0,50),(78,'系统基本参数',6,'admin_sysconfig','',1,'','',1,50),(79,'系统参数添加',78,'admin_sysconfig_add','',1,'','',0,50),(80,'系统参数添加提交',79,'admin_sysconfig_doadd','',1,'','',0,50),(81,'系统参数修改',78,'admin_sysconfig_edit','',1,'','',0,50),(82,'系统参数修改提交',81,'admin_sysconfig_doedit','',1,'','',0,50),(83,'系统参数删除',78,'admin_sysconfig_del','',1,'','',0,50),(84,'管理员',4,'admin_admin','',1,'','',1,50),(85,'管理员添加',84,'admin_admin_add','',1,'','',0,50),(86,'管理员添加提交',85,'admin_admin_doadd','',1,'','',0,50),(87,'管理员修改',84,'admin_admin_edit','',1,'','',0,50),(88,'管理员修改提交',87,'admin_admin_doedit','',1,'','',0,50),(89,'管理员删除',84,'admin_admin_del','',1,'','',0,50),(90,'角色管理',4,'admin_adminrole','',1,'','',1,50),(91,'角色添加',90,'admin_adminrole_add','',1,'','',0,50),(92,'角色添加修改',91,'admin_adminrole_doadd','',1,'','',0,50),(93,'角色修改',90,'admin_adminrole_edit','',1,'','',0,50),(94,'角色修改提交',93,'admin_adminrole_doedit','',1,'','',0,50),(95,'角色删除',90,'admin_adminrole_del','',1,'','',0,50),(96,'后台菜单',3,'admin_menu','',1,'','',1,50),(97,'菜单添加',96,'admin_menu_add','',1,'','',0,50),(98,'菜单添加提交',97,'admin_menu_doadd','',1,'','',0,50),(99,'菜单修改',96,'admin_menu_edit','',1,'','',0,50),(100,'菜单修改提交',99,'admin_menu_doedit','',1,'','',0,50),(101,'菜单删除',96,'admin_menu_del','',1,'','',0,50),(102,'权限设置',90,'admin_adminrole_permissions','',1,'','',0,50),(103,'权限设置提交',102,'admin_adminrole_dopermissions','',1,'','',0,50),(104,'欢迎页面',5,'admin_welcome','',1,'','',0,5),(105,'微信开发管理',0,'weixin_default','',0,'glyphicon glyphicon-th-large','',1,50),(106,'微信自定义菜单',105,'admin_weixinmenu','',1,'','',1,50),(107,'商品品牌',2,'admin_goodsbrand','',1,'','',1,50),(108,'品牌添加',107,'admin_goodsbrand_add','',1,'','',0,50),(109,'品牌添加提交',108,'admin_goodsbrand_doadd','',1,'','',0,50),(110,'品牌修改',107,'admin_goodsbrand_edit','',1,'','',0,50),(111,'品牌修改提交',110,'admin_goodsbrand_doedit','',1,'','',0,50),(112,'品牌删除',107,'admin_goodsbrand_del','',1,'','',0,50),(113,'订单管理',0,'order_default','',0,'glyphicon glyphicon-credit-card','',1,50),(114,'订单列表',113,'admin_order','',1,'','',1,50),(115,'订单详情',113,'admin_order_detail','',1,'','',0,50),(116,'订单修改',113,'admin_order_edit','',1,'','',0,50),(117,'订单修改提交',116,'admin_order_doedit','',1,'','',0,50),(118,'会员管理',4,'admin_user','',1,'','',1,50),(119,'提现申请',4,'admin_userwithdraw','',1,'','',1,50),(120,'意见反馈',5,'admin_feedback','',1,'','',1,50),(121,'意见反馈删除',120,'admin_feedback_del','',1,'','',0,50),(122,'快递管理',113,'admin_kuaidi','',1,'','',1,50),(123,'快递添加',122,'admin_kuaidi_add','',1,'','',0,50),(124,'快递修改',122,'admin_kuaidi_edit','',1,'','',0,50),(125,'快递删除',122,'admin_kuaidi_del','',1,'','',0,50),(126,'优惠券管理',2,'admin_bonus','',1,'','',1,50),(127,'优惠券添加',126,'admin_bonus_add','',1,'','',0,50),(128,'优惠券啊修改',126,'admin_bonus_edit','',1,'','',0,50),(129,'优惠券删除',126,'admin_bonus_del','',1,'','',0,50),(130,'操作记录',5,'admin_log','',1,'','',1,50); /*Table structure for table `fl_order` */ @@ -787,7 +844,7 @@ CREATE TABLE `fl_searchword` ( /*Data for the table `fl_searchword` */ -insert into `fl_searchword`(`id`,`name`,`title`,`description`,`content`,`pubdate`,`keywords`,`click`,`litpic`,`template`,`filename`) values (1,'百度金融2','百度金融title2','百度金融description2','

    百度金融content2

    ',1496229526,'百度金融keywords2',250,'/uploads/2017/05/201705311643481302.png','tag2','bdjr2'),(2,'李彦宏','李彦宏title','李彦宏description','

    李彦宏content

    ',1484910609,'李彦宏keywords',361,'','tag','leo'),(3,'asd','asd','asd','

    asdsa

    ',1496229768,'asd',209,'','tag','asd'); +insert into `fl_searchword`(`id`,`name`,`title`,`description`,`content`,`pubdate`,`keywords`,`click`,`litpic`,`template`,`filename`) values (1,'百度金融','百度金融title','百度金融description','

    百度金融content

    ',1600047389,'百度金融keywords',250,'/uploads/2017/05/201705311643481302.png','tag','bdjr'),(2,'李彦宏','李彦宏title','李彦宏description','

    李彦宏content

    ',1484910609,'李彦宏keywords',361,'','tag','leo'); /*Table structure for table `fl_session` */ @@ -939,11 +996,11 @@ CREATE TABLE `fl_token` ( `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `expired_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COMMENT='token表'; +) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 COMMENT='token表'; /*Data for the table `fl_token` */ -insert into `fl_token`(`id`,`token`,`type`,`uid`,`data`,`created_at`,`expired_at`) values (1,'123456',1,1,'','2017-08-07 13:29:01','2020-05-22 11:15:27'),(2,'70a0c1ba8fb4a4c394dd2bdf7d6106ec',2,3,'','2018-03-09 12:22:03','2018-04-08 12:22:03'),(3,'0ecd2dd522d64f10d39ba95d4fb6adc2',2,3,'','2018-03-30 14:38:19','2020-04-29 14:38:19'),(4,'1f23ce0f617ea608ce69ba826169ab95',2,3,'','2018-04-08 10:34:19','2018-05-08 10:34:19'),(5,'87da4022a6358f024c8241405e38164b',2,3,'','2018-05-22 19:30:52','2018-06-21 19:30:52'),(6,'201fc40be3e1ea2d062e815510dc5b20',2,3,'','2018-05-25 15:37:13','2018-06-24 15:37:13'),(7,'4a8c36907b5589537d5f96509a707945',2,3,'','2018-05-26 09:26:09','2018-06-25 09:26:09'),(8,'16731ebfc9807efa08469711a61b0922',2,3,'','2018-05-26 09:34:39','2018-06-25 09:34:39'),(9,'9417f354ef61e336ac556184a44e15a8',2,3,'','2018-05-30 11:45:35','2018-06-29 11:45:35'); +insert into `fl_token`(`id`,`token`,`type`,`uid`,`data`,`created_at`,`expired_at`) values (1,'123456',1,1,'','2017-08-07 13:29:01','2020-05-22 11:15:27'),(2,'70a0c1ba8fb4a4c394dd2bdf7d6106ec',2,3,'','2018-03-09 12:22:03','2018-04-08 12:22:03'),(3,'0ecd2dd522d64f10d39ba95d4fb6adc2',2,3,'','2018-03-30 14:38:19','2020-04-29 14:38:19'),(4,'1f23ce0f617ea608ce69ba826169ab95',2,3,'','2018-04-08 10:34:19','2018-05-08 10:34:19'),(5,'87da4022a6358f024c8241405e38164b',2,3,'','2018-05-22 19:30:52','2018-06-21 19:30:52'),(6,'201fc40be3e1ea2d062e815510dc5b20',2,3,'','2018-05-25 15:37:13','2018-06-24 15:37:13'),(7,'4a8c36907b5589537d5f96509a707945',2,3,'','2018-05-26 09:26:09','2018-06-25 09:26:09'),(8,'16731ebfc9807efa08469711a61b0922',2,3,'','2018-05-26 09:34:39','2018-06-25 09:34:39'),(9,'9417f354ef61e336ac556184a44e15a8',2,3,'','2018-05-30 11:45:35','2018-06-29 11:45:35'),(10,'feeb98b07e22e1fad58e8a12810c2dca',2,1,'','2020-09-14 09:44:09','2020-10-14 09:44:09'),(11,'8f13c38aa4c3077a740823faf0fc360c',2,1,'','2020-09-14 14:06:38','2020-10-14 14:06:38'); /*Table structure for table `fl_user` */ @@ -985,7 +1042,7 @@ CREATE TABLE `fl_user` ( /*Data for the table `fl_user` */ -insert into `fl_user`(`id`,`email`,`user_name`,`password`,`pay_password`,`head_img`,`sex`,`birthday`,`commission`,`money`,`frozen_money`,`point`,`rank_points`,`address_id`,`add_time`,`user_rank`,`parent_id`,`nickname`,`mobile`,`status`,`group_id`,`updated_at`,`signin_time`,`openid`,`unionid`,`push_id`,`refund_account`,`refund_name`,`consumption_money`) values (1,'374861669@qq.com','FLi','e10adc3949ba59abbe56e057f20f883e','e10adc3949ba59abbe56e057f20f883e','/uploads/2018/05/201805260914494190.jpg',0,'1960-03-03','0.00','1000.00','0.00',25,0,1,0,0,3,'撒大哥','15280719357',1,0,1527298450,'2018-06-02 09:02:28','','','','','','0.00'),(2,'vip@ecshop.com','vip','e10adc3949ba59abbe56e057f20f883e','e10adc3949ba59abbe56e057f20f883e','/uploads/2017/06/201706041951031181.jpg',0,'1949-01-01','0.00','0.00','0.00',0,0,0,0,0,3,'','15280719356',2,0,4294967295,'2018-03-27 16:55:20','','','','','','0.00'),(3,'ecshop@ecshop.com','ecshop','e10adc3949ba59abbe56e057f20f883e','e10adc3949ba59abbe56e057f20f883e','/uploads/2018/05/201805260945305551.jpg',2,'1990-01-01','12.00','772.00','0.00',0,0,18,0,0,0,'阿什顿','15280719358',1,0,1527299130,'2018-03-27 16:55:20','','','','1234','4321','0.00'),(4,'','20180602u4','e10adc3949ba59abbe56e057f20f883e','','http://thirdwx.qlogo.cn/mmopen/vi_32/FyS7V79tMKK1DxXS3bDOdsy9q6PSey4xfmVeNbB6XrBGEu9HkpX4jxKMc1oflLsicgGePtdtTWic5dOibTib6KibA7g/132',1,'1990-01-01','0.00','0.00','0.00',0,0,0,1527910417,0,0,'林一峰','',1,0,0,NULL,'ocR9zwaV199hmpx1ZguixWV-kMeM','','','','','0.00'); +insert into `fl_user`(`id`,`email`,`user_name`,`password`,`pay_password`,`head_img`,`sex`,`birthday`,`commission`,`money`,`frozen_money`,`point`,`rank_points`,`address_id`,`add_time`,`user_rank`,`parent_id`,`nickname`,`mobile`,`status`,`group_id`,`updated_at`,`signin_time`,`openid`,`unionid`,`push_id`,`refund_account`,`refund_name`,`consumption_money`) values (1,'374861669@qq.com','FLi','e10adc3949ba59abbe56e057f20f883e','e10adc3949ba59abbe56e057f20f883e','/uploads/2018/05/201805260914494190.jpg',0,'1960-03-03','0.00','1000.00','0.00',25,0,1,0,0,3,'大货','15280719357',1,0,1600051029,'2018-06-02 09:02:28','','','','','','0.00'),(2,'vip@ecshop.com','vip','e10adc3949ba59abbe56e057f20f883e','e10adc3949ba59abbe56e057f20f883e','/uploads/2017/06/201706041951031181.jpg',0,'1949-01-01','0.00','0.00','0.00',0,0,0,0,0,3,'','15280719356',2,0,4294967295,'2018-03-27 16:55:20','','','','','','0.00'),(3,'ecshop@ecshop.com','ecshop','e10adc3949ba59abbe56e057f20f883e','e10adc3949ba59abbe56e057f20f883e','/uploads/2018/05/201805260945305551.jpg',2,'1990-01-01','12.00','772.00','0.00',0,0,18,0,0,0,'阿什顿','15280719358',1,0,1527299130,'2018-03-27 16:55:20','','','','1234','4321','0.00'),(4,'','20180602u4','e10adc3949ba59abbe56e057f20f883e','','http://thirdwx.qlogo.cn/mmopen/vi_32/FyS7V79tMKK1DxXS3bDOdsy9q6PSey4xfmVeNbB6XrBGEu9HkpX4jxKMc1oflLsicgGePtdtTWic5dOibTib6KibA7g/132',1,'1990-01-01','0.00','0.00','0.00',0,0,0,1527910417,0,0,'林一峰','',1,0,0,NULL,'ocR9zwaV199hmpx1ZguixWV-kMeM','','','','','0.00'); /*Table structure for table `fl_user_address` */ diff --git a/resources/views/admin/UserWithdraw/add.blade.php b/resources/views/admin/UserWithdraw/add.blade.php deleted file mode 100644 index 772a67f..0000000 --- a/resources/views/admin/UserWithdraw/add.blade.php +++ /dev/null @@ -1,64 +0,0 @@ -@extends('admin.layouts.app') -@section('title', '管理员添加') - -@section('content') -
    管理员列表 > 管理员添加
    - -
    {{ csrf_field() }} - - - - - - - - - - - - - - - - - - - - - -
    用户名:
    密码:
    邮箱:
    角色: - -
      
    - -@endsection \ No newline at end of file diff --git a/resources/views/admin/UserWithdraw/edit.blade.php b/resources/views/admin/UserWithdraw/edit.blade.php deleted file mode 100644 index 65b5341..0000000 --- a/resources/views/admin/UserWithdraw/edit.blade.php +++ /dev/null @@ -1,67 +0,0 @@ -@extends('admin.layouts.app') -@section('title', '管理员修改') - -@section('content') -
    管理员列表 > 管理员修改
    - -
    {{ csrf_field() }} - - - - - - - - - - - - - - - - - - - - - -
    用户名:" class="required" style="width:30%" placeholder="在此输入用户名">
    密码:
    邮箱:" style="width:30%">
    角色: - -
      
    - -@endsection \ No newline at end of file diff --git a/resources/views/admin/admin/edit.blade.php b/resources/views/admin/admin/edit.blade.php index 07b0c42..846b464 100644 --- a/resources/views/admin/admin/edit.blade.php +++ b/resources/views/admin/admin/edit.blade.php @@ -9,7 +9,7 @@ 用户名: - + 密码: diff --git a/resources/views/admin/admin/edit222.blade.php b/resources/views/admin/admin/edit222.blade.php deleted file mode 100644 index 0bdafea..0000000 --- a/resources/views/admin/admin/edit222.blade.php +++ /dev/null @@ -1,58 +0,0 @@ -密码修改_后台管理@include('admin.common.header') -
    -
    - - -
    -

    密码修改

    -
    {{ csrf_field() }} - - - - - - - - - - - - - - - - - - - - - -
    用户名:" style="width:30%">
    旧密码:
    新密码:
    确认密码:
      
    -
    - - \ No newline at end of file diff --git a/resources/views/admin/admin/index.blade.php b/resources/views/admin/admin/index.blade.php index c01e433..1c67686 100644 --- a/resources/views/admin/admin/index.blade.php +++ b/resources/views/admin/admin/index.blade.php @@ -15,10 +15,10 @@ id; ?> -username; ?> +name; ?> email; ?> status_text; ?> -修改id<>1){ ?> | 删除 +修改id <> 1) { ?> | 删除 diff --git a/resources/views/admin/common/header.blade.php b/resources/views/admin/common/header.blade.php index 128441a..be1c2e3 100644 --- a/resources/views/admin/common/header.blade.php +++ b/resources/views/admin/common/header.blade.php @@ -8,5 +8,5 @@ 网站主页 更新缓存 注销 -您好: +您好: \ No newline at end of file diff --git a/resources/views/admin/index/index.blade.php b/resources/views/admin/index/index.blade.php index 56c32a6..1f66cb3 100644 --- a/resources/views/admin/index/index.blade.php +++ b/resources/views/admin/index/index.blade.php @@ -9,7 +9,7 @@ 网站主页 更新缓存 注销 -您好: +您好:
    diff --git a/resources/views/admin/log/index.blade.php b/resources/views/admin/log/index.blade.php new file mode 100644 index 0000000..3cbd258 --- /dev/null +++ b/resources/views/admin/log/index.blade.php @@ -0,0 +1,50 @@ +@extends('admin.layouts.app') +@section('title', '操作记录列表') + +@section('content') +

    操作记录列表 count(); ?> 条

    +[ 后台日志 前台日志 API日志 ]
    + +
    +
    + +
    + +
    +
    +
    + +count() > 0) { ?> +
    + + + + + + + + + + + + + + + + + + + + + +
    ID模块操作者操作记录来源IP地址操作时间操作
    id; ?>type_text; ?>login_name)) { echo $row->login_name; } else { echo '未登录'; } ?>http_method; ?>url; ?> content) { echo ' - ' . htmlentities($row->content, ENT_QUOTES, "UTF-8"); } ?>http_referer; ?>ip; ?> 查看add_time); ?>删除
    + + + +@endsection \ No newline at end of file diff --git a/resources/views/home/index/detail.blade.php b/resources/views/home/article/detail.blade.php similarity index 100% rename from resources/views/home/index/detail.blade.php rename to resources/views/home/article/detail.blade.php diff --git a/resources/views/home/index/arclist.blade.php b/resources/views/home/article/index.blade.php similarity index 100% rename from resources/views/home/index/arclist.blade.php rename to resources/views/home/article/index.blade.php diff --git a/resources/views/home/index/brandList.blade.php b/resources/views/home/goods/brand_list.blade.php similarity index 94% rename from resources/views/home/index/brandList.blade.php rename to resources/views/home/goods/brand_list.blade.php index 5d8b6ff..9412b41 100644 --- a/resources/views/home/index/brandList.blade.php +++ b/resources/views/home/goods/brand_list.blade.php @@ -14,13 +14,13 @@
    @include('home.common.footer') diff --git a/resources/views/home/index/goods.blade.php b/resources/views/home/goods/detail.blade.php similarity index 100% rename from resources/views/home/index/goods.blade.php rename to resources/views/home/goods/detail.blade.php diff --git a/resources/views/home/index/goodslist.blade.php b/resources/views/home/goods/index.blade.php similarity index 100% rename from resources/views/home/index/goodslist.blade.php rename to resources/views/home/goods/index.blade.php diff --git a/resources/views/home/index/index.blade.php b/resources/views/home/index/index.blade.php index 73f9c2e..c1079c8 100644 --- a/resources/views/home/index/index.blade.php +++ b/resources/views/home/index/index.blade.php @@ -1,5 +1,5 @@ -<?php echo sysconfig('CMS_WEBNAME'); ?> +<?php echo sysconfig('CMS_SEOTITLE'); ?> @include('home.common.header') - +
    - $v){ ?> + $v) { ?>
    <?php echo $v['title']; ?>
    @@ -81,13 +81,13 @@ var swiper = new Swiper('.swiper-container', {
    • - +
      234100件已付款   仅剩1天
    • - +
      234100件已付款   仅剩1天
      diff --git a/resources/views/home/index/page.blade.php b/resources/views/home/page/detail.blade.php similarity index 100% rename from resources/views/home/index/page.blade.php rename to resources/views/home/page/detail.blade.php diff --git a/resources/views/home企业/index/test.blade.php b/resources/views/home企业/index/test.blade.php index 33bebab..2133166 100644 --- a/resources/views/home企业/index/test.blade.php +++ b/resources/views/home企业/index/test.blade.php @@ -1,6 +1,6 @@ 笔记本电脑相关知识 -
      {{ csrf_field() }} +{{ csrf_field() }} diff --git a/resources/views/wap/index/detail.blade.php b/resources/views/wap/article/detail.blade.php similarity index 100% rename from resources/views/wap/index/detail.blade.php rename to resources/views/wap/article/detail.blade.php diff --git a/resources/views/wap/index/category.blade.php b/resources/views/wap/article/index.blade.php similarity index 100% rename from resources/views/wap/index/category.blade.php rename to resources/views/wap/article/index.blade.php diff --git a/resources/views/wap/common/header.blade.php b/resources/views/wap/common/header.blade.php index e148c26..2f0c536 100644 --- a/resources/views/wap/common/header.blade.php +++ b/resources/views/wap/common/header.blade.php @@ -1,6 +1,6 @@ \ No newline at end of file diff --git a/resources/views/wap/index/product.blade.php b/resources/views/wap/goods/detail.blade.php similarity index 100% rename from resources/views/wap/index/product.blade.php rename to resources/views/wap/goods/detail.blade.php diff --git a/resources/views/wap/index/productcat.blade.php b/resources/views/wap/goods/index.blade.php similarity index 100% rename from resources/views/wap/index/productcat.blade.php rename to resources/views/wap/goods/index.blade.php diff --git a/resources/views/wap/index/category2.blade.php b/resources/views/wap/index/category2.blade.php deleted file mode 100644 index 82dd7f2..0000000 --- a/resources/views/wap/index/category2.blade.php +++ /dev/null @@ -1,57 +0,0 @@ - -<?php echo $post['seotitle'];if($page!=0){echo ' '.($page+1);} ?>" />" /> -@include('home.common.header')
      - -

      -
      - -
      -

      热门文章

      换一换
      -
      - -
      -

      猜你喜欢

      换一换
      -
      5,"typeid"=>$post['id'],"orderby"=>'rand()'));if($posts){foreach($posts as $row){ ?>
      $row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>"><?php echo $row['title']; ?>$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>">
      '.$row['writer'].'';}elseif(!empty($row['source'])){echo ''.$row['source'].'';} ?> 阅读()
      - -
      - -@include('home.common.footer') \ No newline at end of file diff --git a/resources/views/wap/index/page.blade.php b/resources/views/wap/page/detail.blade.php similarity index 100% rename from resources/views/wap/index/page.blade.php rename to resources/views/wap/page/detail.blade.php diff --git a/resources/views/weixin/index/test.blade.php b/resources/views/weixin/index/test.blade.php index 33bebab..2133166 100644 --- a/resources/views/weixin/index/test.blade.php +++ b/resources/views/weixin/index/test.blade.php @@ -1,6 +1,6 @@ 笔记本电脑相关知识 -{{ csrf_field() }} +{{ csrf_field() }} diff --git a/routes/web.php b/routes/web.php index 7316100..b3647c0 100644 --- a/routes/web.php +++ b/routes/web.php @@ -15,13 +15,13 @@ Route::group(['domain' => env('APP_SUBDOMAIN'), 'namespace' => 'Wap'], function Route::get('/page404', 'IndexController@page404')->name('wap_page404'); //404页面 Route::get('/tags', 'IndexController@tags')->name('wap_tags'); Route::get('/search/{id}', 'IndexController@search')->name('wap_search'); //搜索页面 - Route::get('/p/{id}', 'IndexController@detail')->name('wap_detail'); //详情页 - Route::get('/cat{cat}/{page}', 'IndexController@category'); //分类页,分页 - Route::get('/cat{cat}', 'IndexController@category')->name('wap_category'); //分类页 + Route::get('/p/{id}', 'ArticleController@detail')->name('wap_detail'); //详情页 + Route::get('/cat{cat}/{page}', 'ArticleController@index'); //分类页,分页 + Route::get('/cat{cat}', 'ArticleController@index')->name('wap_category'); //分类页 Route::get('/tag{tag}/{page}', 'IndexController@tag'); //标签页,分页 Route::get('/tag{tag}', 'IndexController@tag')->name('wap_tag'); //标签页 - Route::get('/page/{id}', 'IndexController@page')->name('wap_singlepage'); //单页 - Route::get('/goods/{id}', 'IndexController@goods')->name('wap_goods'); //商品详情页 + Route::get('/page/{id}', 'PageController@detail')->name('wap_singlepage'); //单页 + Route::get('/goods/{id}', 'GoodsController@detail')->name('wap_goods'); //商品详情页 Route::get('/goodstype{cat}', 'IndexController@goodstype')->name('wap_goodstype'); //产品分类页 Route::get('/sitemap.xml', 'IndexController@sitemap')->name('wap_sitemap'); //sitemap }); @@ -33,20 +33,22 @@ Route::group(['namespace' => 'Home'], function () { Route::get('/page404', 'IndexController@page404')->name('page404'); //404页面 Route::get('/tags', 'IndexController@tags')->name('home_tags'); Route::get('/search/{id}', 'IndexController@search')->name('home_search'); //搜索页面 - Route::get('/p/{id}', 'IndexController@detail')->name('home_detail'); //详情页 + Route::get('/p/{id}', 'ArticleController@detail')->name('home_detail'); //详情页 Route::get('/cat{cat}/{page}', 'IndexController@category'); //分类页,分页 Route::get('/cat{cat}', 'IndexController@category')->name('home_category'); //分类页 - Route::get('/arclist', 'IndexController@arclist')->name('home_arclist'); //文章列表 + Route::get('/arclist', 'ArticleController@index')->name('home_arclist'); //文章列表 Route::get('/tag{tag}/{page}', 'IndexController@tag'); //标签页,分页 Route::get('/tag{tag}', 'IndexController@tag')->name('home_tag'); //标签页 - Route::get('/page/{id}', 'IndexController@page')->name('home_singlepage'); //单页 - Route::get('/goods/{id}', 'IndexController@goods')->name('home_goods'); //商品详情页 - Route::get('/goodslist', 'IndexController@goodslist')->name('home_goodslist'); //产品分类页 - Route::get('/brandlist', 'IndexController@brandList')->name('home_brandlist'); //品牌列表 - Route::get('/sitemap.xml', 'IndexController@sitemap')->name('home_sitemap');//sitemap + Route::get('/page/{id}', 'PageController@detail')->name('home_singlepage'); //单页 + Route::get('/goods/{id}', 'GoodsController@detail')->name('home_goods'); //商品详情页 + Route::get('/goodslist', 'GoodsController@index')->name('home_goodslist'); //产品分类页 + Route::get('/brandlist', 'GoodsController@brand_list')->name('home_brandlist'); //品牌列表 + Route::get('/sitemap.xml', 'IndexController@sitemap')->name('home_sitemap'); //sitemap Route::get('/wx_checksignature', 'IndexController@checksignature')->name('home_wx_checksignature'); - Route::get('/test', 'IndexController@test')->name('home_test'); //测试 + Route::get('/test', 'IndexController@test')->name('home_test'); //测试 + Route::get('/test/queue', 'TestController@queue')->name('home_queue_test'); //队列测试 + Route::get('/test/event', 'TestController@event')->name('home_event_test'); //事件测试 Route::get('/aaa', function () { dd('wap'); }); @@ -128,14 +130,14 @@ Route::group(['prefix' => 'weixin', 'namespace' => 'Weixin', 'middleware' => ['w //无需token验证,全局 Route::group(['middleware' => ['web']], function () { Route::get('/weixin_user_recharge_order_detail', 'Weixin\UserController@userRechargeOrderDetail')->name('weixin_user_recharge_order_detail'); //微信充值支付,为了配合公众号支付授权目录 - Route::post('/dataapi/listarc', 'Api\IndexController@listarc')->name('api_listarc'); - Route::post('/dataapi/customer_login', 'Api\WechatAuthController@customerLogin'); - Route::post('/dataapi/', 'Api\UserController@signin'); //签到 + Route::post('/api/listarc', 'Api\IndexController@listarc')->name('api_listarc'); + Route::post('/api/customer_login', 'Api\WechatAuthController@customerLogin'); + Route::post('/api/', 'Api\UserController@signin'); //签到 }); //API接口路由,无需token验证 -Route::group(['prefix' => 'dataapi', 'namespace' => 'Api', 'middleware' => ['web']], function () { +Route::group(['prefix' => 'api', 'namespace' => 'Api', 'middleware' => ['web']], function () { //各种回调 Route::any('/notify_wxpay_jsapi', 'NotifyController@wxpayJsapi')->name('notify_wxpay_jsapi'); //微信支付回调 //轮播图 @@ -167,7 +169,7 @@ Route::group(['prefix' => 'dataapi', 'namespace' => 'Api', 'middleware' => ['web }); //API接口路由,需token验证 -Route::group(['prefix' => 'dataapi', 'namespace' => 'Api', 'middleware' => ['web','token']], function () { +Route::group(['prefix' => 'api', 'namespace' => 'Api', 'middleware' => ['web','token']], function () { Route::post('/article_add', 'ArticleController@articleAdd'); //添加文章 Route::post('/article_update', 'ArticleController@articleUpdate'); //修改文章 Route::post('/article_delete', 'ArticleController@articleDelete'); //删除文章 @@ -439,6 +441,8 @@ Route::group(['prefix' => 'fladmin', 'namespace' => 'Admin', 'middleware' => ['w Route::post('/dologin', 'LoginController@dologin')->name('admin_dologin'); Route::get('/logout', 'LoginController@logout')->name('admin_logout'); Route::get('/recoverpwd', 'LoginController@recoverpwd')->name('admin_recoverpwd'); + //操作日志 + Route::get('/log', 'LogController@index')->name('admin_log'); //页面跳转 Route::get('/jump', 'LoginController@jump')->name('admin_jump'); //测试