88 changed files with 1492 additions and 1020 deletions
-
20app/Common/function.php
-
35app/Http/Controllers/Api/ArctypeController.php
-
27app/Http/Controllers/Api/ArticleController.php
-
151app/Http/Controllers/Api/BonusController.php
-
116app/Http/Controllers/Api/CartController.php
-
92app/Http/Controllers/Api/FeedBackController.php
-
87app/Http/Controllers/Api/GoodsBrandController.php
-
177app/Http/Controllers/Api/GoodsController.php
-
97app/Http/Controllers/Api/GoodsSearchwordController.php
-
76app/Http/Controllers/Api/GoodsTypeController.php
-
98app/Http/Controllers/Api/PageController.php
-
90app/Http/Controllers/Api/PaymentController.php
-
92app/Http/Controllers/Api/RegionController.php
-
36app/Http/Controllers/Api/SlideController.php
-
1app/Http/Controllers/Api/VerifyCodeController.php
-
2app/Http/Logic/ArctypeLogic.php
-
8app/Http/Logic/ArticleLogic.php
-
13app/Http/Logic/BonusLogic.php
-
135app/Http/Logic/CartLogic.php
-
27app/Http/Logic/GoodsLogic.php
-
11app/Http/Model/Arctype.php
-
10app/Http/Model/Article.php
-
15app/Http/Model/BaseModel.php
-
17app/Http/Model/Bonus.php
-
80app/Http/Model/Cart.php
-
18app/Http/Model/CollectGoods.php
-
31app/Http/Model/Comment.php
-
18app/Http/Model/FeedBack.php
-
11app/Http/Model/Friendlink.php
-
238app/Http/Model/Goods.php
-
11app/Http/Model/GoodsBrand.php
-
12app/Http/Model/GoodsImg.php
-
17app/Http/Model/GoodsSearchword.php
-
18app/Http/Model/GoodsType.php
-
11app/Http/Model/Guestbook.php
-
11app/Http/Model/Keyword.php
-
11app/Http/Model/Kuaidi.php
-
11app/Http/Model/Menu.php
-
11app/Http/Model/Order.php
-
11app/Http/Model/OrderGoods.php
-
11app/Http/Model/Page.php
-
73app/Http/Model/Payment.php
-
36app/Http/Model/Region.php
-
11app/Http/Model/Searchword.php
-
35app/Http/Model/Slide.php
-
16app/Http/Model/SmsLog.php
-
17app/Http/Model/Sysconfig.php
-
11app/Http/Model/Tagindex.php
-
11app/Http/Model/Taglist.php
-
10app/Http/Model/User.php
-
9app/Http/Model/UserAddress.php
-
11app/Http/Model/UserBonus.php
-
11app/Http/Model/UserGoodsHistory.php
-
11app/Http/Model/UserMessage.php
-
11app/Http/Model/UserMoney.php
-
11app/Http/Model/UserPoint.php
-
11app/Http/Model/UserRecharge.php
-
11app/Http/Model/UserRole.php
-
11app/Http/Model/UserWithdraw.php
-
12app/Http/Model/VerifyCode.php
-
11app/Http/Model/WeixinMenu.php
-
2app/Http/Requests/AdminRequest.php
-
4app/Http/Requests/AdminRoleRequest.php
-
5app/Http/Requests/ArctypeRequest.php
-
2app/Http/Requests/ArticleRequest.php
-
9app/Http/Requests/BonusRequest.php
-
10app/Http/Requests/CartRequest.php
-
2app/Http/Requests/CollectGoodsRequest.php
-
8app/Http/Requests/CommentRequest.php
-
5app/Http/Requests/FeedbackRequest.php
-
4app/Http/Requests/FriendlinkRequest.php
-
4app/Http/Requests/GoodsBrandRequest.php
-
2app/Http/Requests/GoodsImgRequest.php
-
14app/Http/Requests/GoodsRequest.php
-
4app/Http/Requests/GoodsSearchwordRequest.php
-
2app/Http/Requests/GoodsTypeRequest.php
-
2app/Http/Requests/GuestbookRequest.php
-
2app/Http/Requests/KuaidiRequest.php
-
4app/Http/Requests/MenuRequest.php
-
14app/Http/Requests/OrderRequest.php
-
2app/Http/Requests/PageRequest.php
-
4app/Http/Requests/PaymentRequest.php
-
6app/Http/Requests/RegionRequest.php
-
2app/Http/Requests/SysconfigRequest.php
-
2app/Http/Requests/TokenRequest.php
-
4app/Http/Requests/VerifyCodeRequest.php
-
5routes/web.php
@ -0,0 +1,97 @@ |
|||
<?php |
|||
namespace App\Http\Controllers\Api; |
|||
use Log; |
|||
use DB; |
|||
use Illuminate\Http\Request; |
|||
use App\Common\ReturnData; |
|||
use App\Common\Helper; |
|||
use App\Common\Token; |
|||
use App\Http\Model\GoodsSearchword; |
|||
use App\Http\Logic\GoodsSearchwordLogic; |
|||
|
|||
class GoodsSearchwordController extends CommonController |
|||
{ |
|||
public function __construct() |
|||
{ |
|||
parent::__construct(); |
|||
} |
|||
|
|||
public function getLogic() |
|||
{ |
|||
return new GoodsSearchwordLogic(); |
|||
} |
|||
|
|||
public function goodsSearchwordList(Request $request) |
|||
{ |
|||
//参数
|
|||
$limit = $request->input('limit', 10); |
|||
$offset = $request->input('offset', 0); |
|||
$where['status'] = 0; |
|||
|
|||
$res = $this->getLogic()->getList($where, [['click', 'desc'],['listorder', 'asc']], '*', $offset, $limit); |
|||
|
|||
/* if($res['count'] > 0) |
|||
{ |
|||
foreach($res['list'] as $k=>$v) |
|||
{ |
|||
|
|||
} |
|||
} */ |
|||
|
|||
return ReturnData::create(ReturnData::SUCCESS, $res); |
|||
} |
|||
|
|||
public function goodsSearchwordDetail(Request $request) |
|||
{ |
|||
//参数
|
|||
if(!checkIsNumber($request->input('id',null))){return ReturnData::create(ReturnData::PARAMS_ERROR);} |
|||
$id = $request->input('id'); |
|||
$where['id'] = $id; |
|||
|
|||
$res = $this->getLogic()->getOne($where); |
|||
if(!$res) |
|||
{ |
|||
return ReturnData::create(ReturnData::RECORD_NOT_EXIST); |
|||
} |
|||
|
|||
return ReturnData::create(ReturnData::SUCCESS,$res); |
|||
} |
|||
|
|||
//添加
|
|||
public function goodsSearchwordAdd(Request $request) |
|||
{ |
|||
if(Helper::isPostRequest()) |
|||
{ |
|||
return $this->getLogic()->add($_POST); |
|||
} |
|||
} |
|||
|
|||
//修改
|
|||
public function goodsSearchwordUpdate(Request $request) |
|||
{ |
|||
if(!checkIsNumber($request->input('id',null))){return ReturnData::create(ReturnData::PARAMS_ERROR);} |
|||
$id = $request->input('id'); |
|||
|
|||
if(Helper::isPostRequest()) |
|||
{ |
|||
unset($_POST['id']); |
|||
$where['id'] = $id; |
|||
|
|||
return $this->getLogic()->edit($_POST,$where); |
|||
} |
|||
} |
|||
|
|||
//删除
|
|||
public function goodsSearchwordDelete(Request $request) |
|||
{ |
|||
if(!checkIsNumber($request->input('id',null))){return ReturnData::create(ReturnData::PARAMS_ERROR);} |
|||
$id = $request->input('id'); |
|||
|
|||
if(Helper::isPostRequest()) |
|||
{ |
|||
$where['id'] = $id; |
|||
|
|||
return $this->getLogic()->del($where); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,98 @@ |
|||
<?php |
|||
namespace App\Http\Controllers\Api; |
|||
use Log; |
|||
use DB; |
|||
use Illuminate\Http\Request; |
|||
use App\Common\ReturnData; |
|||
use App\Common\Helper; |
|||
use App\Common\Token; |
|||
use App\Http\Model\Page; |
|||
use App\Http\Logic\PageLogic; |
|||
|
|||
class PageController extends CommonController |
|||
{ |
|||
public function __construct() |
|||
{ |
|||
parent::__construct(); |
|||
} |
|||
|
|||
public function getLogic() |
|||
{ |
|||
return logic('Page'); |
|||
} |
|||
|
|||
public function pageList(Request $request) |
|||
{ |
|||
//参数
|
|||
$limit = $request->input('limit', 10); |
|||
$offset = $request->input('offset', 0); |
|||
|
|||
$res = $this->getLogic()->getList('', array('listorder', 'asc'), '*', $offset, $limit); |
|||
|
|||
if($res['count']>0) |
|||
{ |
|||
foreach($res['list'] as $k=>$v) |
|||
{ |
|||
$res['list'][$k]->page_detail_url = route('weixin_singlepage',array('id'=>$v->filename)); |
|||
} |
|||
} |
|||
|
|||
return ReturnData::create(ReturnData::SUCCESS,$res); |
|||
} |
|||
|
|||
public function pageDetail(Request $request) |
|||
{ |
|||
//参数
|
|||
if(!checkIsNumber($request->input('id',null))){return ReturnData::create(ReturnData::PARAMS_ERROR);} |
|||
$id = $request->input('id'); |
|||
$where['id'] = $id; |
|||
|
|||
$res = $this->getLogic()->getOne($where); |
|||
if(!$res) |
|||
{ |
|||
return ReturnData::create(ReturnData::RECORD_NOT_EXIST); |
|||
} |
|||
|
|||
return ReturnData::create(ReturnData::SUCCESS,$res); |
|||
} |
|||
|
|||
//添加
|
|||
public function pageAdd(Request $request) |
|||
{ |
|||
if(Helper::isPostRequest()) |
|||
{ |
|||
return $this->getLogic()->add($_POST); |
|||
} |
|||
} |
|||
|
|||
//修改
|
|||
public function pageUpdate(Request $request) |
|||
{ |
|||
if(!checkIsNumber($request->input('id',null))){return ReturnData::create(ReturnData::PARAMS_ERROR);} |
|||
$id = $request->input('id'); |
|||
|
|||
if(Helper::isPostRequest()) |
|||
{ |
|||
unset($_POST['id']); |
|||
$where['id'] = $id; |
|||
//$where['user_id'] = Token::$uid;
|
|||
|
|||
return $this->getLogic()->edit($_POST,$where); |
|||
} |
|||
} |
|||
|
|||
//删除
|
|||
public function pageDelete(Request $request) |
|||
{ |
|||
if(!checkIsNumber($request->input('id',null))){return ReturnData::create(ReturnData::PARAMS_ERROR);} |
|||
$id = $request->input('id'); |
|||
|
|||
if(Helper::isPostRequest()) |
|||
{ |
|||
$where['id'] = $id; |
|||
//$where['user_id'] = Token::$uid;
|
|||
|
|||
return $this->getLogic()->del($where); |
|||
} |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue