diff --git a/.gitignore b/.gitignore index bcaa6b8..b272808 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ vendor/ /phpstan.neon /phpunit.xml /composer.lock +uploads/ \ No newline at end of file diff --git a/README.md b/README.md index c143bde..6ec9001 100644 --- a/README.md +++ b/README.md @@ -19,10 +19,18 @@ ## 安装和使用 +- 安装 swoole 和 xlswriter 扩展 + +``` +自行搜索安装教程 +``` + - 获取代码 ```bash git clone https://codeup.aliyun.com/67039465d8d1ada68263f984/hhl/rewrite/hyperf_service.git + +mkdir uploads ``` - vendor diff --git a/app/Service/Admin/Good/PurchaseService.php b/app/Service/Admin/Good/PurchaseService.php index 30c4ee1..2a7f2f7 100644 --- a/app/Service/Admin/Good/PurchaseService.php +++ b/app/Service/Admin/Good/PurchaseService.php @@ -45,6 +45,12 @@ class PurchaseService extends BaseService #[Inject] protected GoodCache $goodCache; + /** + * @var Purchase + */ + #[Inject] + protected Purchase $purchaseModel; + /** * @return array */ @@ -55,7 +61,7 @@ class PurchaseService extends BaseService $kitchenId = (int)$this->request->input('search_kitchen_id'); $cityId = (int)$this->request->input('search_city_id'); - $list = $this->spuModel + $list = $this->purchaseModel ->where('cycle_id',$cycleId) ->where('city_id',$cityId) ->where('kitchen_id',$kitchenId) @@ -162,12 +168,6 @@ class PurchaseService extends BaseService if ($occupiedOne >= (9 - 2 * $occupiedTwo)) throw new ErrException('不符合目前盒子的规则02,添加失败'); } - /** - * @var Purchase - */ - #[Inject] - protected Purchase $purchaseModel; - /** * @return array * @throws ContainerExceptionInterface diff --git a/composer.json b/composer.json index 79d5942..7343367 100644 --- a/composer.json +++ b/composer.json @@ -52,7 +52,8 @@ "ext-json": "Required to use JSON.", "ext-pdo": "Required to use MySQL Client.", "ext-pdo_mysql": "Required to use MySQL Client.", - "ext-redis": "Required to use Redis Client." + "ext-redis": "Required to use Redis Client.", + "ext-xlswriter": "*" }, "autoload": { "psr-4": { diff --git a/config/autoload/system.php b/config/autoload/system.php index 78916cf..7430d8f 100644 --- a/config/autoload/system.php +++ b/config/autoload/system.php @@ -27,4 +27,6 @@ return [ 'wx_secret' => env('WX_SECRET','5d89ebae17d836625f0e155216d71f2d'), //api_url 'api_url' => env('DEFAULT_API_URL','http://127.0.0.1:9501'), + // upload_dir + 'upload_dir' => BASE_PATH.'/uploads/', ]; \ No newline at end of file