Browse Source

Merge branch 'phoenix' of http://120.24.33.109:11081/hyzjshwo/lanzu_api_hyperf into phoenix

# Conflicts:
#	app/Service/v3/Interfaces/ShopCartUpdateServiceInterface.php
#	config/routes.php
master
Lemon 6 years ago
parent
commit
f4b0abadc6
  1. 2
      app/Constants/v3/OrderState.php
  2. 26
      app/Controller/v3/HomeController.php
  3. 7
      app/Controller/v3/OrderListController.php
  4. 10
      app/JsonRpc/SeparateAccountsServiceInterface.php
  5. 28
      app/JsonRpc/SeparateaccountsService.php
  6. 18
      app/Middleware/Auth/UserMiddleware.php
  7. 2
      app/Request/v3/UserOrderListRequest.php
  8. 24
      app/Service/v3/Implementations/OrderListService.php
  9. 9
      app/Service/v3/Implementations/OrderOfflineService.php
  10. 12
      app/Service/v3/Implementations/OrderOnlineService.php
  11. 4
      app/Service/v3/Implementations/SearchService.php
  12. 60
      app/Service/v3/Implementations/ShopCartService.php
  13. 10
      app/Service/v3/Implementations/ShopCartUpdateService.php
  14. 12
      app/Service/v3/Implementations/WxLoginService.php
  15. 1
      app/Service/v3/Interfaces/OrderListServiceInterface.php
  16. 2
      app/Service/v3/Interfaces/ShopCartUpdateServiceInterface.php
  17. 500
      composer.lock
  18. 8
      config/autoload/auth.php
  19. 1
      config/config.php
  20. 2
      config/routes.php

2
app/Constants/v3/OrderState.php

@ -68,7 +68,7 @@ class OrderState extends AbstractConstants
/** /**
* @Message("订单完成") * @Message("订单完成")
*/ */
const FINISH = [self::COMPLETED, self::EVALUATED, self::CANCELED];
const FINISH = [self::COMPLETED, self::EVALUATED];
/** /**
* @Message("售后/退款") * @Message("售后/退款")

26
app/Controller/v3/HomeController.php

@ -173,4 +173,30 @@ class HomeController extends BaseController
return $this->success($data); 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]);
}
} }

7
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']); $list = $this->orderListService->offlineByStore($params['store_id'], $params['tab'], $params['page'], $params['pagesize'],$params['start_time'],$params['end_time']);
return $this->success($list); 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);
}
} }

10
app/JsonRpc/SeparateAccountsServiceInterface.php

@ -0,0 +1,10 @@
<?php
namespace App\JsonRpc;
interface SeparateAccountsServiceInterface
{
public function orderOnlineCompleted($orderMainId, $userId);
}

28
app/JsonRpc/SeparateaccountsService.php

@ -0,0 +1,28 @@
<?php
namespace App\JsonRpc;
use Hyperf\RpcServer\Annotation\RpcService;
use Hyperf\Di\Annotation\Inject;
/**
* @RpcService(name="SeparateaccountsService", protocol="jsonrpc-http", server="jsonrpc-http", publishTo="")
* Class SeparateAccountsService
* @package App\JsonRpc
*/
class SeparateaccountsService implements SeparateAccountsServiceInterface
{
/**
* @Inject
* @var \App\Service\v3\Interfaces\SeparateAccountsServiceInterface
*/
private $separateaccountsService;
public function orderOnlineCompleted($orderMainId, $userId)
{
// TODO: Implement orderOnlineCompleted() method.
return $this->separateaccountsService->orderOnlineCompleted($orderMainId, $userId);
}
}

18
app/Middleware/Auth/UserMiddleware.php

