diff --git a/app/Constants/v3/OrderState.php b/app/Constants/v3/OrderState.php index f6848f5..718dffc 100644 --- a/app/Constants/v3/OrderState.php +++ b/app/Constants/v3/OrderState.php @@ -68,7 +68,7 @@ class OrderState extends AbstractConstants /** * @Message("订单完成") */ - const FINISH = [self::COMPLETED, self::EVALUATED, self::CANCELED]; + const FINISH = [self::COMPLETED, self::EVALUATED]; /** * @Message("售后/退款") diff --git a/app/Controller/v3/HomeController.php b/app/Controller/v3/HomeController.php index 5a0bc2f..8811f33 100644 --- a/app/Controller/v3/HomeController.php +++ b/app/Controller/v3/HomeController.php @@ -173,4 +173,30 @@ class HomeController extends BaseController return $this->success($data); } + + /** + * 关于懒族 + * about lanzu + */ + public function aboutLanzu() + { + $data = [ + [ + 'id' => 1, + 'title' => '关于懒族', + 'sub_title' => '懒族生活678', + 'path' => 'https://www.baidu.com/s?wd=%E6%87%92%E6%97%8F%E7%94%9F%E6%B4%BB', + 'path_type' => 'webview' + ], + [ + 'id' => 1, + 'title' => '隐私政策', + 'sub_title' => '隐私政策123', + 'path' => 'https://www.baidu.com/s?wd=%E9%9A%90%E7%A7%81%E6%94%BF%E7%AD%96', + 'path_type' => 'webview' + ] + ]; + + return $this->success(['data' => $data]); + } } \ No newline at end of file diff --git a/app/Controller/v3/OrderListController.php b/app/Controller/v3/OrderListController.php index 5aceb5b..08928c7 100644 --- a/app/Controller/v3/OrderListController.php +++ b/app/Controller/v3/OrderListController.php @@ -51,4 +51,11 @@ class OrderListController extends BaseController $list = $this->orderListService->offlineByStore($params['store_id'], $params['tab'], $params['page'], $params['pagesize'],$params['start_time'],$params['end_time']); return $this->success($list); } + + public function offlineForUser(UserOrderListRequest $request) + { + $params = $request->validated(); + $list = $this->orderListService->offlineByUser($params['user_id'], $params['page'], $params['pagesize']); + return $this->success($list); + } } \ No newline at end of file diff --git a/app/JsonRpc/SeparateAccountsServiceInterface.php b/app/JsonRpc/SeparateAccountsServiceInterface.php new file mode 100644 index 0000000..28a8174 --- /dev/null +++ b/app/JsonRpc/SeparateAccountsServiceInterface.php @@ -0,0 +1,10 @@ +separateaccountsService->orderOnlineCompleted($orderMainId, $userId); + + } +} \ No newline at end of file diff --git a/app/Middleware/Auth/UserMiddleware.php b/app/Middleware/Auth/UserMiddleware.php index 2341ceb..6d3da25 100644 --- a/app/Middleware/Auth/UserMiddleware.php +++ b/app/Middleware/Auth/UserMiddleware.php @@ -2,8 +2,12 @@ namespace App\Middleware\Auth; +use App\Model\v3\User; +use App\TaskWorker\SSDBTask; +use Hashids\Hashids; use Hyperf\HttpServer\Contract\RequestInterface as HttpRequest; use Hyperf\HttpServer\Contract\ResponseInterface as HttpResponse; +use Hyperf\Utils\ApplicationContext; use Psr\Container\ContainerInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; @@ -33,6 +37,7 @@ class UserMiddleware implements MiddlewareInterface $this->container = $container; $this->response = $response; $this->request = $request; + make(Hashids::class, ['secret' => config('auth.user.hash_ids_secret')]); } /** @@ -63,5 +68,18 @@ class UserMiddleware implements MiddlewareInterface private function checkLogin() { return true; + + $userToken = $this->request->input('user_token', ''); + $ssdb = ApplicationContext::getContainer()->get(SSDBTask::class); + $exists = $ssdb->exec('exists', $userToken); + if (!$userToken || !$exists) { + return false; + } + + $hashIds = ApplicationContext::getContainer()->get(Hashids::class); + $user = $hashIds->decode($userToken); + $this->request->user = User::find($user[0]); + + return true; } } \ No newline at end of file diff --git a/app/Request/v3/UserOrderListRequest.php b/app/Request/v3/UserOrderListRequest.php index a7401ae..3ac1eae 100644 --- a/app/Request/v3/UserOrderListRequest.php +++ b/app/Request/v3/UserOrderListRequest.php @@ -16,7 +16,7 @@ class UserOrderListRequest extends BaseFormRequest { return [ 'user_id' => 'required|nonempty|integer', - 'tab' => 'nonempty', + 'tab' => '', 'page' => 'required|nonempty', 'pagesize' => 'required|nonempty', ]; diff --git a/app/Service/v3/Implementations/OrderListService.php b/app/Service/v3/Implementations/OrderListService.php index 7bc5b17..cda4943 100644 --- a/app/Service/v3/Implementations/OrderListService.php +++ b/app/Service/v3/Implementations/OrderListService.php @@ -3,8 +3,10 @@ namespace App\Service\v3\Implementations; use App\Constants\v3\OrderState; +use App\Constants\v3\OrderType; use App\Model\v3\OrderMain; use App\Model\v3\Order; +use App\Model\v3\ShoppingCart; use App\Service\v3\Interfaces\OrderListServiceInterface; use Hyperf\Paginator\Paginator; @@ -30,10 +32,7 @@ class OrderListService implements OrderListServiceInterface { $builder = OrderMain::query() ->with(['orderGoods', 'market']) - ->where([ - ['user_id','=',$userId], - ['type','=',1] - ]); + ->where(['user_id' => $userId, 'type' => OrderType::ONLINE]); switch ($tab) { case 'all': break; @@ -58,7 +57,7 @@ class OrderListService implements OrderListServiceInterface public function onlineByStore($storeId, $tab, $page=1, $pagesize=10) { - $builder = Order::Join('lanzu_order_main','lanzu_order.order_main_id','lanzu_order_main.id') + $builder = Order::join('lanzu_order_main','lanzu_order.order_main_id','lanzu_order_main.id') ->select( 'lanzu_order.*', 'lanzu_order_main.address', @@ -113,7 +112,7 @@ class OrderListService implements OrderListServiceInterface public function offlineByStore($storeId, $tab, $page=1, $pagesize=10 ,$start_time = '',$end_time = '') { - $builder = Order::Join('lanzu_order_main','lanzu_order.order_main_id','lanzu_order_main.id') + $builder = Order::join('lanzu_order_main','lanzu_order.order_main_id','lanzu_order_main.id') ->where('store_id', $storeId) ->where('lanzu_order_main.type',4) ->with('user'); @@ -143,4 +142,17 @@ class OrderListService implements OrderListServiceInterface $orders = $paginate->toArray(); return ['has_more_pages' => $paginate->hasMorePages(), 'orders' => $orders['data']]; } + + public function offlineByUser($userId, $page=1, $pagesize=10) + { + $builder = OrderMain::query() + ->with(['orders' => function($query) { + $query->with('store'); + }]) + ->where(['user_id' => $userId, 'type' => OrderType::OFFLINE]); + + $paginate = $builder->paginate($pagesize); + $orders = $paginate->toArray(); + return ['has_more_pages' => $paginate->hasMorePages(), 'orders' => $orders['data']]; + } } \ No newline at end of file diff --git a/app/Service/v3/Implementations/OrderOfflineService.php b/app/Service/v3/Implementations/OrderOfflineService.php index 8ebdaf3..4fdc741 100644 --- a/app/Service/v3/Implementations/OrderOfflineService.php +++ b/app/Service/v3/Implementations/OrderOfflineService.php @@ -60,6 +60,12 @@ class OrderOfflineService implements OrderOfflineServiceInterface $orderMain = OrderMain::query()->create($dataMain); $orderMainId = $orderMain->id; + // 店铺今天的订单数 + $count = Order::query() + ->where(['store_id' => $storeId, 'type' => OrderType::OFFLINE]) + ->whereBetween('created_at', [strtotime(date('Y-m-d 00:00:00')), strtotime(date('Y-m-d 23:59:59'))]) + ->count(); + // 子订单数据 $dataChildren = [ 'order_main_id' => $orderMainId, @@ -67,7 +73,8 @@ class OrderOfflineService implements OrderOfflineServiceInterface 'store_id' => $storeId, 'money' => $money, 'order_num' => date('YmdHis').mt_rand(1000, 9999), - 'note' => '' + 'note' => '', + 'oid' => $count + 1 ]; $orderChild = Order::query()->create($dataChildren); diff --git a/app/Service/v3/Implementations/OrderOnlineService.php b/app/Service/v3/Implementations/OrderOnlineService.php index 8c36c40..b6be44c 100644 --- a/app/Service/v3/Implementations/OrderOnlineService.php +++ b/app/Service/v3/Implementations/OrderOnlineService.php @@ -28,6 +28,7 @@ use App\Service\v3\Interfaces\DeliveryMoneyServiceInterface; use App\Service\v3\Interfaces\GoodsActivityServiceInterface; use App\Service\v3\Interfaces\GoodsServiceInterface; use App\Service\v3\Interfaces\PaymentServiceInterface; +use App\Service\v3\Interfaces\ShopCartUpdateServiceInterface; use App\TaskWorker\SSDBTask; use Exception; use Hyperf\Database\Model\Model; @@ -82,6 +83,12 @@ class OrderOnlineService implements OrderOnlineServiceInterface */ protected $paymentService; + /** + * @Inject + * @var ShopCartUpdateServiceInterface + */ + protected $shopCartUpdateService; + /** * 下单 * @param $marketId @@ -129,7 +136,7 @@ class OrderOnlineService implements OrderOnlineServiceInterface $storeTypeIds[] = (string)$storeType; // 店铺今天的订单数 $count = Order::query() - ->where(['store_id' => $storeId]) + ->where(['store_id' => $storeId, 'type' => OrderType::ONLINE]) ->whereBetween('created_at', [strtotime(date('Y-m-d 00:00:00')), strtotime(date('Y-m-d 23:59:59'))]) ->count(); @@ -320,6 +327,9 @@ class OrderOnlineService implements OrderOnlineServiceInterface Db::commit(); + // 清除购物车 + $this->shopCartUpdateService->doClear($userId, $marketId); + // 支付 return $this->paymentService->do($globalOrderId, $totalAmount, $userId, config('wechat.notify_url.online')); } catch (Exception $e) { diff --git a/app/Service/v3/Implementations/SearchService.php b/app/Service/v3/Implementations/SearchService.php index 4ce8b47..660d9dd 100644 --- a/app/Service/v3/Implementations/SearchService.php +++ b/app/Service/v3/Implementations/SearchService.php @@ -47,7 +47,7 @@ class SearchService implements \App\Service\v3\Interfaces\SearchServiceInterface $builder->select(['id', 'store_id', 'cover_img', 'name', 'spec', 'tags', 'original_price', 'price', 'inventory', 'sales as total_sales']); $paginate = $builder->paginate($params['pagesize']); $goods = $paginate->toArray(); - return ['has_more_pages' => $paginate->hasMorePages(), 'goods' => $goods]; + return ['has_more_pages' => $paginate->hasMorePages(), 'goods' => $goods['data']]; } public function doForStores($params) @@ -86,7 +86,7 @@ class SearchService implements \App\Service\v3\Interfaces\SearchServiceInterface $builder->select(['id', 'logo', 'name']); $paginate = $builder->paginate($params['pagesize']); $stores = $paginate->toArray(); - return ['has_more_pages' => $paginate->hasMorePages(), 'stores' => $stores]; + return ['has_more_pages' => $paginate->hasMorePages(), 'stores' => $stores['data']]; } public function getHotKeywords($type) diff --git a/app/Service/v3/Implementations/ShopCartService.php b/app/Service/v3/Implementations/ShopCartService.php index 2bc754c..5024dcf 100644 --- a/app/Service/v3/Implementations/ShopCartService.php +++ b/app/Service/v3/Implementations/ShopCartService.php @@ -49,29 +49,26 @@ class ShopCartService implements ShopCartServiceInterface foreach ($stores as $key => &$store){ $sotreType = $this->storeService->check($store['id']); if(!$sotreType){ - unset($stores[$key]); continue; } $subtotal = 0; - foreach ($store['shopping_cart'] as &$shopcart){ + foreach ($store['shopping_cart'] as $k => &$shopcart){ + if($shopcart['activity_type'] == 1){ + $goodsType = $this->goodsService->check($shopcart['goods_id']); + }else{ + $goodsType = $this->goodsActivityService->check($shopcart['goods_id'],$shopcart['num'],$shopcart['user_id']); + } + if($goodsType !== true){ + unset($store['shopping_cart'][$k]); + continue; + } if($shopcart['activity_type'] == 1){ $builder = Goods::query(); }else{ $builder = GoodsActivity::query(); } $shopcart['goods'] = $builder->where('id',$shopcart['goods_id'])->first()->toArray(); - foreach ($shopcart['goods'] as $goods){ - if($shopcart['activity_type'] == 1){ - $goodsType = $this->goodsService->check($goods['id']); - }else{ - $goodsType = $this->goodsActivityService->check($goods['id'],$shopcart['num'],$shopcart['user_id']); - } - if($goodsType !== true){ - unset($shopcart['goods'][$key]); - continue; - } - $subtotal+= $shopcart['num'] * $shopcart['goods']['price']; - } + $subtotal+= $shopcart['num'] * $shopcart['goods']['price']; } $store['subtotal'] = $subtotal; $storeArr[] = $store; @@ -100,34 +97,33 @@ class ShopCartService implements ShopCartServiceInterface ->toArray(); $storeArr = []; foreach ($stores as $key => &$store){ + $addStore = false; $sotreType = $this->storeService->check($store['id']); if(!$sotreType){ - unset($stores[$key]); - continue; + $addStore = true; } - $subtotal = 0; - foreach ($store['shopping_cart'] as &$shopcart){ + foreach ($store['shopping_cart'] as $k => &$shopcart){ + if($shopcart['activity_type'] == 1){ + $goodsType = $this->goodsService->check($shopcart['goods_id']); + }else{ + $goodsType = $this->goodsActivityService->check($shopcart['goods_id'],$shopcart['num'],$shopcart['user_id']); + } + if($goodsType === true){ + unset($store['shopping_cart'][$k]); + continue; + } + $addStore = true; if($shopcart['activity_type'] == 1){ $builder = Goods::query(); }else{ $builder = GoodsActivity::query(); } $shopcart['goods'] = $builder->where('id',$shopcart['goods_id'])->first()->toArray(); - foreach ($shopcart['goods'] as $goods){ - if($shopcart['activity_type'] == 1){ - $goodsType = $this->goodsService->check($goods['id']); - }else{ - $goodsType = $this->goodsActivityService->check($goods['id'],$shopcart['num'],$shopcart['user_id']); - } - if($goodsType !== true){ - unset($shopcart['goods'][$key]); - continue; - } - $subtotal+= $shopcart['num'] * $shopcart['goods']['price']; - } + $shopcart['goods']['invalid_cause'] = $goodsType; + } + if($addStore){ + $storeArr[] = $store; } - $store['subtotal'] = $subtotal; - $storeArr[] = $store; } return $storeArr; } diff --git a/app/Service/v3/Implementations/ShopCartUpdateService.php b/app/Service/v3/Implementations/ShopCartUpdateService.php index 38e1a36..baa50e1 100644 --- a/app/Service/v3/Implementations/ShopCartUpdateService.php +++ b/app/Service/v3/Implementations/ShopCartUpdateService.php @@ -47,4 +47,14 @@ class ShopCartUpdateService implements ShopCartUpdateServiceInterface $shopcartIdsArr = explode(',',$shopcartIds); return ShoppingCart::destroy($shopcartIdsArr); } + + /** + * 清空购物车 + * @param $userId + * @param $marketId + */ + public function doClear($userId, $marketId) + { + + } } \ No newline at end of file diff --git a/app/Service/v3/Implementations/WxLoginService.php b/app/Service/v3/Implementations/WxLoginService.php index 11f8e69..97a0e3a 100644 --- a/app/Service/v3/Implementations/WxLoginService.php +++ b/app/Service/v3/Implementations/WxLoginService.php @@ -35,20 +35,24 @@ class WxLoginService implements \App\Service\v3\Interfaces\WxLoginServiceInterfa )->toArray(); // 登录成功 - $hash = new Hashids(config('hash_ids_secret')); - $hashIds = $hash->encode((int)$user['id']); + $hash = ApplicationContext::getContainer()->get(Hashids::class); + $hashIds = $hash->encode((int)$user['id'], time()); $user['user_token'] = $hashIds; + $ssdb = ApplicationContext::getContainer()->get(SSDBTask::class); + $ssdb->exec('setnx', $hashIds, 1); + $ssdb->exec('expire', $hashIds, config('auth.user.expire_time')); + $return = array_merge($user, $result); + $kvs = []; foreach ($return as $k => $v) { $kvs[] = $k; $kvs[] = $v; } - $ssdb = ApplicationContext::getContainer()->get(SSDBTask::class); $ssdb->exec('multi_hset', SsdbKeys::USER_INFO.$user['id'], $kvs); - return $user; + return $return; } public function check($userId) diff --git a/app/Service/v3/Interfaces/OrderListServiceInterface.php b/app/Service/v3/Interfaces/OrderListServiceInterface.php index 3a7f204..a3feb77 100644 --- a/app/Service/v3/Interfaces/OrderListServiceInterface.php +++ b/app/Service/v3/Interfaces/OrderListServiceInterface.php @@ -10,4 +10,5 @@ interface OrderListServiceInterface public function onlineByUser($userId, $tab, $page=1, $pagesize=10); public function onlineByStore($userId, $tab, $page, $pagesize); public function offlineByStore($userId, $tab, $page, $pagesize,$start_time = '',$end_time = ''); + public function offlineByUser($userId, $page=1, $pagesize=10); } \ No newline at end of file diff --git a/app/Service/v3/Interfaces/ShopCartUpdateServiceInterface.php b/app/Service/v3/Interfaces/ShopCartUpdateServiceInterface.php index 1fd40cb..8400f2f 100644 --- a/app/Service/v3/Interfaces/ShopCartUpdateServiceInterface.php +++ b/app/Service/v3/Interfaces/ShopCartUpdateServiceInterface.php @@ -9,4 +9,6 @@ interface ShopCartUpdateServiceInterface public function check(); public function undo($shopcartIds); + + public function doClear($userId, $marketId); } \ No newline at end of file diff --git a/composer.lock b/composer.lock index 55e2f43..e88de0d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9f238a6a5e556f4061e56600f28bacfd", + "content-hash": "71c3d5cf05fbd7b480f24350362675e4", "packages": [ { "name": "adbario/php-dot-notation", @@ -522,20 +522,6 @@ "uppercase", "words" ], - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector", - "type": "tidelift" - } - ], "time": "2020-05-29T07:19:59+00:00" }, { @@ -598,20 +584,6 @@ "constructor", "instantiate" ], - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], "time": "2020-05-29T17:27:14+00:00" }, { @@ -680,20 +652,6 @@ "parser", "php" ], - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", - "type": "tidelift" - } - ], "time": "2020-05-25T17:44:05+00:00" }, { @@ -3813,12 +3771,6 @@ "laminas", "zf" ], - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], "time": "2020-05-20T16:45:56+00:00" }, { @@ -4076,16 +4028,6 @@ "logging", "psr-3" ], - "funding": [ - { - "url": "https://github.com/Seldaek", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", - "type": "tidelift" - } - ], "time": "2020-05-22T08:12:19+00:00" }, { @@ -4234,16 +4176,6 @@ "datetime", "time" ], - "funding": [ - { - "url": "https://opencollective.com/Carbon", - "type": "open_collective" - }, - { - "url": "https://tidelift.com/funding/github/packagist/nesbot/carbon", - "type": "tidelift" - } - ], "time": "2020-07-04T12:29:56+00:00" }, { @@ -4910,16 +4842,6 @@ "php", "type" ], - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption", - "type": "tidelift" - } - ], "time": "2020-06-07T10:40:07+00:00" }, { @@ -5958,20 +5880,6 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-06-15T12:59:21+00:00" }, { @@ -6028,20 +5936,6 @@ ], "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-06-06T08:49:21+00:00" }, { @@ -6120,20 +6014,6 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-05-20T17:43:50+00:00" }, { @@ -6202,20 +6082,6 @@ "interoperability", "standards" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-07-06T13:23:11+00:00" }, { @@ -6271,20 +6137,6 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-05-20T17:43:50+00:00" }, { @@ -6434,20 +6286,6 @@ "polyfill", "portable" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-07-14T12:35:20+00:00" }, { @@ -6518,20 +6356,6 @@ "portable", "shim" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-07-14T12:35:20+00:00" }, { @@ -6609,20 +6433,6 @@ "portable", "shim" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-07-14T12:35:20+00:00" }, { @@ -6696,20 +6506,6 @@ "portable", "shim" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-07-14T12:35:20+00:00" }, { @@ -6779,20 +6575,6 @@ "portable", "shim" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-07-14T12:35:20+00:00" }, { @@ -6862,20 +6644,6 @@ "portable", "shim" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-07-14T12:35:20+00:00" }, { @@ -6941,20 +6709,6 @@ "portable", "shim" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-07-14T12:35:20+00:00" }, { @@ -7023,20 +6777,6 @@ "portable", "shim" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-07-14T12:35:20+00:00" }, { @@ -7109,20 +6849,6 @@ "portable", "shim" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-07-14T12:35:20+00:00" }, { @@ -7563,20 +7289,6 @@ "interoperability", "standards" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-07-06T13:23:11+00:00" }, { @@ -7654,20 +7366,6 @@ "utf-8", "utf8" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-06-11T12:16:36+00:00" }, { @@ -7752,20 +7450,6 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-05-30T20:35:19+00:00" }, { @@ -7833,20 +7517,6 @@ "interoperability", "standards" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-07-06T13:23:11+00:00" }, { @@ -7998,16 +7668,6 @@ "env", "environment" ], - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv", - "type": "tidelift" - } - ], "time": "2020-07-14T19:22:52+00:00" }, { @@ -8234,20 +7894,6 @@ "Xdebug", "performance" ], - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], "time": "2020-06-04T11:16:35+00:00" }, { @@ -8336,20 +7982,6 @@ "redis", "xcache" ], - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcache", - "type": "tidelift" - } - ], "time": "2020-07-07T18:54:01+00:00" }, { @@ -8421,20 +8053,6 @@ "iterators", "php" ], - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcollections", - "type": "tidelift" - } - ], "time": "2020-06-22T19:14:02+00:00" }, { @@ -8524,20 +8142,6 @@ "doctrine", "php" ], - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcommon", - "type": "tidelift" - } - ], "time": "2020-06-05T16:46:05+00:00" }, { @@ -8709,20 +8313,6 @@ "orm", "persistence" ], - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fpersistence", - "type": "tidelift" - } - ], "time": "2020-03-21T15:13:52+00:00" }, { @@ -8904,12 +8494,6 @@ } ], "description": "A tool to automatically fix PHP code style", - "funding": [ - { - "url": "https://github.com/keradus", - "type": "github" - } - ], "time": "2020-06-27T23:57:46+00:00" }, { @@ -9148,12 +8732,6 @@ "object", "object graph" ], - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" - } - ], "time": "2020-06-29T13:22:24+00:00" }, { @@ -9442,20 +9020,6 @@ "MIT" ], "description": "PHPStan - PHP Static Analysis Tool", - "funding": [ - { - "url": "https://github.com/ondrejmirtes", - "type": "github" - }, - { - "url": "https://www.patreon.com/phpstan", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", - "type": "tidelift" - } - ], "time": "2020-07-01T11:57:52+00:00" }, { @@ -10557,20 +10121,6 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-05-30T20:35:19+00:00" }, { @@ -10633,20 +10183,6 @@ "configuration", "options" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-05-23T13:08:13+00:00" }, { @@ -10703,20 +10239,6 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-05-30T20:35:19+00:00" }, { @@ -10773,20 +10295,6 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-05-20T17:43:50+00:00" }, { @@ -10833,12 +10341,6 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "funding": [ - { - "url": "https://github.com/theseer", - "type": "github" - } - ], "time": "2020-07-12T23:59:07+00:00" } ], diff --git a/config/autoload/auth.php b/config/autoload/auth.php index 89bafcf..c98bf87 100644 --- a/config/autoload/auth.php +++ b/config/autoload/auth.php @@ -7,8 +7,12 @@ declare(strict_types=1); return [ 'api' => [ 'sign' => [ - 'secret_key' => 'lanzu@123', - 'expire_time' => 200 + 'secret_key' => env('API_AUTH_SECRET'), + 'expire_time' => env('API_AUTH_EXPIRE_TIME') ] ], + 'user' => [ + 'hash_ids_secret' => env('HASH_IDS_SECRET'), + 'expire_time' => env('HASH_IDS_EXPIRE_TIME') + ] ]; \ No newline at end of file diff --git a/config/config.php b/config/config.php index 26b4014..ad49d28 100644 --- a/config/config.php +++ b/config/config.php @@ -52,5 +52,4 @@ return [ 'alioss' => [ 'img_host' => env('OSS_IMG_HOST', ''), ], - 'hash_ids_secret' => env('HASH_IDS_SECRET'), ]; diff --git a/config/routes.php b/config/routes.php index c8f1eaa..79aeeae 100644 --- a/config/routes.php +++ b/config/routes.php @@ -92,6 +92,7 @@ Router::addGroup('/v3/', function () { Router::post('store/index', 'App\Controller\v3\StoreController@index'); Router::post('Search/market', 'App\Controller\v3\SearchController@market'); Router::post('market/services', 'App\Controller\v3\LocationController@getMarketsInfo'); + Router::post('home/aboutLanzu', 'App\Controller\v3\HomeController@aboutLanzu'); },['middleware' => [\App\Middleware\Auth\ApiMiddleware::class]]); // 需要登录的路由 @@ -134,6 +135,7 @@ Router::addGroup('/v3/', function () { Router::post('orderOnline/del', 'App\Controller\v3\OrderOnlineController@del'); Router::post('orderOnline/applyRefund', 'App\Controller\v3\OrderOnlineController@applyRefund'); Router::post('orderOnline/complete', 'App\Controller\v3\OrderOnlineController@complete'); + Router::post('user/oflOrders', 'App\Controller\v3\OrderListController@offlineForUser'); Router::post('shopCart/delete', 'App\Controller\v3\ShopCartUpdateController@delete'); },['middleware' => [\App\Middleware\Auth\ApiMiddleware::class, \App\Middleware\Auth\UserMiddleware::class]]);