From cf198d1a56cd46fe96796d0fe0a3c0ac7f1ca45c Mon Sep 17 00:00:00 2001 From: liangyuyan <1103300295@qq.com> Date: Thu, 17 Sep 2020 11:08:58 +0800 Subject: [PATCH 1/3] composer --- composer.lock | 453 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 452 insertions(+), 1 deletion(-) diff --git a/composer.lock b/composer.lock index 838f3b3..90ccb0a 100644 --- a/composer.lock +++ b/composer.lock @@ -303,6 +303,12 @@ "brick", "math" ], + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/brick/math", + "type": "tidelift" + } + ], "time": "2020-08-18T23:57:15+00:00" }, { @@ -719,6 +725,20 @@ "sqlserver", "sqlsrv" ], + "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%2Fdbal", + "type": "tidelift" + } + ], "time": "2020-09-12T21:20:41+00:00" }, { @@ -2280,6 +2300,32 @@ "md", "parser" ], + "funding": [ + { + "url": "https://enjoy.gitstore.app/repositories/thephpleague/commonmark", + "type": "custom" + }, + { + "url": "https://www.colinodell.com/sponsor", + "type": "custom" + }, + { + "url": "https://www.paypal.me/colinpodell/10.00", + "type": "custom" + }, + { + "url": "https://github.com/colinodell", + "type": "github" + }, + { + "url": "https://www.patreon.com/colinodell", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/league/commonmark", + "type": "tidelift" + } + ], "time": "2020-09-13T14:44:46+00:00" }, { @@ -2371,6 +2417,12 @@ "sftp", "storage" ], + "funding": [ + { + "url": "https://offset.earth/frankdejonge", + "type": "other" + } + ], "time": "2020-08-23T07:39:11+00:00" }, { @@ -2418,6 +2470,16 @@ } ], "description": "Mime-type detection for Flysystem", + "funding": [ + { + "url": "https://github.com/frankdejonge", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/league/flysystem", + "type": "tidelift" + } + ], "time": "2020-08-09T10:34:01+00:00" }, { @@ -2484,6 +2546,12 @@ "scout", "search" ], + "funding": [ + { + "url": "https://www.patreon.com/matchish", + "type": "patreon" + } + ], "time": "2020-03-26T04:06:20+00:00" }, { @@ -2719,6 +2787,16 @@ "datetime", "time" ], + "funding": [ + { + "url": "https://opencollective.com/Carbon", + "type": "open_collective" + }, + { + "url": "https://tidelift.com/funding/github/packagist/nesbot/carbon", + "type": "tidelift" + } + ], "time": "2020-09-10T12:16:42+00:00" }, { @@ -3021,6 +3099,12 @@ "wechat", "weibo" ], + "funding": [ + { + "url": "https://www.patreon.com/overtrue", + "type": "patreon" + } + ], "time": "2020-09-14T08:34:23+00:00" }, { @@ -3094,6 +3178,20 @@ "weixin", "weixin-sdk" ], + "funding": [ + { + "url": "https://www.easywechat.com/img/pay/wechat.jpg", + "type": "custom" + }, + { + "url": "https://github.com/overtrue", + "type": "github" + }, + { + "url": "https://www.patreon.com/overtrue", + "type": "patreon" + } + ], "time": "2020-09-09T09:07:36+00:00" }, { @@ -3777,6 +3875,12 @@ "queue", "set" ], + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + } + ], "time": "2020-09-10T20:58:17+00:00" }, { @@ -3864,6 +3968,12 @@ "identifier", "uuid" ], + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + } + ], "time": "2020-08-18T17:17:46+00:00" }, { @@ -3981,6 +4091,12 @@ "sort", "sortable" ], + "funding": [ + { + "url": "https://github.com/spatie", + "type": "github" + } + ], "time": "2020-09-15T06:48:07+00:00" }, { @@ -4135,6 +4251,20 @@ "caching", "psr6" ], + "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-09-01T05:52:18+00:00" }, { @@ -4203,6 +4333,20 @@ "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-09-07T11:33:47+00:00" }, { @@ -4288,6 +4432,20 @@ ], "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-09-02T07:07:40+00:00" }, { @@ -4347,6 +4505,20 @@ ], "description": "Symfony CssSelector 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" }, { @@ -4403,6 +4575,20 @@ ], "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-09-07T11:33:47+00:00" }, { @@ -4471,6 +4657,20 @@ ], "description": "Symfony DomCrawler 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-08-12T08:45:47+00:00" }, { @@ -4534,6 +4734,20 @@ ], "description": "Symfony ErrorHandler 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-08-17T10:01:29+00:00" }, { @@ -4612,6 +4826,20 @@ ], "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-08-13T14:19:42+00:00" }, { @@ -4680,6 +4908,20 @@ "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-09-07T11:33:47+00:00" }, { @@ -4735,6 +4977,20 @@ ], "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-08-17T10:01:29+00:00" }, { @@ -4802,6 +5058,20 @@ ], "description": "Symfony HttpFoundation 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-08-17T07:48:54+00:00" }, { @@ -4907,6 +5177,20 @@ ], "description": "Symfony HttpKernel 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-09-02T08:15:18+00:00" }, { @@ -4976,6 +5260,20 @@ "mime", "mime-type" ], + "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-08-17T10:01:29+00:00" }, { @@ -5732,6 +6030,20 @@ ], "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-07-23T08:36:24+00:00" }, { @@ -5802,6 +6114,20 @@ "psr-17", "psr-7" ], + "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-25T08:21:47+00:00" }, { @@ -5886,6 +6212,20 @@ "uri", "url" ], + "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-08-10T08:03:57+00:00" }, { @@ -5975,6 +6315,20 @@ ], "description": "Symfony Serializer 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-09-01T05:52:18+00:00" }, { @@ -6043,6 +6397,20 @@ "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-09-07T11:33:47+00:00" }, { @@ -6120,6 +6488,20 @@ "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-08-17T07:48:54+00:00" }, { @@ -6204,6 +6586,20 @@ ], "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-08-17T10:01:29+00:00" }, { @@ -6271,6 +6667,20 @@ "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-09-07T11:33:47+00:00" }, { @@ -6353,6 +6763,20 @@ "debug", "dump" ], + "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-08-17T07:42:30+00:00" }, { @@ -6420,6 +6844,20 @@ "instantiate", "serialize" ], + "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-07T15:42:22+00:00" }, { @@ -6725,6 +7163,12 @@ "flare", "reporting" ], + "funding": [ + { + "url": "https://github.com/spatie", + "type": "github" + } + ], "time": "2020-08-26T18:06:23+00:00" }, { @@ -8032,6 +8476,12 @@ "highlight.php", "syntax" ], + "funding": [ + { + "url": "https://github.com/allejo", + "type": "github" + } + ], "time": "2020-08-27T03:24:44+00:00" }, { @@ -8831,5 +9281,6 @@ "platform": { "php": "^7.2.5" }, - "platform-dev": [] + "platform-dev": [], + "plugin-api-version": "1.1.0" } From f59b36631ea82dfec253ba6875225384920e42f9 Mon Sep 17 00:00:00 2001 From: liangyuyan <1103300295@qq.com> Date: Thu, 17 Sep 2020 12:00:31 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=95=86=E5=93=81=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Admin/Controllers/v3/GoodsController.php | 41 +++++++++++++------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/app/Admin/Controllers/v3/GoodsController.php b/app/Admin/Controllers/v3/GoodsController.php index c10ccd7..72b7304 100644 --- a/app/Admin/Controllers/v3/GoodsController.php +++ b/app/Admin/Controllers/v3/GoodsController.php @@ -25,34 +25,47 @@ class GoodsController extends AdminController protected function grid() { return Grid::make(new Goods(), function (Grid $grid) { + // 二级分类 + $categoryList = CategoryModel::getArray([['parent_id','>',0]],['选择分类'=>0]); + // 店铺 + $storeList = StoreModel::getStoreArray(); + // 商品类目 + $goodsCategoryList = GoodsCategoryModel::getArray([],['选择类目'=>0]); + //市场 + $marketList = MarketModel::getMarketArray(); + $grid->id->sortable(); $grid->cover_img_url->image('',50); $grid->name; $grid->price; - $grid->column('market_id')->display(function($marketId){ - $item = MarketModel::getMarketInfo($marketId,'name'); - return empty($item) ? '' : $item->name; + $grid->column('market_id')->display(function($marketId) use($marketList){ + return isset($marketList[$marketId]) ? $marketList[$marketId] : ''; }); - $grid->store_id->display(function ($storeId){ - $store = StoreModel::getStoreInfo($storeId,'name'); - return empty($store) ? '' : $store->name; + $grid->store_id->display(function ($storeId) use($storeList){ + return isset($storeList[$storeId]) ? $storeList[$storeId] : ''; }); - $grid->category_id->display(function ($categoryId){ - $item = CategoryModel::getInfo($categoryId,'title'); - return empty($item) ? '' : $item->title; + $grid->category_id->display(function ($categoryId) use($categoryList){ + return isset($categoryList[$categoryId]) ? $categoryList[$categoryId] : ''; }); - $grid->goods_category_id->display(function ($goodsCategoryId){ - $item = GoodsCategoryModel::getInfo($goodsCategoryId,'title'); - return empty($item) ? '' : $item->title; + $grid->goods_category_id->display(function ($goodsCategoryId) use($goodsCategoryList){ + return isset($goodsCategoryList[$goodsCategoryId]) ? $goodsCategoryList[$goodsCategoryId] : ''; }); - $grid->sort->sortable(); $grid->on_sale->switch(); $grid->actions([new GoodsCopy()]); - $grid->filter(function (Grid\Filter $filter) { + $grid->filter(function (Grid\Filter $filter) use($storeList, $categoryList, $goodsCategoryList, $marketList){ + $filter->like('name'); + $filter->equal('id'); $filter->like('name'); + $filter->equal('store_id')->select($storeList); + $filter->equal('category_id')->select($categoryList); + $filter->equal('goods_category_id')->select($goodsCategoryList); + $filter->equal('market_id')->select($marketList); + $filter->equal('on_sale')->select(GoodsModel::$_ONSALE); + $filter->equal('price'); + $filter->equal('goods_unit'); }); $grid->model()->orderBy('id', 'desc'); From a17ca497a18026a1bda17af588f1c05a7ef3589c Mon Sep 17 00:00:00 2001 From: liangyuyan <1103300295@qq.com> Date: Thu, 17 Sep 2020 14:41:23 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=95=86=E5=93=81=E5=BF=AB=E6=8D=B7?= =?UTF-8?q?=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Admin/Actions/Grid/v3/GoodsImage.php | 36 ++++++++++ app/Admin/Controllers/v3/GoodsController.php | 20 +++++- app/Admin/Forms/v3/GoodsImageForm.php | 73 ++++++++++++++++++++ app/Admin/routes.php | 4 +- 4 files changed, 128 insertions(+), 5 deletions(-) create mode 100644 app/Admin/Actions/Grid/v3/GoodsImage.php create mode 100644 app/Admin/Forms/v3/GoodsImageForm.php diff --git a/app/Admin/Actions/Grid/v3/GoodsImage.php b/app/Admin/Actions/Grid/v3/GoodsImage.php new file mode 100644 index 0000000..c207fbe --- /dev/null +++ b/app/Admin/Actions/Grid/v3/GoodsImage.php @@ -0,0 +1,36 @@ +getKey(); + + $modal = Modal::make() + ->xl() + ->title($this->title) + ->body(GoodsImageForm::make()->setKey($id)) + ->button($this->title); + + return $modal; + } + + public function parameters() + { + + return [ + + ]; + } +} diff --git a/app/Admin/Controllers/v3/GoodsController.php b/app/Admin/Controllers/v3/GoodsController.php index 72b7304..d86509b 100644 --- a/app/Admin/Controllers/v3/GoodsController.php +++ b/app/Admin/Controllers/v3/GoodsController.php @@ -3,6 +3,7 @@ namespace App\Admin\Controllers\v3; use App\Admin\Actions\Grid\v3\GoodsCopy; +use App\Admin\Actions\Grid\v3\GoodsImage; use App\Admin\Repositories\v3\Goods; use Dcat\Admin\Form; use Dcat\Admin\Grid; @@ -36,8 +37,21 @@ class GoodsController extends AdminController $grid->id->sortable(); $grid->cover_img_url->image('',50); - $grid->name; - $grid->price; + $grid->name->editable(); + $grid->price->editable(); + $grid->column('goods_unit','单位')->editable(); + $grid->column('spec','规格')->display(function($spec){ + $item = ''; + if(!empty($spec)){ + foreach($spec as $key => $value){ + $specKey = isset($value['spec_key'])?$value['spec_key']:''; + $specValue = isset($value['spec_value'])?$value['spec_value']:''; + $item .= $specKey.':'.$specValue.'
'; + } + } + + return $item; + }); $grid->column('market_id')->display(function($marketId) use($marketList){ return isset($marketList[$marketId]) ? $marketList[$marketId] : ''; }); @@ -54,7 +68,7 @@ class GoodsController extends AdminController $grid->sort->sortable(); $grid->on_sale->switch(); - $grid->actions([new GoodsCopy()]); + $grid->actions([new GoodsCopy(),new GoodsImage()]); $grid->filter(function (Grid\Filter $filter) use($storeList, $categoryList, $goodsCategoryList, $marketList){ $filter->like('name'); $filter->equal('id'); diff --git a/app/Admin/Forms/v3/GoodsImageForm.php b/app/Admin/Forms/v3/GoodsImageForm.php new file mode 100644 index 0000000..0ae6a76 --- /dev/null +++ b/app/Admin/Forms/v3/GoodsImageForm.php @@ -0,0 +1,73 @@ + 0 && !empty($coverImg)){ + $data = ['cover_img' => $coverImg]; + GoodsModel::where('id',$goodsId)->update($data); + } + if($goodsId > 0 && !empty($bannerImg)){ + $banner = GoodsBannerModel::where('goods_id',$goodsId)->first(); + if(empty($banner)){ + $banner = new GoodsBanners(); + $banner->goods_id = $goodsId; + $banner->type = 1; + $banner->created_at = time(); + } + $banner->path = $bannerImg; + $banner->updated_at = time(); + $banner->save(); + } + + return $this->error('修改成功'); + } + + /** + * Build a form here. + */ + public function form() + { + $id = $this->getKey(); + $goods = GoodsModel::select('name')->find($id); + $goodName = empty($goods->name)?'':$goods->name; + $this->hidden('goods_id')->value($id); + $this->display('name','商品名称')->value($goodName); + $this->image('cover_img','封面图')->autoUpload(); + $this->image('img_banner','轮播图')->autoUpload(); + } + + /** + * The data of the form. + * + * @return array + */ + public function default() + { + return []; + } + +} diff --git a/app/Admin/routes.php b/app/Admin/routes.php index 5663b13..ec1c228 100644 --- a/app/Admin/routes.php +++ b/app/Admin/routes.php @@ -35,8 +35,8 @@ Route::group([ $router->get('/coupon/TieForm', 'CouponTieController@CouponTieForm'); $router->get('/couponTie', 'CouponTieController@CouponTieList'); - $router->resource('/coupon_setting', 'v3\couponSettingController'); - $router->resource('/coupon', 'v3\couponController'); + $router->resource('/coupon_setting', 'v3\CouponSettingController'); + $router->resource('/coupon', 'v3\CouponController'); //获取所有市场 $router->any('/api/getAllMarket', 'LanzuServiceSpeakerController@getAllMarkets');