@ -2,8 +2,12 @@
namespace App\Middleware\Auth; 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\RequestInterface as HttpRequest;
use Hyperf\HttpServer\Contract\ResponseInterface as HttpResponse; use Hyperf\HttpServer\Contract\ResponseInterface as HttpResponse;
use Hyperf\Utils\ApplicationContext;
use Psr\Container\ContainerInterface; use Psr\Container\ContainerInterface;
use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\ServerRequestInterface;
@ -33,6 +37,7 @@ class UserMiddleware implements MiddlewareInterface
$this->container = $container; $this->container = $container;
$this->response = $response; $this->response = $response;
$this->request = $request; $this->request = $request;
make(Hashids::class, ['secret' => config('auth.user.hash_ids_secret')]);
} }
/** /**
@ -63,5 +68,18 @@ class UserMiddleware implements MiddlewareInterface
private function checkLogin() private function checkLogin()
{ {
return true; 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;
} }
} }

2
app/Request/v3/UserOrderListRequest.php

@ -16,7 +16,7 @@ class UserOrderListRequest extends BaseFormRequest
{ {
return [ return [
'user_id' => 'required|nonempty|integer', 'user_id' => 'required|nonempty|integer',
'tab' => 'nonempty',
'tab' => '',
'page' => 'required|nonempty', 'page' => 'required|nonempty',
'pagesize' => 'required|nonempty', 'pagesize' => 'required|nonempty',
]; ];

24
app/Service/v3/Implementations/OrderListService.php

@ -3,8 +3,10 @@
namespace App\Service\v3\Implementations; namespace App\Service\v3\Implementations;
use App\Constants\v3\OrderState; use App\Constants\v3\OrderState;
use App\Constants\v3\OrderType;
use App\Model\v3\OrderMain; use App\Model\v3\OrderMain;
use App\Model\v3\Order; use App\Model\v3\Order;
use App\Model\v3\ShoppingCart;
use App\Service\v3\Interfaces\OrderListServiceInterface; use App\Service\v3\Interfaces\OrderListServiceInterface;
use Hyperf\Paginator\Paginator; use Hyperf\Paginator\Paginator;
@ -30,10 +32,7 @@ class OrderListService implements OrderListServiceInterface
{ {
$builder = OrderMain::query() $builder = OrderMain::query()
->with(['orderGoods', 'market']) ->with(['orderGoods', 'market'])
->where([
['user_id','=',$userId],
['type','=',1]
]);
->where(['user_id' => $userId, 'type' => OrderType::ONLINE]);
switch ($tab) { switch ($tab) {
case 'all': case 'all':
break; break;
@ -58,7 +57,7 @@ class OrderListService implements OrderListServiceInterface
public function onlineByStore($storeId, $tab, $page=1, $pagesize=10) 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( ->select(
'lanzu_order.*', 'lanzu_order.*',
'lanzu_order_main.address', '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 = '') 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('store_id', $storeId)
->where('lanzu_order_main.type',4) ->where('lanzu_order_main.type',4)
->with('user'); ->with('user');
@ -143,4 +142,17 @@ class OrderListService implements OrderListServiceInterface
$orders = $paginate->toArray(); $orders = $paginate->toArray();
return ['has_more_pages' => $paginate->hasMorePages(), 'orders' => $orders['data']]; 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']];
}
} }

9
app/Service/v3/Implementations/OrderOfflineService.php

@ -60,6 +60,12 @@ class OrderOfflineService implements OrderOfflineServiceInterface
$orderMain = OrderMain::query()->create($dataMain); $orderMain = OrderMain::query()->create($dataMain);
$orderMainId = $orderMain->id; $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 = [ $dataChildren = [
'order_main_id' => $orderMainId, 'order_main_id' => $orderMainId,
@ -67,7 +73,8 @@ class OrderOfflineService implements OrderOfflineServiceInterface
'store_id' => $storeId, 'store_id' => $storeId,
'money' => $money, 'money' => $money,
'order_num' => date('YmdHis').mt_rand(1000, 9999), 'order_num' => date('YmdHis').mt_rand(1000, 9999),
'note' => ''
'note' => '',
'oid' => $count + 1
]; ];
$orderChild = Order::query()->create($dataChildren); $orderChild = Order::query()->create($dataChildren);

12
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\GoodsActivityServiceInterface;
use App\Service\v3\Interfaces\GoodsServiceInterface; use App\Service\v3\Interfaces\GoodsServiceInterface;
use App\Service\v3\Interfaces\PaymentServiceInterface; use App\Service\v3\Interfaces\PaymentServiceInterface;
use App\Service\v3\Interfaces\ShopCartUpdateServiceInterface;
use App\TaskWorker\SSDBTask; use App\TaskWorker\SSDBTask;
use Exception; use Exception;
use Hyperf\Database\Model\Model; use Hyperf\Database\Model\Model;
@ -82,6 +83,12 @@ class OrderOnlineService implements OrderOnlineServiceInterface
*/ */
protected $paymentService; protected $paymentService;
/**
* @Inject
* @var ShopCartUpdateServiceInterface
*/
protected $shopCartUpdateService;
/** /**
* 下单 * 下单
* @param $marketId * @param $marketId
@ -129,7 +136,7 @@ class OrderOnlineService implements OrderOnlineServiceInterface
$storeTypeIds[] = (string)$storeType; $storeTypeIds[] = (string)$storeType;
// 店铺今天的订单数 // 店铺今天的订单数
$count = Order::query() $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'))]) ->whereBetween('created_at', [strtotime(date('Y-m-d 00:00:00')), strtotime(date('Y-m-d 23:59:59'))])
->count(); ->count();
@ -320,6 +327,9 @@ class OrderOnlineService implements OrderOnlineServiceInterface
Db::commit(); Db::commit();
// 清除购物车
$this->shopCartUpdateService->doClear($userId, $marketId);
// 支付 // 支付
return $this->paymentService->do($globalOrderId, $totalAmount, $userId, config('wechat.notify_url.online')); return $this->paymentService->do($globalOrderId, $totalAmount, $userId, config('wechat.notify_url.online'));
} catch (Exception $e) { } catch (Exception $e) {

4
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']); $builder->select(['id', 'store_id', 'cover_img', 'name', 'spec', 'tags', 'original_price', 'price', 'inventory', 'sales as total_sales']);
$paginate = $builder->paginate($params['pagesize']); $paginate = $builder->paginate($params['pagesize']);
$goods = $paginate->toArray(); $goods = $paginate->toArray();
return ['has_more_pages' => $paginate->hasMorePages(), 'goods' => $goods];
return ['has_more_pages' => $paginate->hasMorePages(), 'goods' => $goods['data']];
} }
public function doForStores($params) public function doForStores($params)
@ -86,7 +86,7 @@ class SearchService implements \App\Service\v3\Interfaces\SearchServiceInterface
$builder->select(['id', 'logo', 'name']); $builder->select(['id', 'logo', 'name']);
$paginate = $builder->paginate($params['pagesize']); $paginate = $builder->paginate($params['pagesize']);
$stores = $paginate->toArray(); $stores = $paginate->toArray();
return ['has_more_pages' => $paginate->hasMorePages(), 'stores' => $stores];
return ['has_more_pages' => $paginate->hasMorePages(), 'stores' => $stores['data']];
} }
public function getHotKeywords($type) public function getHotKeywords($type)

60
app/Service/v3/Implementations/ShopCartService.php

@ -49,29 +49,26 @@ class ShopCartService implements ShopCartServiceInterface
foreach ($stores as $key => &$store){ foreach ($stores as $key => &$store){
$sotreType = $this->storeService->check($store['id']); $sotreType = $this->storeService->check($store['id']);
if(!$sotreType){ if(!$sotreType){
unset($stores[$key]);
continue; continue;
} }
$subtotal = 0; $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){ if($shopcart['activity_type'] == 1){
$builder = Goods::query(); $builder = Goods::query();
}else{ }else{
$builder = GoodsActivity::query(); $builder = GoodsActivity::query();
} }
$shopcart['goods'] = $builder->where('id',$shopcart['goods_id'])->first()->toArray(); $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; $store['subtotal'] = $subtotal;
$storeArr[] = $store; $storeArr[] = $store;
@ -100,34 +97,33 @@ class ShopCartService implements ShopCartServiceInterface
->toArray(); ->toArray();
$storeArr = []; $storeArr = [];
foreach ($stores as $key => &$store){ foreach ($stores as $key => &$store){
$addStore = false;
$sotreType = $this->storeService->check($store['id']); $sotreType = $this->storeService->check($store['id']);
if(!$sotreType){ 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){ if($shopcart['activity_type'] == 1){
$builder = Goods::query(); $builder = Goods::query();
}else{ }else{
$builder = GoodsActivity::query(); $builder = GoodsActivity::query();
} }
$shopcart['goods'] = $builder->where('id',$shopcart['goods_id'])->first()->toArray(); $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; return $storeArr;
} }

10
app/Service/v3/Implementations/ShopCartUpdateService.php

@ -47,4 +47,14 @@ class ShopCartUpdateService implements ShopCartUpdateServiceInterface
$shopcartIdsArr = explode(',',$shopcartIds); $shopcartIdsArr = explode(',',$shopcartIds);
return ShoppingCart::destroy($shopcartIdsArr); return ShoppingCart::destroy($shopcartIdsArr);
} }
/**
* 清空购物车
* @param $userId
* @param $marketId
*/
public function doClear($userId, $marketId)
{
}
} }

