From 84c65dfde285e4e273ba003908f2a2fd5fef400e Mon Sep 17 00:00:00 2001 From: lanzu_qsy <334039090@qq.com> Date: Wed, 5 Aug 2020 08:54:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=82=E5=9C=BA=E7=BB=8F=E7=90=86=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ImsCjdcMarketController.php | 108 ++++++++++++++++++ .../Controllers/LanzuMmInfoController.php | 87 ++++++++++++++ .../Controllers/LanzuMpInfoController.php | 44 +++---- app/Admin/Extensions/CheckRow.php | 42 +++++++ app/Admin/Repositories/ImsCjdcMarket.php | 16 +++ app/Admin/Repositories/LanzuMmInfo.php | 16 +++ app/Admin/routes.php | 3 +- app/Models/ImsCjdcMarket.php | 16 +++ app/Models/LanzuMmInfo.php | 15 +++ config/admin.php | 4 +- dcat_admin_ide_helper.php | 96 ++++++++++------ resources/lang/zh-CN/ims-cjdc-market.php | 29 +++++ resources/lang/zh-CN/lanzu-mm-info.php | 18 +++ routes/web.php | 1 + 14 files changed, 435 insertions(+), 60 deletions(-) create mode 100644 app/Admin/Controllers/ImsCjdcMarketController.php create mode 100644 app/Admin/Controllers/LanzuMmInfoController.php create mode 100644 app/Admin/Extensions/CheckRow.php create mode 100644 app/Admin/Repositories/ImsCjdcMarket.php create mode 100644 app/Admin/Repositories/LanzuMmInfo.php create mode 100644 app/Models/ImsCjdcMarket.php create mode 100644 app/Models/LanzuMmInfo.php create mode 100644 resources/lang/zh-CN/ims-cjdc-market.php create mode 100644 resources/lang/zh-CN/lanzu-mm-info.php diff --git a/app/Admin/Controllers/ImsCjdcMarketController.php b/app/Admin/Controllers/ImsCjdcMarketController.php new file mode 100644 index 0000000..02ee788 --- /dev/null +++ b/app/Admin/Controllers/ImsCjdcMarketController.php @@ -0,0 +1,108 @@ +id->sortable(); + $grid->logo->image('',50,50); + $grid->name; + $grid->column('status','状态')->display(function ($status){ + if ($status==0){ + return '禁用'; + }else{ + return '正常'; + } + }); + $grid->address; + $grid->column('addtime','创建时间'); + $grid->filter(function (Grid\Filter $filter) { + $filter->equal('id'); + + }); + }); + } + + /** + * Make a show builder. + * + * @param mixed $id + * + * @return Show + */ + protected function detail($id) + { + return Show::make($id, new ImsCjdcMarket(), function (Show $show) { + $show->id; + $show->name; + $show->logo; + $show->introduce; + $show->imgs; + $show->addtime; + $show->sort; + $show->status; + $show->coordinates; + $show->remark; + $show->address; + $show->poundage; + $show->dn_poundage; + $show->dm_poundage; + $show->yd_poundage; + $show->dada_number; + $show->is_open_dada; + $show->loudspeaker_imei; + $show->dishes_menu_intro; + $show->create_time; + $show->created_at; + $show->updated_at; + }); + } + + /** + * Make a form builder. + * + * @return Form + */ + protected function form() + { + return Form::make(new ImsCjdcMarket(), function (Form $form) { + $form->display('id'); + $form->text('name'); + $form->text('logo'); + $form->text('introduce'); + $form->text('imgs'); + $form->text('addtime'); + $form->text('sort'); + $form->text('status'); + $form->text('coordinates'); + $form->text('remark'); + $form->text('address'); + $form->text('poundage'); + $form->text('dn_poundage'); + $form->text('dm_poundage'); + $form->text('yd_poundage'); + $form->text('dada_number'); + $form->text('is_open_dada'); + $form->text('loudspeaker_imei'); + $form->text('dishes_menu_intro'); + $form->text('create_time'); + + $form->display('created_at'); + $form->display('updated_at'); + }); + } +} diff --git a/app/Admin/Controllers/LanzuMmInfoController.php b/app/Admin/Controllers/LanzuMmInfoController.php new file mode 100644 index 0000000..4ddc38c --- /dev/null +++ b/app/Admin/Controllers/LanzuMmInfoController.php @@ -0,0 +1,87 @@ +id->sortable(); + $grid->name; + $grid->phone; + $grid->id_frond->image('',50,50); + $grid->id_back->image('',50,50); + $grid->id_number; + $grid->column('status','状态')->display(function ($status){ + if ($status==1){ + return '正常'; + }else{ + return '禁用'; + } + }); + $grid->created_at->display(function ($time){ + return date('Y-m-d H:i:s',$time); + }); + $grid->filter(function (Grid\Filter $filter) { + $filter->equal('id'); + + }); + }); + } + + /** + * Make a show builder. + * + * @param mixed $id + * + * @return Show + */ + protected function detail($id) + { + return Show::make($id, new LanzuMmInfo(), function (Show $show) { + $show->id; + $show->name; + $show->phone; + $show->id_frond->image(); + $show->id_back->image(); + $show->id_number; + $show->admin_user_id; + $show->status; + $show->is_del; + $show->created_at; + $show->updated_at; + }); + } + + /** + * Make a form builder. + * + * @return Form + */ + protected function form() + { + return Form::make(new LanzuMmInfo(), function (Form $form) { + $form->display('id'); + $form->text('name'); + $form->text('phone'); + $form->image('id_frond')->uniqueName(); + $form->image('id_back')->uniqueName(); + $form->text('id_number'); + $form->text('status','状态'); + $form->display('created_at'); + $form->display('updated_at'); + }); + } +} diff --git a/app/Admin/Controllers/LanzuMpInfoController.php b/app/Admin/Controllers/LanzuMpInfoController.php index 9d2b78f..739c837 100644 --- a/app/Admin/Controllers/LanzuMpInfoController.php +++ b/app/Admin/Controllers/LanzuMpInfoController.php @@ -2,6 +2,7 @@ namespace App\Admin\Controllers; +use App\Admin\Extensions\CheckRow; use App\Admin\Repositories\LanzuMpInfo; use Dcat\Admin\Admin; use Dcat\Admin\Form; @@ -19,17 +20,23 @@ class LanzuMpInfoController extends AdminController protected function grid() { return Grid::make(new LanzuMpInfo(), function (Grid $grid) { - $grid->id->sortable(); + //$grid->id->sortable(); $grid->name; $grid->phone; $grid->bank_name; $grid->bank_card; $grid->bank_addr; - $grid->id_frond; - $grid->id_back; + $grid->id_frond->image('',50,50); + $grid->id_back->image('',50,50); $grid->id_number; - $grid->admin_user_id; - $grid->column('status','状态'); + //$grid->admin_user_id; + $grid->column('status','状态')->display(function ($status){ + if ($status==1){ + return '正常'; + }elseif($status==0){ + return '待审核'; + } + }); $grid->created_at->display(function ($time) { return date("Y-m-d H:i:s",$time); }); @@ -42,17 +49,16 @@ class LanzuMpInfoController extends AdminController $filter->like('name'); }); - $grid->actions(function (Grid\Displayers\Actions $actions) { - // append一个操作 - $actions->append('发货'); - // prepend一个操作 - $actions->prepend(''); - }); + }); } + public function test() + { + echo 11; + } /** @@ -89,23 +95,19 @@ class LanzuMpInfoController extends AdminController protected function form() { return Form::make(new LanzuMpInfo(), function (Form $form) { - - $form->creating(function (Form $form){ - echo 11222;die; - }); $form->display('id')->hideInDialog(); $form->text('name'); $form->text('phone'); $form->text('bank_name'); $form->text('bank_card'); $form->text('bank_addr'); - $form->image('id_frond'); - $form->image('id_back'); + $form->image('id_frond')->uniqueName(); + $form->image('id_back')->uniqueName(); $form->text('id_number'); - $form->text('admin_user_id'); - $form->number('status'); - $form->display('created_at'); - $form->display('updated_at'); + //$form->text('admin_user_id'); + $form->number('status','状态'); + //$form->display('created_at'); + //$form->display('updated_at'); }); } } diff --git a/app/Admin/Extensions/CheckRow.php b/app/Admin/Extensions/CheckRow.php new file mode 100644 index 0000000..df1acd4 --- /dev/null +++ b/app/Admin/Extensions/CheckRow.php @@ -0,0 +1,42 @@ +getKey(); + + // 获取当前行数据的用户名 + $username = $this->row->username; + + // 这里需要添加一个class, 和上面script方法对应 + $this->setHtmlAttribute(['data-id' => $id, 'email' => $username, 'class' => 'grid-check-row']); + + return parent::html(); + } +} diff --git a/app/Admin/Repositories/ImsCjdcMarket.php b/app/Admin/Repositories/ImsCjdcMarket.php new file mode 100644 index 0000000..09e1e92 --- /dev/null +++ b/app/Admin/Repositories/ImsCjdcMarket.php @@ -0,0 +1,16 @@ +get('/', 'HomeController@index'); $router->resource('/speaker', 'LanzuServiceSpeakerController'); $router->resource('/mp', 'LanzuMpInfoController'); - + $router->resource('/mm', 'LanzuMmInfoController'); + $router->resource('/market', 'ImsCjdcMarketController'); }); diff --git a/app/Models/ImsCjdcMarket.php b/app/Models/ImsCjdcMarket.php new file mode 100644 index 0000000..b87dbc6 --- /dev/null +++ b/app/Models/ImsCjdcMarket.php @@ -0,0 +1,16 @@ + [ - 'image' => 'images', - 'file' => 'files', + 'image' => 'mp_images', + 'file' => 'mp_files', ], ], diff --git a/dcat_admin_ide_helper.php b/dcat_admin_ide_helper.php index d749f40..d9aa1ad 100644 --- a/dcat_admin_ide_helper.php +++ b/dcat_admin_ide_helper.php @@ -35,6 +35,16 @@ namespace Dcat\Admin { * @property Grid\Column|Collection require_dev * @property Grid\Column|Collection device_name * @property Grid\Column|Collection store_id + * @property Grid\Column|Collection phone + * @property Grid\Column|Collection bank_name + * @property Grid\Column|Collection bank_card + * @property Grid\Column|Collection bank_addr + * @property Grid\Column|Collection id_frond + * @property Grid\Column|Collection id_back + * @property Grid\Column|Collection id_number + * @property Grid\Column|Collection admin_user_id + * @property Grid\Column|Collection status + * @property Grid\Column|Collection is_del * @property Grid\Column|Collection parent_id * @property Grid\Column|Collection order * @property Grid\Column|Collection icon @@ -58,7 +68,6 @@ namespace Dcat\Admin { * @property Grid\Column|Collection createtime * @property Grid\Column|Collection updatetime * @property Grid\Column|Collection token - * @property Grid\Column|Collection status * @property Grid\Column|Collection market_id * @property Grid\Column|Collection admin_id * @property Grid\Column|Collection url @@ -196,7 +205,6 @@ namespace Dcat\Admin { * @property Grid\Column|Collection is_new * @property Grid\Column|Collection rid * @property Grid\Column|Collection weid - * @property Grid\Column|Collection phone * @property Grid\Column|Collection qq * @property Grid\Column|Collection dist * @property Grid\Column|Collection address @@ -1028,6 +1036,7 @@ namespace Dcat\Admin { * @property Grid\Column|Collection receive_time * @property Grid\Column|Collection number_remain * @property Grid\Column|Collection receive_type + * @property Grid\Column|Collection rebate_type * @property Grid\Column|Collection send_user_id * @property Grid\Column|Collection one_receive_number * @property Grid\Column|Collection user_receive_id @@ -1138,13 +1147,10 @@ namespace Dcat\Admin { * @property Grid\Column|Collection logo_url * @property Grid\Column|Collection success * @property Grid\Column|Collection error - * @property Grid\Column|Collection bank_name - * @property Grid\Column|Collection bank_card - * @property Grid\Column|Collection bank_addr - * @property Grid\Column|Collection id_frond - * @property Grid\Column|Collection id_back - * @property Grid\Column|Collection id_number - * @property Grid\Column|Collection admin_user_id + * @property Grid\Column|Collection user_type + * @property Grid\Column|Collection money_type + * @property Grid\Column|Collection source_type + * @property Grid\Column|Collection comment * @property Grid\Column|Collection c_attitude * @property Grid\Column|Collection c_service * @property Grid\Column|Collection c_quality @@ -1180,6 +1186,16 @@ namespace Dcat\Admin { * @method Grid\Column|Collection require_dev(string $label = null) * @method Grid\Column|Collection device_name(string $label = null) * @method Grid\Column|Collection store_id(string $label = null) + * @method Grid\Column|Collection phone(string $label = null) + * @method Grid\Column|Collection bank_name(string $label = null) + * @method Grid\Column|Collection bank_card(string $label = null) + * @method Grid\Column|Collection bank_addr(string $label = null) + * @method Grid\Column|Collection id_frond(string $label = null) + * @method Grid\Column|Collection id_back(string $label = null) + * @method Grid\Column|Collection id_number(string $label = null) + * @method Grid\Column|Collection admin_user_id(string $label = null) + * @method Grid\Column|Collection status(string $label = null) + * @method Grid\Column|Collection is_del(string $label = null) * @method Grid\Column|Collection parent_id(string $label = null) * @method Grid\Column|Collection order(string $label = null) * @method Grid\Column|Collection icon(string $label = null) @@ -1203,7 +1219,6 @@ namespace Dcat\Admin { * @method Grid\Column|Collection createtime(string $label = null) * @method Grid\Column|Collection updatetime(string $label = null) * @method Grid\Column|Collection token(string $label = null) - * @method Grid\Column|Collection status(string $label = null) * @method Grid\Column|Collection market_id(string $label = null) * @method Grid\Column|Collection admin_id(string $label = null) * @method Grid\Column|Collection url(string $label = null) @@ -1341,7 +1356,6 @@ namespace Dcat\Admin { * @method Grid\Column|Collection is_new(string $label = null) * @method Grid\Column|Collection rid(string $label = null) * @method Grid\Column|Collection weid(string $label = null) - * @method Grid\Column|Collection phone(string $label = null) * @method Grid\Column|Collection qq(string $label = null) * @method Grid\Column|Collection dist(string $label = null) * @method Grid\Column|Collection address(string $label = null) @@ -2173,6 +2187,7 @@ namespace Dcat\Admin { * @method Grid\Column|Collection receive_time(string $label = null) * @method Grid\Column|Collection number_remain(string $label = null) * @method Grid\Column|Collection receive_type(string $label = null) + * @method Grid\Column|Collection rebate_type(string $label = null) * @method Grid\Column|Collection send_user_id(string $label = null) * @method Grid\Column|Collection one_receive_number(string $label = null) * @method Grid\Column|Collection user_receive_id(string $label = null) @@ -2283,13 +2298,10 @@ namespace Dcat\Admin { * @method Grid\Column|Collection logo_url(string $label = null) * @method Grid\Column|Collection success(string $label = null) * @method Grid\Column|Collection error(string $label = null) - * @method Grid\Column|Collection bank_name(string $label = null) - * @method Grid\Column|Collection bank_card(string $label = null) - * @method Grid\Column|Collection bank_addr(string $label = null) - * @method Grid\Column|Collection id_frond(string $label = null) - * @method Grid\Column|Collection id_back(string $label = null) - * @method Grid\Column|Collection id_number(string $label = null) - * @method Grid\Column|Collection admin_user_id(string $label = null) + * @method Grid\Column|Collection user_type(string $label = null) + * @method Grid\Column|Collection money_type(string $label = null) + * @method Grid\Column|Collection source_type(string $label = null) + * @method Grid\Column|Collection comment(string $label = null) * @method Grid\Column|Collection c_attitude(string $label = null) * @method Grid\Column|Collection c_service(string $label = null) * @method Grid\Column|Collection c_quality(string $label = null) @@ -2330,6 +2342,16 @@ namespace Dcat\Admin { * @property Show\Field|Collection require_dev * @property Show\Field|Collection device_name * @property Show\Field|Collection store_id + * @property Show\Field|Collection phone + * @property Show\Field|Collection bank_name + * @property Show\Field|Collection bank_card + * @property Show\Field|Collection bank_addr + * @property Show\Field|Collection id_frond + * @property Show\Field|Collection id_back + * @property Show\Field|Collection id_number + * @property Show\Field|Collection admin_user_id + * @property Show\Field|Collection status + * @property Show\Field|Collection is_del * @property Show\Field|Collection parent_id * @property Show\Field|Collection order * @property Show\Field|Collection icon @@ -2353,7 +2375,6 @@ namespace Dcat\Admin { * @property Show\Field|Collection createtime * @property Show\Field|Collection updatetime * @property Show\Field|Collection token - * @property Show\Field|Collection status * @property Show\Field|Collection market_id * @property Show\Field|Collection admin_id * @property Show\Field|Collection url @@ -2491,7 +2512,6 @@ namespace Dcat\Admin { * @property Show\Field|Collection is_new * @property Show\Field|Collection rid * @property Show\Field|Collection weid - * @property Show\Field|Collection phone * @property Show\Field|Collection qq * @property Show\Field|Collection dist * @property Show\Field|Collection address @@ -3323,6 +3343,7 @@ namespace Dcat\Admin { * @property Show\Field|Collection receive_time * @property Show\Field|Collection number_remain * @property Show\Field|Collection receive_type + * @property Show\Field|Collection rebate_type * @property Show\Field|Collection send_user_id * @property Show\Field|Collection one_receive_number * @property Show\Field|Collection user_receive_id @@ -3433,13 +3454,10 @@ namespace Dcat\Admin { * @property Show\Field|Collection logo_url * @property Show\Field|Collection success * @property Show\Field|Collection error - * @property Show\Field|Collection bank_name - * @property Show\Field|Collection bank_card - * @property Show\Field|Collection bank_addr - * @property Show\Field|Collection id_frond - * @property Show\Field|Collection id_back - * @property Show\Field|Collection id_number - * @property Show\Field|Collection admin_user_id + * @property Show\Field|Collection user_type + * @property Show\Field|Collection money_type + * @property Show\Field|Collection source_type + * @property Show\Field|Collection comment * @property Show\Field|Collection c_attitude * @property Show\Field|Collection c_service * @property Show\Field|Collection c_quality @@ -3475,6 +3493,16 @@ namespace Dcat\Admin { * @method Show\Field|Collection require_dev(string $label = null) * @method Show\Field|Collection device_name(string $label = null) * @method Show\Field|Collection store_id(string $label = null) + * @method Show\Field|Collection phone(string $label = null) + * @method Show\Field|Collection bank_name(string $label = null) + * @method Show\Field|Collection bank_card(string $label = null) + * @method Show\Field|Collection bank_addr(string $label = null) + * @method Show\Field|Collection id_frond(string $label = null) + * @method Show\Field|Collection id_back(string $label = null) + * @method Show\Field|Collection id_number(string $label = null) + * @method Show\Field|Collection admin_user_id(string $label = null) + * @method Show\Field|Collection status(string $label = null) + * @method Show\Field|Collection is_del(string $label = null) * @method Show\Field|Collection parent_id(string $label = null) * @method Show\Field|Collection order(string $label = null) * @method Show\Field|Collection icon(string $label = null) @@ -3498,7 +3526,6 @@ namespace Dcat\Admin { * @method Show\Field|Collection createtime(string $label = null) * @method Show\Field|Collection updatetime(string $label = null) * @method Show\Field|Collection token(string $label = null) - * @method Show\Field|Collection status(string $label = null) * @method Show\Field|Collection market_id(string $label = null) * @method Show\Field|Collection admin_id(string $label = null) * @method Show\Field|Collection url(string $label = null) @@ -3636,7 +3663,6 @@ namespace Dcat\Admin { * @method Show\Field|Collection is_new(string $label = null) * @method Show\Field|Collection rid(string $label = null) * @method Show\Field|Collection weid(string $label = null) - * @method Show\Field|Collection phone(string $label = null) * @method Show\Field|Collection qq(string $label = null) * @method Show\Field|Collection dist(string $label = null) * @method Show\Field|Collection address(string $label = null) @@ -4468,6 +4494,7 @@ namespace Dcat\Admin { * @method Show\Field|Collection receive_time(string $label = null) * @method Show\Field|Collection number_remain(string $label = null) * @method Show\Field|Collection receive_type(string $label = null) + * @method Show\Field|Collection rebate_type(string $label = null) * @method Show\Field|Collection send_user_id(string $label = null) * @method Show\Field|Collection one_receive_number(string $label = null) * @method Show\Field|Collection user_receive_id(string $label = null) @@ -4578,13 +4605,10 @@ namespace Dcat\Admin { * @method Show\Field|Collection logo_url(string $label = null) * @method Show\Field|Collection success(string $label = null) * @method Show\Field|Collection error(string $label = null) - * @method Show\Field|Collection bank_name(string $label = null) - * @method Show\Field|Collection bank_card(string $label = null) - * @method Show\Field|Collection bank_addr(string $label = null) - * @method Show\Field|Collection id_frond(string $label = null) - * @method Show\Field|Collection id_back(string $label = null) - * @method Show\Field|Collection id_number(string $label = null) - * @method Show\Field|Collection admin_user_id(string $label = null) + * @method Show\Field|Collection user_type(string $label = null) + * @method Show\Field|Collection money_type(string $label = null) + * @method Show\Field|Collection source_type(string $label = null) + * @method Show\Field|Collection comment(string $label = null) * @method Show\Field|Collection c_attitude(string $label = null) * @method Show\Field|Collection c_service(string $label = null) * @method Show\Field|Collection c_quality(string $label = null) diff --git a/resources/lang/zh-CN/ims-cjdc-market.php b/resources/lang/zh-CN/ims-cjdc-market.php new file mode 100644 index 0000000..2d3eacb --- /dev/null +++ b/resources/lang/zh-CN/ims-cjdc-market.php @@ -0,0 +1,29 @@ + [ + 'ImsCjdcMarket' => 'ImsCjdcMarket', + ], + 'fields' => [ + 'name' => '市场名称', + 'logo' => '市场logo', + 'introduce' => '介绍', + 'imgs' => '市场图片,多张用英文逗号(,)隔开', + 'addtime' => 'addtime', + 'sort' => '排序,数值越大越靠前', + 'status' => '状态,0禁用,1正常', + 'coordinates' => '坐标,经纬度', + 'remark' => '备注', + 'address' => '详细地址', + 'poundage' => '外卖手续费', + 'dn_poundage' => '店内手续费', + 'dm_poundage' => '当面手续费', + 'yd_poundage' => '预约手续费', + 'dada_number' => '达达配送 门店编号', + 'is_open_dada' => '是否开启达达配送,1开启,2关闭', + 'loudspeaker_imei' => '喇叭终端的机器码IMEI码', + 'dishes_menu_intro' => '市场菜谱简介', + 'create_time' => '测试用时间', + ], + 'options' => [ + ], +]; diff --git a/resources/lang/zh-CN/lanzu-mm-info.php b/resources/lang/zh-CN/lanzu-mm-info.php new file mode 100644 index 0000000..667f66b --- /dev/null +++ b/resources/lang/zh-CN/lanzu-mm-info.php @@ -0,0 +1,18 @@ + [ + 'LanzuMmInfo' => 'LanzuMmInfo', + ], + 'fields' => [ + 'name' => '名称', + 'phone' => '电话', + 'id_frond' => '身份证正面', + 'id_back' => '身份证反面', + 'id_number' => '身份证号', + 'admin_user_id' => '系统登陆帐号', + 'status' => '状态 /1/-1 正常/禁用', + 'is_del' => '是否删除', + ], + 'options' => [ + ], +]; diff --git a/routes/web.php b/routes/web.php index 4d5f3f8..ef78286 100644 --- a/routes/web.php +++ b/routes/web.php @@ -14,3 +14,4 @@ use Illuminate\Support\Facades\Route; */ Route::get('/', 'TestController@Test'); +