12
app/Service/v3/Implementations/WxLoginService.php

@ -35,20 +35,24 @@ class WxLoginService implements \App\Service\v3\Interfaces\WxLoginServiceInterfa
)->toArray(); )->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; $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); $return = array_merge($user, $result);
$kvs = []; $kvs = [];
foreach ($return as $k => $v) { foreach ($return as $k => $v) {
$kvs[] = $k; $kvs[] = $k;
$kvs[] = $v; $kvs[] = $v;
} }
$ssdb = ApplicationContext::getContainer()->get(SSDBTask::class);
$ssdb->exec('multi_hset', SsdbKeys::USER_INFO.$user['id'], $kvs); $ssdb->exec('multi_hset', SsdbKeys::USER_INFO.$user['id'], $kvs);
return $user;
return $return;
} }
public function check($userId) public function check($userId)

1
app/Service/v3/Interfaces/OrderListServiceInterface.php

@ -10,4 +10,5 @@ interface OrderListServiceInterface
public function onlineByUser($userId, $tab, $page=1, $pagesize=10); public function onlineByUser($userId, $tab, $page=1, $pagesize=10);
public function onlineByStore($userId, $tab, $page, $pagesize); public function onlineByStore($userId, $tab, $page, $pagesize);
public function offlineByStore($userId, $tab, $page, $pagesize,$start_time = '',$end_time = ''); public function offlineByStore($userId, $tab, $page, $pagesize,$start_time = '',$end_time = '');
public function offlineByUser($userId, $page=1, $pagesize=10);
} }

2
app/Service/v3/Interfaces/ShopCartUpdateServiceInterface.php

@ -9,4 +9,6 @@ interface ShopCartUpdateServiceInterface
public function check(); public function check();
public function undo($shopcartIds); public function undo($shopcartIds);
public function doClear($userId, $marketId);
} }

500
composer.lock

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "9f238a6a5e556f4061e56600f28bacfd",
"content-hash": "71c3d5cf05fbd7b480f24350362675e4",
"packages": [ "packages": [
{ {
"name": "adbario/php-dot-notation", "name": "adbario/php-dot-notation",
@ -522,20 +522,6 @@
"uppercase", "uppercase",
"words" "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" "time": "2020-05-29T07:19:59+00:00"
}, },
{ {
@ -598,20 +584,6 @@
"constructor", "constructor",
"instantiate" "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" "time": "2020-05-29T17:27:14+00:00"
}, },
{ {
@ -680,20 +652,6 @@
"parser", "parser",
"php" "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" "time": "2020-05-25T17:44:05+00:00"
}, },
{ {
@ -3813,12 +3771,6 @@
"laminas", "laminas",
"zf" "zf"
], ],
"funding": [
{
"url": "https://funding.communitybridge.org/projects/laminas-project",
"type": "community_bridge"
}
],
"time": "2020-05-20T16:45:56+00:00" "time": "2020-05-20T16:45:56+00:00"
}, },
{ {
@ -4076,16 +4028,6 @@
"logging", "logging",
"psr-3" "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" "time": "2020-05-22T08:12:19+00:00"
}, },
{ {
@ -4234,16 +4176,6 @@
"datetime", "datetime",
"time" "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" "time": "2020-07-04T12:29:56+00:00"
}, },
{ {
@ -4910,16 +4842,6 @@
"php", "php",
"type" "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" "time": "2020-06-07T10:40:07+00:00"
}, },
{ {
@ -5958,20 +5880,6 @@
], ],
"description": "Symfony Console Component", "description": "Symfony Console Component",
"homepage": "https://symfony.com", "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" "time": "2020-06-15T12:59:21+00:00"
}, },
{ {
@ -6028,20 +5936,6 @@
], ],
"description": "A generic function and convention to trigger deprecation notices", "description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com", "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" "time": "2020-06-06T08:49:21+00:00"
}, },
{ {
@ -6120,20 +6014,6 @@
], ],
"description": "Symfony EventDispatcher Component", "description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com", "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" "time": "2020-05-20T17:43:50+00:00"
}, },
{ {
@ -6202,20 +6082,6 @@
"interoperability", "interoperability",
"standards" "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" "time": "2020-07-06T13:23:11+00:00"
}, },
{ {
@ -6271,20 +6137,6 @@
], ],
"description": "Symfony Finder Component", "description": "Symfony Finder Component",
"homepage": "https://symfony.com", "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" "time": "2020-05-20T17:43:50+00:00"
}, },
{ {
@ -6434,20 +6286,6 @@
"polyfill", "polyfill",
"portable" "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" "time": "2020-07-14T12:35:20+00:00"
}, },
{ {
@ -6518,20 +6356,6 @@
"portable", "portable",
"shim" "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" "time": "2020-07-14T12:35:20+00:00"
}, },
{ {
@ -6609,20 +6433,6 @@
"portable", "portable",
"shim" "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" "time": "2020-07-14T12:35:20+00:00"
}, },
{ {
@ -6696,20 +6506,6 @@
"portable", "portable",
"shim" "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" "time": "2020-07-14T12:35:20+00:00"
}, },
{ {
@ -6779,20 +6575,6 @@
"portable", "portable",
"shim" "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" "time": "2020-07-14T12:35:20+00:00"
}, },
{ {
@ -6862,20 +6644,6 @@
"portable", "portable",
"shim" "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" "time": "2020-07-14T12:35:20+00:00"
}, },
{ {
@ -6941,20 +6709,6 @@
"portable", "portable",
"shim" "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" "time": "2020-07-14T12:35:20+00:00"
}, },
{ {
@ -7023,20 +6777,6 @@
"portable", "portable",
"shim" "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" "time": "2020-07-14T12:35:20+00:00"
}, },
{ {
@ -7109,20 +6849,6 @@
"portable", "portable",
"shim" "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" "time": "2020-07-14T12:35:20+00:00"
}, },
{ {
@ -7563,20 +7289,6 @@
"interoperability", "interoperability",
"standards" "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" "time": "2020-07-06T13:23:11+00:00"
}, },
{ {
@ -7654,20 +7366,6 @@
"utf-8", "utf-8",
"utf8" "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" "time": "2020-06-11T12:16:36+00:00"
}, },
{ {
@ -7752,20 +7450,6 @@
], ],
"description": "Symfony Translation Component", "description": "Symfony Translation Component",
"homepage": "https://symfony.com", "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" "time": "2020-05-30T20:35:19+00:00"
}, },
{ {
@ -7833,20 +7517,6 @@
"interoperability", "interoperability",
"standards" "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" "time": "2020-07-06T13:23:11+00:00"
}, },
{ {
@ -7998,16 +7668,6 @@
"env", "env",
"environment" "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" "time": "2020-07-14T19:22:52+00:00"
}, },
{ {
@ -8234,20 +7894,6 @@
"Xdebug", "Xdebug",
"performance" "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" "time": "2020-06-04T11:16:35+00:00"
}, },
{ {
@ -8336,20 +7982,6 @@
"redis", "redis",
"xcache" "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" "time": "2020-07-07T18:54:01+00:00"
}, },
{ {
@ -8421,20 +8053,6 @@
"iterators", "iterators",
"php" "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" "time": "2020-06-22T19:14:02+00:00"
}, },
{ {
@ -8524,20 +8142,6 @@
"doctrine", "doctrine",
"php" "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" "time": "2020-06-05T16:46:05+00:00"
}, },
{ {
@ -8709,20 +8313,6 @@
"orm", "orm",
"persistence" "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" "time": "2020-03-21T15:13:52+00:00"
}, },
{ {
@ -8904,12 +8494,6 @@
} }
], ],
"description": "A tool to automatically fix PHP code style", "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" "time": "2020-06-27T23:57:46+00:00"
}, },
{ {
@ -9148,12 +8732,6 @@
"object", "object",
"object graph" "object graph"
], ],
"funding": [
{
"url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy",
"type": "tidelift"
}
],
"time": "2020-06-29T13:22:24+00:00" "time": "2020-06-29T13:22:24+00:00"
}, },
{ {
@ -9442,20 +9020,6 @@
"MIT" "MIT"
], ],
"description": "PHPStan - PHP Static Analysis Tool", "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" "time": "2020-07-01T11:57:52+00:00"
}, },
{ {
@ -10557,20 +10121,6 @@
], ],
"description": "Symfony Filesystem Component", "description": "Symfony Filesystem Component",
"homepage": "https://symfony.com", "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" "time": "2020-05-30T20:35:19+00:00"
}, },
{ {
@ -10633,20 +10183,6 @@
"configuration", "configuration",
"options" "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" "time": "2020-05-23T13:08:13+00:00"
}, },
{ {
@ -10703,20 +10239,6 @@
], ],
"description": "Symfony Process Component", "description": "Symfony Process Component",
"homepage": "https://symfony.com", "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" "time": "2020-05-30T20:35:19+00:00"
}, },
{ {
@ -10773,20 +10295,6 @@
], ],
"description": "Symfony Stopwatch Component", "description": "Symfony Stopwatch Component",
"homepage": "https://symfony.com", "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" "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", "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" "time": "2020-07-12T23:59:07+00:00"
} }
], ],

8
config/autoload/auth.php

@ -7,8 +7,12 @@ declare(strict_types=1);
return [ return [
'api' => [ 'api' => [
'sign' => [ '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')
]
]; ];

1
config/config.php

@ -52,5 +52,4 @@ return [
'alioss' => [ 'alioss' => [
'img_host' => env('OSS_IMG_HOST', ''), 'img_host' => env('OSS_IMG_HOST', ''),
], ],
'hash_ids_secret' => env('HASH_IDS_SECRET'),
]; ];

2
config/routes.php

@ -92,6 +92,7 @@ Router::addGroup('/v3/', function () {
Router::post('store/index', 'App\Controller\v3\StoreController@index'); Router::post('store/index', 'App\Controller\v3\StoreController@index');
Router::post('Search/market', 'App\Controller\v3\SearchController@market'); Router::post('Search/market', 'App\Controller\v3\SearchController@market');
Router::post('market/services', 'App\Controller\v3\LocationController@getMarketsInfo'); Router::post('market/services', 'App\Controller\v3\LocationController@getMarketsInfo');
Router::post('home/aboutLanzu', 'App\Controller\v3\HomeController@aboutLanzu');
},['middleware' => [\App\Middleware\Auth\ApiMiddleware::class]]); },['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/del', 'App\Controller\v3\OrderOnlineController@del');
Router::post('orderOnline/applyRefund', 'App\Controller\v3\OrderOnlineController@applyRefund'); Router::post('orderOnline/applyRefund', 'App\Controller\v3\OrderOnlineController@applyRefund');
Router::post('orderOnline/complete', 'App\Controller\v3\OrderOnlineController@complete'); 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'); Router::post('shopCart/delete', 'App\Controller\v3\ShopCartUpdateController@delete');
},['middleware' => [\App\Middleware\Auth\ApiMiddleware::class, \App\Middleware\Auth\UserMiddleware::class]]); },['middleware' => [\App\Middleware\Auth\ApiMiddleware::class, \App\Middleware\Auth\UserMiddleware::class]]);

Loading…
Cancel
Save