Merge branch 'phoenix' into develop
# Conflicts: # .gitignore # app/Admin/routes.php # app/Models/ImsCjdcUser.php # app/Models/LanzuGoods.php # app/Models/LanzuMmInfo.php # composer.lockmaster
-
3.gitignore
-
46app/Admin/Common/Images.php
-
122app/Admin/Common/StoreQRCode.php
-
104app/Admin/Controllers/BannerController.php
-
71app/Admin/Controllers/CategoryController.php
-
162app/Admin/Controllers/GoodsController.php
-
197app/Admin/Controllers/StoreController.php
-
34app/Admin/Extensions/TypeCorrelationBind.php
-
16app/Admin/Repositories/Banner.php
-
16app/Admin/Repositories/Goods.php
-
16app/Admin/Repositories/Store.php
-
8app/Admin/Repositories/StoreUserReport.php
-
49app/Admin/bootstrap.php
-
12app/Admin/routes.php
-
79app/Console/Commands/MigrateMarketData.php
-
75app/Console/Commands/MigrateOrder.php
-
80app/Console/Commands/MigrateOrderGoods.php
-
96app/Console/Commands/MigrateOrderMain.php
-
72app/Console/Commands/MigrateUserAddr.php
-
65app/Console/Commands/SetGoodsMarketId.php
-
45app/Models/Banner.php
-
72app/Models/Category.php
-
55app/Models/Goods.php
-
18app/Models/GoodsBanners.php
-
17app/Models/ImsCjdcMarket.php
-
34app/Models/ImsCjdcUser.php
-
4app/Models/LanzuGoods.php
-
27app/Models/LanzuMmInfo.php
-
10app/Models/LanzuStore.php
-
98app/Models/Store.php
-
15app/Models/storeUserReport.php
-
1composer.json
-
88composer.lock
-
16config/wechat.php
-
36database/migrations/2014_10_12_000000_create_users_table.php
-
122database/migrations/2016_01_04_173148_create_admin_tables.php
-
35database/migrations/2019_08_19_000000_create_failed_jobs_table.php
-
35database/migrations/2020_08_31_112634_create_lanzu_store_type_table.php
-
35database/migrations/2020_08_31_171746_create_lanzu_goods_type_table.php
-
32database/migrations/2020_08_31_180258_create_lanzu_type_correlation_table.php
-
59database/migrations/2020_09_01_094230_create_lanzu_store_table.php
-
50database/migrations/2020_09_01_095556_create_lanzu_goods_table.php
-
42database/migrations/2020_09_03_192404_create_lanzu_banners_table.php
-
610dcat_admin_ide_helper.php
-
2public/vendors/dcat-admin/adminlte/adminlte-blue-dark.css
-
2public/vendors/dcat-admin/adminlte/adminlte-blue-light.css
-
2public/vendors/dcat-admin/adminlte/adminlte-blue.css
-
2public/vendors/dcat-admin/adminlte/adminlte-green.css
-
2public/vendors/dcat-admin/adminlte/adminlte.css
-
2public/vendors/dcat-admin/adminlte/adminlte.js
-
2public/vendors/dcat-admin/adminlte/adminlte.js.map
-
2public/vendors/dcat-admin/dcat/css/dcat-app-blue-dark.css
-
2public/vendors/dcat-admin/dcat/css/dcat-app-blue-light.css
-
2public/vendors/dcat-admin/dcat/css/dcat-app-blue.css
-
2public/vendors/dcat-admin/dcat/css/dcat-app-green.css
-
2public/vendors/dcat-admin/dcat/css/dcat-app.css
-
2public/vendors/dcat-admin/dcat/extra/action.js
-
2public/vendors/dcat-admin/dcat/extra/action.js.map
-
2public/vendors/dcat-admin/dcat/extra/grid-extend.js
-
2public/vendors/dcat-admin/dcat/extra/grid-extend.js.map
-
2public/vendors/dcat-admin/dcat/extra/upload-blue-dark.css
-
2public/vendors/dcat-admin/dcat/extra/upload-blue-light.css
-
2public/vendors/dcat-admin/dcat/extra/upload-blue.css
-
2public/vendors/dcat-admin/dcat/extra/upload-green.css
-
2public/vendors/dcat-admin/dcat/extra/upload.css
-
2public/vendors/dcat-admin/dcat/extra/upload.js
-
2public/vendors/dcat-admin/dcat/extra/upload.js.map
-
2public/vendors/dcat-admin/dcat/js/dcat-app.js
-
2public/vendors/dcat-admin/dcat/js/dcat-app.js.map
-
BINpublic/vendors/dcat-admin/images/default-avatar.jpg
-
BINpublic/vendors/dcat-admin/images/logo.png
-
22resources/lang/zh-CN/banner.php
-
17resources/lang/zh-CN/category.php
-
6resources/lang/zh-CN/global.php
-
40resources/lang/zh-CN/goods.php
-
43resources/lang/zh-CN/store.php
@ -0,0 +1,122 @@ |
|||
<?php |
|||
|
|||
namespace App\Admin\Common; |
|||
|
|||
use Dcat\Admin\Controllers\AdminController; |
|||
use EasyWeChat\Factory; |
|||
use Intervention\Image\ImageManager; |
|||
|
|||
class StoreQRCode extends AdminController |
|||
{ |
|||
protected $images; |
|||
protected $imageManager; |
|||
|
|||
public function __construct() |
|||
{ |
|||
$this->images = new Images(); |
|||
// $this->imageManager = new ImageManager();
|
|||
} |
|||
|
|||
/** |
|||
* 生成小程序码 永久 还没完成 |
|||
* @param $scene 参数 |
|||
* @param $optional |
|||
*/ |
|||
public function getUnlimited(string $scene, array $optional = []) |
|||
{ |
|||
$wxCode = Factory::payment(config('wechat.mini_program.default')); |
|||
$res = $wxCode->app_code->getUnlimited($scene,$optional); |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 生成店铺的微信小程序码 |
|||
*/ |
|||
public function SetStoreWeChatCode($id) |
|||
{ |
|||
$codeStore = $this->images->createQrCode($id,'zh_cjdianc/pages/takeout/takeoutindex'); |
|||
$storeImgPath = 'QR_code/code_store_img/wx_store_'.$id.'.jpg'; |
|||
$res = $this->images->uploadOss($codeStore,$storeImgPath); |
|||
if($res){ |
|||
return ['status' => true ,'path' => $storeImgPath]; |
|||
}else{ |
|||
return ['status' => false ,'path' => '']; |
|||
} |
|||
} |
|||
/** |
|||
* 生成店铺收银的微信二维码 |
|||
*/ |
|||
public function SetPayWeChatCode($id) |
|||
{ |
|||
$isCREATE = env('IS_CREATE_WECHAT_MINI_QR_CODE',1); |
|||
if($isCREATE == 0){ |
|||
$codeStore = $this->images->createQrCode($id,'zh_cjdianc/pages/seller/fukuan'); |
|||
$storeImgPath = 'QR_code/code_minipay_img/wx_minipay_'.$id.'.jpg'; |
|||
}else{ |
|||
$codeStore = $this->images->createWeChatQrCode('?scene='.$id,'zh_cjdianc/pages/seller/fukuan'); |
|||
$storeImgPath = 'QR_code/code_pay_img/wx_pay_'.$id.'.jpg'; |
|||
// 裁剪
|
|||
|
|||
} |
|||
|
|||
// 裁剪测试
|
|||
// $this->imageManager->make()->resize(270,270)->insert($codeStore);
|
|||
|
|||
$res = $this->images->uploadOss($codeStore,$storeImgPath); |
|||
if($res){ |
|||
return ['status' => true ,'path' => $storeImgPath]; |
|||
}else{ |
|||
return ['status' => false ,'path' => '']; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 店铺收银码裁剪 |
|||
*/ |
|||
public function setStoreCodeImg($file_path,$storeId){ |
|||
|
|||
$save_path = './QR_code/wx_store_pay_cut/wx_pay_'.$storeId.'.jpg'; |
|||
|
|||
if(!file_exists($save_path)){ |
|||
//将图片进行裁剪
|
|||
if(file_exists($file_path)){ |
|||
$save_width = 270; |
|||
$start_spot_x = 5; |
|||
$start_spot_y = 5; |
|||
$width = 270; |
|||
$height = 270; |
|||
|
|||
$this->tailoringImg($save_path,$file_path,$save_width,$start_spot_x,$start_spot_y,$width,$height,1); |
|||
}else{ |
|||
return ''; |
|||
} |
|||
} |
|||
return $save_path; |
|||
} |
|||
|
|||
/** |
|||
* 裁剪图片 |
|||
*/ |
|||
public function tailoringImg($save_path,$file_path,$save_width,$start_spot_x,$start_spot_y,$width,$height,$display=1) |
|||
{ |
|||
if(file_exists($file_path) && is_readable($file_path)){ |
|||
//从字符串中的图像流新建一图像
|
|||
$src = imagecreatefromstring(file_get_contents($file_path)); |
|||
|
|||
//保存图片的高
|
|||
$save_height = round($save_width*$height/$width); |
|||
|
|||
//根据要保存的宽和高创建图片
|
|||
$new_image = imagecreatetruecolor($save_width, $save_height); |
|||
|
|||
//生成最后的图片
|
|||
imagecopyresampled($new_image, $src, 0, 0, $start_spot_x, $start_spot_y, $save_width, $save_height, $width, $height); |
|||
|
|||
// header('Content-Type: image/jpeg');
|
|||
imagejpeg($new_image,$save_path); |
|||
imagedestroy($src); |
|||
imagedestroy($new_image); |
|||
} |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,104 @@ |
|||
<?php |
|||
|
|||
namespace App\Admin\Controllers; |
|||
|
|||
use App\Admin\Repositories\Banner; |
|||
use Dcat\Admin\Form; |
|||
use Dcat\Admin\Grid; |
|||
use Dcat\Admin\Show; |
|||
use Dcat\Admin\Controllers\AdminController; |
|||
use App\Models\ImsCjdcMarket as MarketModel; |
|||
use App\Models\Banner as BannerModel; |
|||
|
|||
class BannerController extends AdminController |
|||
{ |
|||
/** |
|||
* Make a grid builder. |
|||
* |
|||
* @return Grid |
|||
*/ |
|||
protected function grid() |
|||
{ |
|||
return Grid::make(new Banner(), function (Grid $grid) { |
|||
$grid->column('id')->sortable(); |
|||
$grid->column('market_id')->display(function($markerId){ |
|||
$market = MarketModel::getMarketInfo($markerId,'name'); |
|||
return empty($market) ? '' : $market['name']; |
|||
}); |
|||
$grid->column('title'); |
|||
$grid->column('cover_url')->image(50); |
|||
$grid->column('cover_type')->display(function($coverType){ |
|||
return isset(BannerModel::$_coverType[$coverType]) ? BannerModel::$_coverType[$coverType] : ''; |
|||
}); |
|||
$grid->column('path'); |
|||
$grid->column('path_type')->display(function($pathType){ |
|||
return isset(BannerModel::$_pathType[$pathType]) ? BannerModel::$_pathType[$pathType] : ''; |
|||
}); |
|||
$grid->column('type')->display(function($type){ |
|||
return isset(BannerModel::$_type[$type]) ? BannerModel::$_type[$type] : ''; |
|||
}); |
|||
$grid->column('sort')->sortable(); |
|||
$grid->column('status')->using(BannerModel::$_status)->label(['default' => 'primary',1 => 'primary', 0 => 'danger']); |
|||
|
|||
$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 Banner(), function (Show $show) { |
|||
$show->field('id'); |
|||
$show->field('market_id'); |
|||
$show->field('title'); |
|||
$show->field('sub_title'); |
|||
$show->field('cover'); |
|||
$show->field('cover_type'); |
|||
$show->field('path'); |
|||
$show->field('path_type'); |
|||
$show->field('sort'); |
|||
$show->field('status'); |
|||
$show->field('type'); |
|||
$show->field('created_at'); |
|||
$show->field('updated_at'); |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* Make a form builder. |
|||
* |
|||
* @return Form |
|||
*/ |
|||
protected function form() |
|||
{ |
|||
return Form::make(new Banner(), function (Form $form) { |
|||
$form->hidden('id'); |
|||
// 市场
|
|||
$marketList = MarketModel::getMarket(); |
|||
$form->select('market_id')->width(4)->options($marketList); |
|||
$form->select('type')->options(BannerModel::$_type)->required(); |
|||
$form->text('title')->required(); |
|||
$form->text('sub_title'); |
|||
$form->image('cover')->width(2)->required(); |
|||
$form->select('cover_type')->options(BannerModel::$_coverType)->required(); |
|||
$form->text('path')->default(''); |
|||
$form->select('path_type')->options(BannerModel::$_pathType)->default(''); |
|||
$form->text('sort'); |
|||
|
|||
|
|||
$form->disableResetButton(); |
|||
$form->disableViewCheck(); |
|||
$form->disableEditingCheck(); |
|||
$form->disableCreatingCheck(); |
|||
}); |
|||
} |
|||
} |
|||
@ -0,0 +1,71 @@ |
|||
<?php |
|||
|
|||
namespace App\Admin\Controllers; |
|||
|
|||
use App\Models\Category; |
|||
use Dcat\Admin\Form; |
|||
use Dcat\Admin\Layout\Row; |
|||
use Dcat\Admin\Layout\Content; |
|||
use Dcat\Admin\Tree; |
|||
use Dcat\Admin\Controllers\AdminController; |
|||
use Dcat\Admin\Show; |
|||
|
|||
class CategoryController extends AdminController |
|||
{ |
|||
public function index(Content $content) |
|||
{ |
|||
return $content->header('分类') |
|||
->body(function (Row $row) { |
|||
$tree = new Tree(new Category); |
|||
|
|||
$tree->branch(function ($branch) { |
|||
$src = $branch['cover_img_url']; |
|||
$logo = "<img src='$src' style='margin-left: 20px; max-width:35px;max-height:35px' class='img'/>"; |
|||
|
|||
return "{$branch['id']} - {$branch['title']} $logo"; |
|||
}); |
|||
|
|||
$row->column(12, $tree); |
|||
}); |
|||
} |
|||
|
|||
public function form() |
|||
{ |
|||
return Form::make(new Category(),function (Form $form){ |
|||
|
|||
// 只查一级
|
|||
$parentList = Category::getCategoryArray([['parent_id','=',0]],[0=>'顶级']); |
|||
|
|||
$form->select('parent_id')->default(0)->options($parentList); |
|||
$form->text('title'); |
|||
$form->image('cover_img'); |
|||
|
|||
$form->number('sort'); |
|||
|
|||
$form->disableResetButton(); |
|||
$form->disableViewCheck(); |
|||
$form->disableEditingCheck(); |
|||
$form->disableCreatingCheck(); |
|||
}); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Make a show builder. |
|||
* |
|||
* @param mixed $id |
|||
* |
|||
* @return Show |
|||
*/ |
|||
protected function detail($id) |
|||
{ |
|||
return Show::make($id, new Category(), function (Show $show) { |
|||
|
|||
$show->field('parent_id'); |
|||
$show->field('title'); |
|||
$show->field('cover_img')->image(); |
|||
$show->field('sort'); |
|||
$show->field('status'); |
|||
}); |
|||
} |
|||
} |
|||
@ -0,0 +1,162 @@ |
|||
<?php |
|||
|
|||
namespace App\Admin\Controllers; |
|||
|
|||
use App\Admin\Repositories\Goods; |
|||
use Dcat\Admin\Form; |
|||
use Dcat\Admin\Grid; |
|||
use Dcat\Admin\Show; |
|||
use Dcat\Admin\Controllers\AdminController; |
|||
use App\Models\GoodsType as GoodsTypeModel; |
|||
use App\Models\Store as StoreModel; |
|||
use Dcat\Admin\Form\NestedForm; |
|||
use App\Models\Goods as GoodsModel; |
|||
use App\Models\ImsCjdcMarket as MarketModel; |
|||
|
|||
class GoodsController extends AdminController |
|||
{ |
|||
/** |
|||
* Make a grid builder. |
|||
* |
|||
* @return Grid |
|||
*/ |
|||
protected function grid() |
|||
{ |
|||
return Grid::make(new Goods(), function (Grid $grid) { |
|||
$grid->id->sortable(); |
|||
$grid->cover_img_url->image('',50); |
|||
$grid->name; |
|||
$grid->goods_type_id->display(function ($goodsTypeId){ |
|||
$goodsType = GoodsTypeModel::getGoodsInfo($goodsTypeId,'type_name'); |
|||
return empty($goodsType) ? '' : $goodsType->type_name; |
|||
}); |
|||
$grid->store_id->display(function ($storeId){ |
|||
$store = StoreModel::getStoreInfo($storeId,'name'); |
|||
return empty($store) ? '' : $store->name; |
|||
}); |
|||
|
|||
$grid->price; |
|||
|
|||
$grid->sort->sortable(); |
|||
$grid->on_sale->switch(); |
|||
|
|||
$grid->filter(function (Grid\Filter $filter) { |
|||
$filter->equal('id'); |
|||
}); |
|||
|
|||
$grid->model()->orderBy('id', 'desc'); |
|||
// 每页10条
|
|||
$grid->paginate(10); |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* Make a show builder. |
|||
* |
|||
* @param mixed $id |
|||
* |
|||
* @return Show |
|||
*/ |
|||
protected function detail($id) |
|||
{ |
|||
return Show::make($id, new Goods(), function (Show $show) { |
|||
$show->id; |
|||
$show->name; |
|||
$show->type_id; |
|||
$show->store_id; |
|||
$show->cover_img; |
|||
$show->price; |
|||
$show->original_price; |
|||
$show->vip_price; |
|||
$show->on_sale; |
|||
$show->inventory; |
|||
$show->content; |
|||
$show->sort; |
|||
$show->restrict_num; |
|||
$show->start_num; |
|||
$show->is_infinite; |
|||
$show->good_unit; |
|||
$show->tags; |
|||
$show->details_imgs; |
|||
$show->spec; |
|||
$show->created_at; |
|||
$show->updated_at; |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* Make a form builder. |
|||
* |
|||
* @return Form |
|||
*/ |
|||
protected function form() |
|||
{ |
|||
$builder = GoodsModel::with(['ImageBanners','VideoBanners']); |
|||
|
|||
return Form::make($builder, function (Form $form) { |
|||
$form->hidden('id'); |
|||
|
|||
// 二级分类(商品分类)
|
|||
$goodsTypeList = GoodsTypeModel::getGoodsTypeArray(); |
|||
// 店铺
|
|||
$storeList = StoreModel::getStoreArray(); |
|||
//市场
|
|||
$marketList = MarketModel::getMarket(); |
|||
|
|||
$form->column(6, function (Form $form) use($marketList,$storeList,$goodsTypeList ){ |
|||
$form->select('market_id')->required()->options($marketList); |
|||
$form->select('goods_type_id')->required()->options($goodsTypeList); |
|||
$form->select('store_id')->required()->options($storeList); |
|||
$form->text('name')->required()->maxLength(20); |
|||
$form->image('cover_img')->required(); |
|||
$form->number('sort'); |
|||
}); |
|||
$form->column(6, function (Form $form) { |
|||
$form->currency('price')->required()->floatTwo()->symbol('¥'); |
|||
$form->currency('original_price')->required()->floatTwo()->symbol('¥'); |
|||
$form->currency('vip_price')->required()->floatTwo()->symbol('¥'); |
|||
$form->text('good_unit')->help('如:斤,个,盒,500克,1000克,1500克等'); |
|||
$form->radio('is_infinite')->options([1=>'开启',2=>'关闭'])->default(1); |
|||
$form->number('inventory')->required()->attribute('min', 1)->default(1); |
|||
$form->number('restrict_num')->attribute('min', 0)->default(0)->help('0表示不限购'); |
|||
$form->number('start_num')->attribute('min', 1)->default(1); |
|||
}); |
|||
$form->column(12, function (Form $form) { |
|||
$form->hasMany('image_banners', function (Form\NestedForm $form) { |
|||
$form->image('path')->width(2); |
|||
$form->number('sort')->width(2)->default(0); |
|||
$form->hidden('type')->value(1)->default(1); |
|||
})->required(); |
|||
$form->divider(); |
|||
$form->hasMany('video_banners', function (Form\NestedForm $form) { |
|||
$form->file('path')->width(2); |
|||
$form->number('sort')->width(2)->default(0); |
|||
$form->hidden('type')->value(2)->default(2); |
|||
}); |
|||
$form->divider(); |
|||
|
|||
$form->multipleImage('details_imgs')->help('按图片顺序上传'); |
|||
$form->text('content')->maxLength(50); |
|||
$form->text('remark')->maxLength(50); |
|||
|
|||
$form->tags('tags','标签')->options(['新品','热销','新鲜']); |
|||
$form->table('spec', function (NestedForm $table) { |
|||
$table->text('spec_key')->help('如:净含量:500克,保质期:120天,包装:12个/盒等'); |
|||
$table->text('spec_value'); |
|||
}); |
|||
$form->switch('on_sale') |
|||
->customFormat(function ($v) { |
|||
return $v == '上架' ? 1 : 0; |
|||
}) |
|||
->saving(function ($v) { |
|||
return $v; |
|||
}); |
|||
|
|||
$form->disableResetButton(); |
|||
$form->disableViewCheck(); |
|||
$form->disableEditingCheck(); |
|||
$form->disableCreatingCheck(); |
|||
}); |
|||
}); |
|||
} |
|||
} |
|||
@ -0,0 +1,197 @@ |
|||
<?php |
|||
|
|||
namespace App\Admin\Controllers; |
|||
|
|||
use App\Admin\Repositories\Store; |
|||
use Dcat\Admin\Form; |
|||
use Dcat\Admin\Grid; |
|||
use Dcat\Admin\Show; |
|||
use Dcat\Admin\Controllers\AdminController; |
|||
use App\Models\StoreType as StoreTypeModel; |
|||
use App\Models\LanzuMmInfo as MminfoModel; |
|||
use App\Models\ImsCjdcMarket as MarketModel; |
|||
use App\Admin\Common\StoreQRCode; |
|||
use App\Admin\Repositories\StoreType; |
|||
use App\Models\Store as StoreModel; |
|||
use App\Models\ImsCjdcUser as UserModel; |
|||
|
|||
class StoreController extends AdminController |
|||
{ |
|||
/** |
|||
* Make a grid builder. |
|||
* |
|||
* @return Grid |
|||
*/ |
|||
protected function grid() |
|||
{ |
|||
return Grid::make(new Store(), function (Grid $grid) { |
|||
$grid->model()->orderBy('id','desc'); |
|||
$grid->id->sortable(); |
|||
$grid->logo_url->image('',50); |
|||
$grid->name; |
|||
|
|||
$grid->market_id->display(function ($marketId){ |
|||
$market = MarketModel::getMarketInfo($marketId,'name'); |
|||
return empty($market) ? '' : $market->name; |
|||
}); |
|||
$grid->mm_user_id->display(function ($mmUserId){ |
|||
$mmUser = MminfoModel::getMmInfo($mmUserId,'name'); |
|||
return empty($mmUser) ? '' : $mmUser->name; |
|||
}); |
|||
$grid->store_applet_img->image('',50); |
|||
$grid->cash_code_img->image('',50); |
|||
|
|||
$grid->sort->sortable(); |
|||
$grid->is_rest->switch(); |
|||
$grid->is_open->switch(); |
|||
|
|||
// 搜索
|
|||
$grid->filter(function (Grid\Filter $filter) { |
|||
$filter->equal('id'); |
|||
}); |
|||
|
|||
// 每页10条
|
|||
$grid->paginate(10); |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* Make a show builder. |
|||
* |
|||
* @param mixed $id |
|||
* |
|||
* @return Show |
|||
*/ |
|||
protected function detail($id) |
|||
{ |
|||
return Show::make($id, new Store(), function (Show $show) { |
|||
$show->id; |
|||
$show->mm_user_id; |
|||
$show->market_id; |
|||
$show->name; |
|||
$show->address; |
|||
|
|||
$show->tel; |
|||
$show->announcement; |
|||
$show->is_rest; |
|||
$show->logo; |
|||
$show->details; |
|||
$show->coordinates; |
|||
$show->business_license; |
|||
$show->store_type_id; |
|||
$show->is_open; |
|||
$show->sort; |
|||
$show->user_id; |
|||
$show->environment; |
|||
$show->expire_time; |
|||
$show->zm_img; |
|||
$show->fm_img; |
|||
$show->link_name; |
|||
$show->link_tel; |
|||
$show->admin_id; |
|||
$show->loudspeaker_imei; |
|||
|
|||
$show->time; |
|||
$show->time2; |
|||
$show->time3; |
|||
$show->time4; |
|||
|
|||
$show->created_at; |
|||
$show->updated_at; |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* Make a form builder. |
|||
* |
|||
* @return Form |
|||
*/ |
|||
protected function form() |
|||
{ |
|||
return Form::make(new Store(), function (Form $form) { |
|||
// 查询市场经理
|
|||
$mmList = MminfoModel::getMmInfoArray(); |
|||
// 查询市场
|
|||
$marketList = MarketModel::getMarket(); |
|||
// 查询一级分类(店铺分类)
|
|||
$storeTypeList = StoreTypeModel::getStoreTypeArray(); |
|||
// 用户
|
|||
$userList = UserModel::getUserArray(); |
|||
|
|||
$form->column(6, function (Form $form) use($mmList,$marketList,$storeTypeList){ |
|||
$form->hidden('id'); |
|||
$form->select('mm_user_id')->options($mmList); |
|||
$form->select('market_id')->required()->options($marketList); |
|||
$form->select('store_type_id')->required()->options($storeTypeList); |
|||
$form->text('name')->required()->maxLength(50); |
|||
$form->image('logo')->required(); |
|||
$form->mobile('tel'); |
|||
$form->text('link_name')->required(); |
|||
$form->mobile('link_tel')->required(); |
|||
$form->number('sort'); |
|||
$form->switch('is_rest') |
|||
->customFormat(function ($v) { |
|||
return $v == '休息' ? 1 : 0; |
|||
}) |
|||
->saving(function ($v) { |
|||
return $v; |
|||
}); |
|||
$form->switch('is_open') |
|||
->customFormat(function ($v) { |
|||
return $v == '开启' ? 1 : 0; |
|||
}) |
|||
->saving(function ($v) { |
|||
return $v; |
|||
})->default(1); |
|||
$form->text('address'); |
|||
}); |
|||
$form->column(6, function (Form $form) { |
|||
$form->image('business_license')->required(); |
|||
$form->image('zm_img')->required(); |
|||
$form->image('fm_img')->required(); |
|||
$form->text('admin_id')->required();/*需要优化 一个用户只能绑定一家店铺*/ |
|||
$form->text('user_id')->required();/*需要优化 一个用户只能绑定一家店铺*/ |
|||
$form->timeRange('time1','time2','营业时间段一')->required(); |
|||
$form->timeRange('time3','time4','营业时间段二'); |
|||
}); |
|||
$form->column(12, function (Form $form) { |
|||
$form->map('lat','lng','地址'); |
|||
$form->textarea('introduction')->required(); |
|||
$form->textarea('announcement'); |
|||
$form->multipleImage('environment'); |
|||
}); |
|||
|
|||
// $form->text('coordinates')->width(4)
|
|||
// ->placeholder('输入 经纬度,如: 108.281552,22.83731')
|
|||
// ->help("通过网址 <a href='https://lbs.amap.com/console/show/picker' target='_blank'>https://lbs.amap.com/console/show/picker</a> 获取经纬度");
|
|||
|
|||
$form->saved(function (Form $form){ |
|||
$id = $form->getKey(); |
|||
// $form->isCreating() &&
|
|||
if(!empty($id)){ |
|||
$qrCode = new StoreQRCode(); |
|||
// 生成小程序码 店铺
|
|||
$sRes = $qrCode->SetStoreWeChatCode($id); |
|||
|
|||
// 生产小程序码 收银
|
|||
$pRes = $qrCode->SetPayWeChatCode($id); |
|||
|
|||
// 保存图片
|
|||
$store = StoreModel::find($id); |
|||
$store->store_applet_img = $sRes['status'] ? $sRes['path'] : ''; |
|||
$store->cash_code_img = $pRes['status'] ? $pRes['path'] : '';; |
|||
$store->save(); |
|||
|
|||
// 剪裁图片
|
|||
// $form->image('cash_code_img')->crop(270, 270, [5, 5]);
|
|||
} |
|||
}); |
|||
|
|||
$form->disableResetButton(); |
|||
$form->disableViewCheck(); |
|||
$form->disableEditingCheck(); |
|||
$form->disableCreatingCheck(); |
|||
}); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
<?php |
|||
namespace App\Admin\Extensions; |
|||
|
|||
use Dcat\Admin\Grid\RowAction; |
|||
|
|||
class TypeCorrelationBind extends RowAction |
|||
{ |
|||
public function title() |
|||
{ |
|||
return '绑定'; |
|||
} |
|||
|
|||
/** |
|||
* 添加JS |
|||
* |
|||
* @return string |
|||
*/ |
|||
protected function script() |
|||
{ |
|||
return <<<JS |
|||
$('.type-bind-row').on('click', function () { |
|||
// Your code.
|
|||
window.location.href ='/admin/coupon/TieForm'; |
|||
}); |
|||
JS; |
|||
} |
|||
|
|||
public function html() |
|||
{ |
|||
$this->setHtmlAttribute(['class' => 'coupon-edit-row']); |
|||
return parent::html(); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
<?php |
|||
|
|||
namespace App\Admin\Repositories; |
|||
|
|||
use App\Models\Banner as Model; |
|||
use Dcat\Admin\Repositories\EloquentRepository; |
|||
|
|||
class Banner extends EloquentRepository |
|||
{ |
|||
/** |
|||
* Model. |
|||
* |
|||
* @var string |
|||
*/ |
|||
protected $eloquentClass = Model::class; |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
<?php |
|||
|
|||
namespace App\Admin\Repositories; |
|||
|
|||
use App\Models\Goods as Model; |
|||
use Dcat\Admin\Repositories\EloquentRepository; |
|||
|
|||
class Goods extends EloquentRepository |
|||
{ |
|||
/** |
|||
* Model. |
|||
* |
|||
* @var string |
|||
*/ |
|||
protected $eloquentClass = Model::class; |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
<?php |
|||
|
|||
namespace App\Admin\Repositories; |
|||
|
|||
use App\Models\Store as Model; |
|||
use Dcat\Admin\Repositories\EloquentRepository; |
|||
|
|||
class Store extends EloquentRepository |
|||
{ |
|||
/** |
|||
* Model. |
|||
* |
|||
* @var string |
|||
*/ |
|||
protected $eloquentClass = Model::class; |
|||
} |
|||
@ -0,0 +1,79 @@ |
|||
<?php |
|||
|
|||
namespace App\Console\Commands; |
|||
|
|||
use Illuminate\Console\Command; |
|||
use Illuminate\Support\Facades\DB; |
|||
|
|||
class MigrateMarketData extends Command |
|||
{ |
|||
/** |
|||
* The name and signature of the console command. |
|||
* |
|||
* @var string |
|||
*/ |
|||
protected $signature = 'migrateData:market'; |
|||
|
|||
/** |
|||
* The console command description. |
|||
* |
|||
* @var string |
|||
*/ |
|||
protected $description = 'migrate market data'; |
|||
|
|||
/** |
|||
* Create a new command instance. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function __construct() |
|||
{ |
|||
parent::__construct(); |
|||
} |
|||
|
|||
/** |
|||
* Execute the console command. |
|||
* |
|||
* @return int |
|||
*/ |
|||
public function handle() |
|||
{ |
|||
|
|||
// get old data from old table
|
|||
$oldData = DB::table('ims_cjdc_market')->get(); |
|||
|
|||
$bar = $this->output->createProgressBar(count($oldData)); |
|||
$bar->start(); |
|||
|
|||
$newData = []; |
|||
foreach ($oldData as $key => $value) { |
|||
$coordinates = explode(',', $value->coordinates); |
|||
$newData[] = [ |
|||
'mp_id' => $value->mp_id ?? 0, |
|||
'name' => $value->name ?? '', |
|||
'logo' => $value->logo ?? '', |
|||
'introduce' => $value->introduce ?? '', |
|||
'imgs' => $value->imgs ?? '', |
|||
'province_id' => 2162, |
|||
'city_id' => 2163, |
|||
'region_id' => 0, |
|||
'address' => $value->address ?? '', |
|||
'tel' => $value->tel ?? '', |
|||
'lat' => $coordinates[0] ?? '', |
|||
'lng' => $coordinates[1] ?? '', |
|||
'status' => $value->status ?? 1, |
|||
'sort' => $value->sort ?? 1, |
|||
'created_at' => $value->addtime ? strtotime($value->addtime) : 0, |
|||
'updated_at' => $value->addtime ? strtotime($value->addtime) : 0, |
|||
]; |
|||
|
|||
$bar->advance(); |
|||
} |
|||
|
|||
// insert new data to new table
|
|||
DB::table('lanzu_market')->insert($newData); |
|||
|
|||
$bar->finish(); |
|||
return 0; |
|||
} |
|||
} |
|||
@ -0,0 +1,75 @@ |
|||
<?php |
|||
|
|||
namespace App\Console\Commands; |
|||
|
|||
use Illuminate\Console\Command; |
|||
use Illuminate\Support\Facades\DB; |
|||
|
|||
class MigrateOrder extends Command |
|||
{ |
|||
/** |
|||
* The name and signature of the console command. |
|||
* |
|||
* @var string |
|||
*/ |
|||
protected $signature = 'migrateData:order'; |
|||
|
|||
/** |
|||
* The console command description. |
|||
* |
|||
* @var string |
|||
*/ |
|||
protected $description = 'migrate order data'; |
|||
|
|||
/** |
|||
* Create a new command instance. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function __construct() |
|||
{ |
|||
parent::__construct(); |
|||
} |
|||
|
|||
/** |
|||
* Execute the console command. |
|||
* |
|||
* @return int |
|||
*/ |
|||
public function handle() |
|||
{ |
|||
|
|||
// get old data from old table
|
|||
$oldData = DB::table('ims_cjdc_order')->get(); |
|||
|
|||
$bar = $this->output->createProgressBar(count($oldData)); |
|||
$bar->start(); |
|||
|
|||
$newData = []; |
|||
foreach ($oldData as $key => $value) { |
|||
$newData[] = [ |
|||
'order_main_id' => $value->order_main_id ?? 0, |
|||
'user_id' => $value->user_id ?? 0, |
|||
'store_id' => $value->store_id ?? 0, |
|||
'status' => 1, |
|||
'refund_time' => 0, |
|||
'order_num' => $value->order_num ?? '', |
|||
'money' => $value->money ?? 0, |
|||
'oid' => $value->oid ?? 0, |
|||
'refuse_refund_note' => '', |
|||
'refund_note' => '', |
|||
'note' => $value->note ?? '', |
|||
'created_at' => $value->time_add ? strtotime($value->time_add) : 0, |
|||
'updated_at' => $value->time_add ? strtotime($value->time_add) : 0, |
|||
]; |
|||
|
|||
$bar->advance(); |
|||
} |
|||
|
|||
// insert new data to new table
|
|||
DB::table('lanzu_order')->insert($newData); |
|||
|
|||
$bar->finish(); |
|||
return 0; |
|||
} |
|||
} |
|||
@ -0,0 +1,80 @@ |
|||
<?php |
|||
|
|||
namespace App\Console\Commands; |
|||
|
|||
use Illuminate\Console\Command; |
|||
use Illuminate\Support\Facades\DB; |
|||
|
|||
class MigrateOrderGoods extends Command |
|||
{ |
|||
/** |
|||
* The name and signature of the console command. |
|||
* |
|||
* @var string |
|||
*/ |
|||
protected $signature = 'migrateData:orderGoods'; |
|||
|
|||
/** |
|||
* The console command description. |
|||
* |
|||
* @var string |
|||
*/ |
|||
protected $description = 'migrate order goods data'; |
|||
|
|||
/** |
|||
* Create a new command instance. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function __construct() |
|||
{ |
|||
parent::__construct(); |
|||
} |
|||
|
|||
/** |
|||
* Execute the console command. |
|||
* |
|||
* @return int |
|||
*/ |
|||
public function handle() |
|||
{ |
|||
|
|||
// get old data from old table
|
|||
$oldData = DB::table('ims_cjdc_order_goods')->get(); |
|||
|
|||
$bar = $this->output->createProgressBar(count($oldData)); |
|||
$bar->start(); |
|||
|
|||
$newData = []; |
|||
foreach ($oldData as $key => $value) { |
|||
|
|||
$goods =DB::table('ims_cjdc_goods')->find($value->good_id); |
|||
|
|||
$newData[] = [ |
|||
'order_id' => $value->order_id ?? 0, |
|||
'goods_id' => $value->good_id ?? 0, |
|||
'number' => $value->number ?? 0, |
|||
'status' => 1, |
|||
'price' => $value->money ?? 0, |
|||
'original_price' => $goods->money2 ?? 0, |
|||
'vip_price' => $goods->vip_money ?? 0, |
|||
'name' => $value->name ?? '', |
|||
'goods_unit' => $value->good_unit ?? '', |
|||
'cover_img' => $value->img ?? '', |
|||
'spec' => json_encode([]), |
|||
'refund_time' => 0, |
|||
'created_at' => time(), |
|||
'updated_at' => time(), |
|||
'refuse_refund_note' => '', |
|||
]; |
|||
|
|||
$bar->advance(); |
|||
} |
|||
|
|||
// insert new data to new table
|
|||
DB::table('lanzu_order_goods')->insert($newData); |
|||
|
|||
$bar->finish(); |
|||
return 0; |
|||
} |
|||
} |
|||
@ -0,0 +1,96 @@ |
|||
<?php |
|||
|
|||
namespace App\Console\Commands; |
|||
|
|||
use Illuminate\Console\Command; |
|||
use Illuminate\Support\Facades\DB; |
|||
|
|||
class MigrateOrderMain extends Command |
|||
{ |
|||
/** |
|||
* The name and signature of the console command. |
|||
* |
|||
* @var string |
|||
*/ |
|||
protected $signature = 'migrateData:orderMain'; |
|||
|
|||
/** |
|||
* The console command description. |
|||
* |
|||
* @var string |
|||
*/ |
|||
protected $description = 'migrate order main data'; |
|||
|
|||
/** |
|||
* Create a new command instance. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function __construct() |
|||
{ |
|||
parent::__construct(); |
|||
} |
|||
|
|||
/** |
|||
* Execute the console command. |
|||
* |
|||
* @return int |
|||
*/ |
|||
public function handle() |
|||
{ |
|||
|
|||
// get old data from old table
|
|||
$oldData = DB::table('ims_cjdc_order_main')->get(); |
|||
|
|||
$bar = $this->output->createProgressBar(count($oldData)); |
|||
$bar->start(); |
|||
|
|||
$newData = []; |
|||
foreach ($oldData as $key => $value) { |
|||
|
|||
$newData[] = [ |
|||
'market_id' => $value->market_id ?? 0, |
|||
'order_num' => $value->order_num ?? '', |
|||
'global_order_id' => $value->global_order_id ?? 0, |
|||
'user_id' => $value->user_id ?? 0, |
|||
'pay_type' => $value->pay_type ?? 0, |
|||
'type' => $value->type ?? 0, |
|||
'order_type' => $value->order_type ?? 0, |
|||
'shipping_type' => $value->dada_status==0 ? 1 : 2, |
|||
'money' => $value->money ?? 0, |
|||
'total_money' => $value->total_money ?? 0, |
|||
'services_money' => 0, |
|||
'coupon_money' => $value->yhq_money2 ?? 0, |
|||
'delivery_money' => $value->dada_fee ?? 0, |
|||
'state' => $value->state ?? 0, |
|||
'pay_time' => $value->pay_time ? strtotime($value->pay_time) : 0, |
|||
'receive_time' => $value->jd_time ? strtotime($value->jd_time) : 0, |
|||
'delivery_time' => 0, |
|||
'complete_time' => $value->complete_time ? strtotime($value->complete_time) : 0, |
|||
'cancel_time' => $value->complete_time ? strtotime($value->complete_time) : 0, |
|||
'refund_time' => $value->refund_time ?? 0, |
|||
'tel' => $value->tel ?? '', |
|||
'address' => $value->address ?? '', |
|||
'lat' => $value->lat ?? '', |
|||
'lng' => $value->lng ?? '', |
|||
'name' => $value->name ?? '', |
|||
'print_num' => $value->print_num ?? 0, |
|||
'plat' => $value->plat ?? 0, |
|||
'refuse_refund_note' => $value->refuse_refund_note ?? '', |
|||
'delivery_time_note' => $value->delivery_time ?? '', |
|||
'total_refund_note' => $value->total_refund_note ?? '', |
|||
'note' => $value->note ?? '', |
|||
'created_at' => $value->time_add ?? 0, |
|||
'updated_at' => 0, |
|||
]; |
|||
|
|||
$bar->advance(); |
|||
} |
|||
|
|||
// insert new data to new table
|
|||
DB::table('lanzu_order_main')->insert($newData); |
|||
|
|||
$bar->finish(); |
|||
return 0; |
|||
} |
|||
} |
|||
@ -0,0 +1,72 @@ |
|||
<?php |
|||
|
|||
namespace App\Console\Commands; |
|||
|
|||
use Illuminate\Console\Command; |
|||
use Illuminate\Support\Facades\DB; |
|||
|
|||
class MigrateUserAddr extends Command |
|||
{ |
|||
/** |
|||
* The name and signature of the console command. |
|||
* |
|||
* @var string |
|||
*/ |
|||
protected $signature = 'migrateData:userAddr'; |
|||
|
|||
/** |
|||
* The console command description. |
|||
* |
|||
* @var string |
|||
*/ |
|||
protected $description = 'migrate user addr data'; |
|||
|
|||
/** |
|||
* Create a new command instance. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function __construct() |
|||
{ |
|||
parent::__construct(); |
|||
} |
|||
|
|||
/** |
|||
* Execute the console command. |
|||
* |
|||
* @return int |
|||
*/ |
|||
public function handle() |
|||
{ |
|||
|
|||
// get old data from old table
|
|||
$oldData = DB::table('ims_cjdc_useradd')->get(); |
|||
|
|||
$bar = $this->output->createProgressBar(count($oldData)); |
|||
$bar->start(); |
|||
|
|||
$newData = []; |
|||
foreach ($oldData as $key => $value) { |
|||
$newData[] = [ |
|||
'user_id' => $value->user_id ?? '', |
|||
'user_name' => $value->user_name ?? '', |
|||
'address' => $value->address ?? '', |
|||
'gender' => $value->sex ?? 0, |
|||
'lat' => $value->lat ?? '', |
|||
'lng' => $value->lng ?? '', |
|||
'tel' => $value->tel ?? '', |
|||
'tags' => json_encode([]), |
|||
'created_at' => time(), |
|||
'updated_at' => time(), |
|||
]; |
|||
|
|||
$bar->advance(); |
|||
} |
|||
|
|||
// insert new data to new table
|
|||
DB::table('lanzu_user_address')->insert($newData); |
|||
|
|||
$bar->finish(); |
|||
return 0; |
|||
} |
|||
} |
|||
@ -0,0 +1,65 @@ |
|||
<?php |
|||
|
|||
namespace App\Console\Commands; |
|||
|
|||
use Illuminate\Console\Command; |
|||
use App\Models\LanzuGoods; |
|||
|
|||
use App\Models\LanzuStore; |
|||
|
|||
|
|||
class SetGoodsMarketId extends Command |
|||
{ |
|||
/** |
|||
* The name and signature of the console command. |
|||
* |
|||
* @var string |
|||
*/ |
|||
protected $signature = 'command:SetGoodsMarketId'; |
|||
|
|||
/** |
|||
* The console command description. |
|||
* |
|||
* @var string |
|||
*/ |
|||
protected $description = 'Command 根据商品表中storeid设置市场id'; |
|||
|
|||
/** |
|||
* Create a new command instance. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function __construct() |
|||
{ |
|||
parent::__construct(); |
|||
} |
|||
|
|||
/** |
|||
* Execute the console command. |
|||
* |
|||
* @return int |
|||
*/ |
|||
public function handle() |
|||
{ |
|||
|
|||
$goods = LanzuGoods::all(); |
|||
|
|||
$no_store_ids = []; |
|||
|
|||
foreach($goods as $key => $item){ |
|||
$store = LanzuStore::find($item->store_id); |
|||
if($store){ |
|||
$item->market_id = $store->market_id; |
|||
$item->save(); |
|||
print_r($item->id.'\r\n'); |
|||
}else{ |
|||
$no_store_ids[] = $item->store_id; |
|||
break; |
|||
} |
|||
} |
|||
|
|||
var_dump($no_store_ids); |
|||
|
|||
return 0; |
|||
} |
|||
} |
|||
@ -0,0 +1,45 @@ |
|||
<?php |
|||
|
|||
namespace App\Models; |
|||
|
|||
use Dcat\Admin\Traits\HasDateTimeFormatter; |
|||
use Illuminate\Database\Eloquent\SoftDeletes; |
|||
use Illuminate\Database\Eloquent\Model; |
|||
|
|||
class Banner extends Model |
|||
{ |
|||
use HasDateTimeFormatter; |
|||
use SoftDeletes; |
|||
|
|||
protected $table = 'lanzu_banners'; |
|||
protected $dateFormat = 'U'; |
|||
|
|||
protected $appends = [ |
|||
'cover_url', |
|||
]; |
|||
|
|||
public static $_coverType = [1=>'图片', 2=>'视频']; |
|||
public static $_pathType = ['page'=>'page','webview'=>'webview','applet'=>'applet']; |
|||
public static $_type = [1=>'首页']; |
|||
public static $_status = ['禁用', '正常']; |
|||
|
|||
public function getCoverUrlAttribute($value) |
|||
{ |
|||
$value = $value ? $value : $this->cover; |
|||
return $this->imageUrl($value); |
|||
} |
|||
|
|||
/** |
|||
* 处理旧图片 |
|||
* @param $value |
|||
* @return string |
|||
*/ |
|||
public function imageUrl($value) |
|||
{ |
|||
if(strripos($value,"http") === false){ |
|||
return env('OSS_IMG_HOST').'/'.$value; |
|||
}else{ |
|||
return $value; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,72 @@ |
|||
<?php |
|||
|
|||
namespace App\Models; |
|||
|
|||
use Illuminate\Database\Eloquent\SoftDeletes; |
|||
use Dcat\Admin\Traits\ModelTree; |
|||
use Illuminate\Database\Eloquent\Model; |
|||
|
|||
class Category extends Model |
|||
{ |
|||
use ModelTree; |
|||
use SoftDeletes; |
|||
|
|||
protected $table = 'lanzu_category'; |
|||
protected $dateFormat = 'U'; |
|||
|
|||
// 父级ID字段名称,默认值为 parent_id
|
|||
// protected $parentColumn = 'pid';
|
|||
|
|||
// 排序字段名称,默认值为 order
|
|||
protected $orderColumn = 'sort'; |
|||
|
|||
// 标题字段名称,默认值为 title
|
|||
// protected $titleColumn = 'name';
|
|||
|
|||
protected $appends = [ |
|||
'cover_img_url', |
|||
]; |
|||
public function getCoverImgUrlAttribute($value) |
|||
{ |
|||
$value = $value ? $value : $this->cover_img; |
|||
return $this->imageUrl($value); |
|||
} |
|||
/** |
|||
* 获取二级分类数组 |
|||
* id为键,name为值 |
|||
* @return array |
|||
*/ |
|||
public static function getCategoryArray($where = [],$options = []) |
|||
{ |
|||
$model = self::select('id','title') |
|||
->where('status',1) |
|||
->whereNull('deleted_at'); |
|||
|
|||
if(count($where) > 0){ |
|||
$model->where($where); |
|||
} |
|||
$list = $model->get(); |
|||
$array = empty($options) ? [] : $options; |
|||
if(count($list) > 0){ |
|||
foreach ($list as $value) { |
|||
$array[$value->id] = $value->title; |
|||
} |
|||
} |
|||
|
|||
return $array; |
|||
} |
|||
|
|||
/** |
|||
* 处理旧图片 |
|||
* @param $value |
|||
* @return string |
|||
*/ |
|||
public function imageUrl($value) |
|||
{ |
|||
if(strripos($value,"http") === false){ |
|||
return env('OSS_IMG_HOST').'/'.$value; |
|||
}else{ |
|||
return $value; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,55 @@ |
|||
<?php |
|||
|
|||
namespace App\Models; |
|||
|
|||
use Dcat\Admin\Traits\HasDateTimeFormatter; |
|||
use Illuminate\Database\Eloquent\SoftDeletes; |
|||
use Illuminate\Database\Eloquent\Model; |
|||
use App\Models\Store as StoreModel; |
|||
|
|||
class Goods extends Model |
|||
{ |
|||
use HasDateTimeFormatter; |
|||
use SoftDeletes; |
|||
|
|||
protected $table = 'lanzu_goods'; |
|||
protected $dateFormat = 'U'; |
|||
protected $appends = [ |
|||
'cover_img_url', |
|||
]; |
|||
|
|||
protected $casts = [ |
|||
'details_imgs'=>'array', |
|||
'tags'=>'array', |
|||
'spec'=>'array', |
|||
]; |
|||
|
|||
public function getCoverImgUrlAttribute($value) |
|||
{ |
|||
$value = $value ? $value : $this->cover_img; |
|||
return $this->imageUrl($value); |
|||
} |
|||
|
|||
public function ImageBanners(){ |
|||
return $this->hasMany('\App\Models\GoodsBanners','goods_id','id')->where('type',1); |
|||
} |
|||
|
|||
public function VideoBanners(){ |
|||
return $this->hasMany('\App\Models\GoodsBanners','goods_id','id')->where('type',2); |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 处理旧图片 |
|||
* @param $value |
|||
* @return string |
|||
*/ |
|||
public function imageUrl($value) |
|||
{ |
|||
if(strripos($value,"http") === false){ |
|||
return env('OSS_IMG_HOST').'/'.$value; |
|||
}else{ |
|||
return $value; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
<?php |
|||
|
|||
namespace App\Models; |
|||
|
|||
use Dcat\Admin\Traits\HasDateTimeFormatter; |
|||
use Illuminate\Database\Eloquent\SoftDeletes; |
|||
use Illuminate\Database\Eloquent\Model; |
|||
|
|||
class GoodsBanners extends Model |
|||
{ |
|||
use HasDateTimeFormatter; |
|||
use SoftDeletes; |
|||
|
|||
protected $table = 'lanzu_goods_banner'; |
|||
protected $dateFormat = 'U'; |
|||
protected $fillable = ['path', 'id', 'goods_id','type','url']; |
|||
|
|||
} |
|||
@ -0,0 +1,98 @@ |
|||
<?php |
|||
|
|||
namespace App\Models; |
|||
|
|||
use Dcat\Admin\Traits\HasDateTimeFormatter; |
|||
use Illuminate\Database\Eloquent\SoftDeletes; |
|||
use Illuminate\Database\Eloquent\Model; |
|||
use App\Models\ImsCjdcMarket as MarketModel; |
|||
use App\Models\StoreType as StoreTypeModel; |
|||
|
|||
class Store extends Model |
|||
{ |
|||
use HasDateTimeFormatter; |
|||
use SoftDeletes; |
|||
|
|||
protected $table = 'lanzu_store'; |
|||
protected $dateFormat = 'U'; |
|||
|
|||
protected $appends = [ |
|||
'logo_url', |
|||
]; |
|||
|
|||
public function getLogoUrlAttribute($value) |
|||
{ |
|||
$value = $value ? $value : $this->logo; |
|||
return $this->imageUrl($value); |
|||
} |
|||
|
|||
/** |
|||
* 获取商家环境图片 |
|||
* @param $value $this->environment |
|||
* @return array |
|||
*/ |
|||
public function getEnvironmentAttribute($value) |
|||
{ |
|||
$value = $value ? $value : $this->environmant; |
|||
return $value ? explode(',',$value) : []; |
|||
} |
|||
public function setEnvironmentAttribute($value) |
|||
{ |
|||
$this->attributes['environment'] = implode(',',$value); |
|||
} |
|||
|
|||
/** |
|||
* 是否开启店铺 |
|||
*/ |
|||
public function getIsOpenAttribute($value) |
|||
{ |
|||
$value = $value ? $value : ''; |
|||
return $value ? explode(',',$value) : []; |
|||
} |
|||
public function setIsOpenAttribute($value) |
|||
{ |
|||
$this->attributes['is_open'] = 1; |
|||
} |
|||
|
|||
/** |
|||
* 获取单个店铺信息 |
|||
* @param int $id |
|||
* @param string $field |
|||
* @return string |
|||
*/ |
|||
public static function getStoreInfo($id,$field = '*') |
|||
{ |
|||
return self::select($field)->find($id); |
|||
} |
|||
|
|||
/** |
|||
* 获取店铺数组 |
|||
* id为键,name为值 |
|||
* @return array |
|||
*/ |
|||
public static function getStoreArray() |
|||
{ |
|||
$list = self::select('id','name') |
|||
->where('status',2) |
|||
->whereNull('deleted_at') |
|||
->get(); |
|||
$array = []; |
|||
if(count($list) > 0){ |
|||
foreach ($list as $value) { |
|||
$array[$value->id] = $value->name; |
|||
} |
|||
} |
|||
|
|||
return $array; |
|||
} |
|||
|
|||
// 处理图片
|
|||
public function imageUrl($value) |
|||
{ |
|||
if(strripos($value,"http") === false){ |
|||
return env('OSS_IMG_HOST').'/'.$value; |
|||
}else{ |
|||
return $value; |
|||
} |
|||
} |
|||
} |
|||
@ -1,15 +0,0 @@ |
|||
<?php |
|||
|
|||
namespace App\Models; |
|||
|
|||
use Dcat\Admin\Traits\HasDateTimeFormatter; |
|||
|
|||
use Illuminate\Database\Eloquent\Model; |
|||
|
|||
class storeUserReport extends Model |
|||
{ |
|||
use HasDateTimeFormatter; |
|||
protected $table = 'ims_cjdc_store'; |
|||
public $timestamps = false; |
|||
|
|||
} |
|||
@ -1,36 +0,0 @@ |
|||
<?php |
|||
|
|||
use Illuminate\Database\Migrations\Migration; |
|||
use Illuminate\Database\Schema\Blueprint; |
|||
use Illuminate\Support\Facades\Schema; |
|||
|
|||
class CreateUsersTable extends Migration |
|||
{ |
|||
/** |
|||
* Run the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function up() |
|||
{ |
|||
Schema::create('users', function (Blueprint $table) { |
|||
$table->id(); |
|||
$table->string('name'); |
|||
$table->string('email')->unique(); |
|||
$table->timestamp('email_verified_at')->nullable(); |
|||
$table->string('password'); |
|||
$table->rememberToken(); |
|||
$table->timestamps(); |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* Reverse the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function down() |
|||
{ |
|||
Schema::dropIfExists('users'); |
|||
} |
|||
} |
|||
@ -1,122 +0,0 @@ |
|||
<?php |
|||
|
|||
use Illuminate\Database\Migrations\Migration; |
|||
use Illuminate\Database\Schema\Blueprint; |
|||
use Illuminate\Support\Facades\Schema; |
|||
|
|||
class CreateAdminTables extends Migration |
|||
{ |
|||
public function getConnection() |
|||
{ |
|||
return config('database.connection') ?: config('database.default'); |
|||
} |
|||
|
|||
public function config($key) |
|||
{ |
|||
return config('admin.'.$key); |
|||
} |
|||
|
|||
/** |
|||
* Run the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function up() |
|||
{ |
|||
Schema::create($this->config('database.users_table'), function (Blueprint $table) { |
|||
$table->bigIncrements('id'); |
|||
$table->string('username', 120)->unique(); |
|||
$table->string('password', 80); |
|||
$table->string('name'); |
|||
$table->string('avatar')->nullable(); |
|||
$table->string('remember_token', 100)->nullable(); |
|||
$table->timestamps(); |
|||
}); |
|||
|
|||
Schema::create($this->config('database.roles_table'), function (Blueprint $table) { |
|||
$table->bigIncrements('id'); |
|||
$table->string('name', 50); |
|||
$table->string('slug', 50)->unique(); |
|||
$table->timestamps(); |
|||
}); |
|||
|
|||
Schema::create($this->config('database.permissions_table'), function (Blueprint $table) { |
|||
$table->bigIncrements('id'); |
|||
$table->string('name', 50); |
|||
$table->string('slug', 50)->unique(); |
|||
$table->string('http_method')->nullable(); |
|||
$table->text('http_path')->nullable(); |
|||
$table->integer('order')->default(0); |
|||
$table->bigInteger('parent_id')->default(0); |
|||
$table->timestamps(); |
|||
}); |
|||
|
|||
Schema::create($this->config('database.menu_table'), function (Blueprint $table) { |
|||
$table->bigIncrements('id'); |
|||
$table->bigInteger('parent_id')->default(0); |
|||
$table->integer('order')->default(0); |
|||
$table->string('title', 50); |
|||
$table->string('icon', 50)->nullable(); |
|||
$table->string('uri', 50)->nullable(); |
|||
|
|||
$table->timestamps(); |
|||
}); |
|||
|
|||
Schema::create($this->config('database.role_users_table'), function (Blueprint $table) { |
|||
$table->bigInteger('role_id'); |
|||
$table->bigInteger('user_id'); |
|||
$table->unique(['role_id', 'user_id']); |
|||
$table->timestamps(); |
|||
}); |
|||
|
|||
Schema::create($this->config('database.role_permissions_table'), function (Blueprint $table) { |
|||
$table->bigInteger('role_id'); |
|||
$table->bigInteger('permission_id'); |
|||
$table->unique(['role_id', 'permission_id']); |
|||
$table->timestamps(); |
|||
}); |
|||
|
|||
Schema::create($this->config('database.role_menu_table'), function (Blueprint $table) { |
|||
$table->bigInteger('role_id'); |
|||
$table->bigInteger('menu_id'); |
|||
$table->unique(['role_id', 'menu_id']); |
|||
$table->timestamps(); |
|||
}); |
|||
|
|||
Schema::create($this->config('database.permission_menu_table'), function (Blueprint $table) { |
|||
$table->bigInteger('permission_id'); |
|||
$table->bigInteger('menu_id'); |
|||
$table->unique(['permission_id', 'menu_id']); |
|||
$table->timestamps(); |
|||
}); |
|||
|
|||
Schema::create($this->config('database.operation_log_table'), function (Blueprint $table) { |
|||
$table->bigIncrements('id'); |
|||
$table->bigInteger('user_id'); |
|||
$table->string('path'); |
|||
$table->string('method', 10); |
|||
$table->string('ip'); |
|||
$table->text('input'); |
|||
$table->index('user_id'); |
|||
$table->timestamps(); |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* Reverse the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function down() |
|||
{ |
|||
Schema::dropIfExists($this->config('database.users_table')); |
|||
Schema::dropIfExists($this->config('database.roles_table')); |
|||
Schema::dropIfExists($this->config('database.permissions_table')); |
|||
Schema::dropIfExists($this->config('database.menu_table')); |
|||
Schema::dropIfExists($this->config('database.role_users_table')); |
|||
Schema::dropIfExists($this->config('database.role_permissions_table')); |
|||
Schema::dropIfExists($this->config('database.role_menu_table')); |
|||
Schema::dropIfExists($this->config('database.permission_menu_table')); |
|||
Schema::dropIfExists($this->config('database.operation_log_table')); |
|||
} |
|||
} |
|||
@ -1,35 +0,0 @@ |
|||
<?php |
|||
|
|||
use Illuminate\Database\Migrations\Migration; |
|||
use Illuminate\Database\Schema\Blueprint; |
|||
use Illuminate\Support\Facades\Schema; |
|||
|
|||
class CreateFailedJobsTable extends Migration |
|||
{ |
|||
/** |
|||
* Run the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function up() |
|||
{ |
|||
Schema::create('failed_jobs', function (Blueprint $table) { |
|||
$table->id(); |
|||
$table->text('connection'); |
|||
$table->text('queue'); |
|||
$table->longText('payload'); |
|||
$table->longText('exception'); |
|||
$table->timestamp('failed_at')->useCurrent(); |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* Reverse the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function down() |
|||
{ |
|||
Schema::dropIfExists('failed_jobs'); |
|||
} |
|||
} |
|||
@ -0,0 +1,35 @@ |
|||
<?php |
|||
|
|||
use Illuminate\Support\Facades\Schema; |
|||
use Illuminate\Database\Schema\Blueprint; |
|||
use Illuminate\Database\Migrations\Migration; |
|||
|
|||
class CreateLanzuStoreTypeTable extends Migration |
|||
{ |
|||
/** |
|||
* Run the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function up() |
|||
{ |
|||
Schema::create('lanzu_store_type', function (Blueprint $table) { |
|||
$table->increments('id'); |
|||
$table->string('type_name')->default('')->comment('分类名称'); |
|||
$table->string('cover_img')->default('')->comment('封面图'); |
|||
$table->integer('sort')->default('0')->nullable()->comment('排序'); |
|||
$table->timestamps(); |
|||
$table->softDeletes(); |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* Reverse the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function down() |
|||
{ |
|||
Schema::dropIfExists('lanzu_store_type'); |
|||
} |
|||
} |
|||
@ -0,0 +1,35 @@ |
|||
<?php |
|||
|
|||
use Illuminate\Support\Facades\Schema; |
|||
use Illuminate\Database\Schema\Blueprint; |
|||
use Illuminate\Database\Migrations\Migration; |
|||
|
|||
class CreateLanzuGoodsTypeTable extends Migration |
|||
{ |
|||
/** |
|||
* Run the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function up() |
|||
{ |
|||
Schema::create('lanzu_goods_type', function (Blueprint $table) { |
|||
$table->increments('id'); |
|||
$table->string('type_name')->default('')->comment('分类名称'); |
|||
$table->string('cover_img')->nullable()->comment('封面图'); |
|||
$table->integer('sort')->nullable()->comment('排序'); |
|||
$table->timestamps(); |
|||
$table->softDeletes(); |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* Reverse the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function down() |
|||
{ |
|||
Schema::dropIfExists('lanzu_goods_type'); |
|||
} |
|||
} |
|||
@ -0,0 +1,32 @@ |
|||
<?php |
|||
|
|||
use Illuminate\Support\Facades\Schema; |
|||
use Illuminate\Database\Schema\Blueprint; |
|||
use Illuminate\Database\Migrations\Migration; |
|||
|
|||
class CreateLanzuTypeCorrelationTable extends Migration |
|||
{ |
|||
/** |
|||
* Run the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function up() |
|||
{ |
|||
Schema::create('lanzu_type_correlation', function (Blueprint $table) { |
|||
$table->increments('id'); |
|||
$table->integer('store_type_id')->default('0')->nullable()->comment('一级分类(店铺分类)'); |
|||
$table->integer('goods_type_id')->default('0')->nullable()->comment('二级分类(商品分类)'); |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* Reverse the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function down() |
|||
{ |
|||
Schema::dropIfExists('lanzu_type_correlation'); |
|||
} |
|||
} |
|||
@ -0,0 +1,59 @@ |
|||
<?php |
|||
|
|||
use Illuminate\Support\Facades\Schema; |
|||
use Illuminate\Database\Schema\Blueprint; |
|||
use Illuminate\Database\Migrations\Migration; |
|||
|
|||
class CreateLanzuStoreTable extends Migration |
|||
{ |
|||
/** |
|||
* Run the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function up() |
|||
{ |
|||
Schema::create('lanzu_store', function (Blueprint $table) { |
|||
$table->increments('id'); |
|||
$table->integer('market_id')->default('0')->comment('所属市场'); |
|||
$table->string('name')->default('')->comment('商家名称'); |
|||
$table->string('address')->default('')->comment('商家地址'); |
|||
$table->string('time')->default('')->comment('营业时间'); |
|||
$table->string('time2')->default('')->comment('营业时间'); |
|||
$table->string('time3')->nullable()->comment('营业时间'); |
|||
$table->string('time4')->nullable()->comment('营业时间'); |
|||
$table->string('tel')->default('')->comment('电话(座机)'); |
|||
$table->string('announcement')->nullable()->comment('公告'); |
|||
$table->integer('is_rest')->default('2')->comment('是否休息'); |
|||
$table->string('logo')->default('')->comment('logo'); |
|||
$table->text('details')->comment('商家简介'); |
|||
$table->string('coordinates')->default('')->comment('经纬度'); |
|||
$table->text('business_license')->comment('营业资质'); |
|||
$table->integer('store_type_id')->default('0')->comment('店铺所属分类'); |
|||
$table->integer('is_open')->default('1')->comment('是否开启门店'); |
|||
$table->integer('sort')->default('0')->comment('排序'); |
|||
$table->integer('user_id')->default('0')->comment('提现用户id'); |
|||
$table->text('environment')->nullable()->comment('商家环境'); |
|||
$table->string('expire_time')->nullable()->comment('到期时间'); |
|||
$table->string('zm_img')->default('')->comment('身份证正面'); |
|||
$table->string('fm_img')->default('')->comment('身份证反面'); |
|||
$table->string('link_name')->default('')->comment('联系人姓名'); |
|||
$table->string('link_tel')->default('')->comment('电话号码(手机)'); |
|||
$table->integer('admin_id')->default('0')->comment('管理员'); |
|||
$table->char('loudspeaker_imei')->nullable()->comment('喇叭终端的机器码IMEI码'); |
|||
$table->bigInteger('mm_user_id')->default('0')->comment('所属市场经理ID'); |
|||
$table->timestamps(); |
|||
$table->softDeletes(); |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* Reverse the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function down() |
|||
{ |
|||
Schema::dropIfExists('lanzu_store'); |
|||
} |
|||
} |
|||
@ -0,0 +1,50 @@ |
|||
<?php |
|||
|
|||
use Illuminate\Support\Facades\Schema; |
|||
use Illuminate\Database\Schema\Blueprint; |
|||
use Illuminate\Database\Migrations\Migration; |
|||
|
|||
class CreateLanzuGoodsTable extends Migration |
|||
{ |
|||
/** |
|||
* Run the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function up() |
|||
{ |
|||
Schema::create('lanzu_goods', function (Blueprint $table) { |
|||
$table->increments('id'); |
|||
$table->string('name')->default('')->comment('商品名称'); |
|||
$table->integer('type_id')->comment('商品所属分类'); |
|||
$table->integer('store_id')->comment('所属商家'); |
|||
$table->string('cover_img')->default('')->comment('封面图'); |
|||
$table->decimal('price')->comment('售价'); |
|||
$table->decimal('original_price')->comment('原价'); |
|||
$table->decimal('vip_price')->comment('会员价'); |
|||
$table->integer('on_sale')->default('1')->comment('是否上架'); |
|||
$table->integer('inventory')->comment('库存'); |
|||
$table->string('content')->default('')->comment('简介'); |
|||
$table->integer('sort')->comment('排序'); |
|||
$table->integer('restrict_num')->comment('限购份数'); |
|||
$table->integer('start_num')->comment('起售份数'); |
|||
$table->integer('is_infinite')->default('1')->comment('是否开启无限库存'); |
|||
$table->string('good_unit')->nullable()->comment('商品单位'); |
|||
$table->json('tags')->nullable()->comment('标签'); |
|||
$table->json('details_imgs')->nullable()->comment('详情图片'); |
|||
$table->json('spec')->nullable()->comment('规格'); |
|||
$table->timestamps(); |
|||
$table->softDeletes(); |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* Reverse the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function down() |
|||
{ |
|||
Schema::dropIfExists('lanzu_goods'); |
|||
} |
|||
} |
|||
@ -0,0 +1,42 @@ |
|||
<?php |
|||
|
|||
use Illuminate\Support\Facades\Schema; |
|||
use Illuminate\Database\Schema\Blueprint; |
|||
use Illuminate\Database\Migrations\Migration; |
|||
|
|||
class CreateLanzuBannersTable extends Migration |
|||
{ |
|||
/** |
|||
* Run the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function up() |
|||
{ |
|||
Schema::create('lanzu_banners', function (Blueprint $table) { |
|||
$table->increments('id'); |
|||
$table->bigInteger('market_id')->default('0')->comment('市场'); |
|||
$table->string('title')->default('')->comment('标题'); |
|||
$table->string('sub_title')->default('')->comment('副标题'); |
|||
$table->string('cover')->default('')->comment('封面'); |
|||
$table->integer('cover_type')->default('1')->comment('封面类型'); |
|||
$table->string('path')->default('')->comment('链接'); |
|||
$table->char('path_type')->comment('链接类型'); |
|||
$table->integer('sort')->default('0')->comment('排序'); |
|||
$table->integer('status')->default('1')->comment('状态'); |
|||
$table->integer('type')->default('0')->comment('位置'); |
|||
$table->timestamps(); |
|||
$table->softDeletes(); |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* Reverse the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function down() |
|||
{ |
|||
Schema::dropIfExists('lanzu_banners'); |
|||
} |
|||
} |
|||
610
dcat_admin_ide_helper.php
File diff suppressed because it is too large
View File
2
public/vendors/dcat-admin/adminlte/adminlte-blue-dark.css
File diff suppressed because it is too large
View File
2
public/vendors/dcat-admin/adminlte/adminlte-blue-light.css
File diff suppressed because it is too large
View File
2
public/vendors/dcat-admin/adminlte/adminlte-blue.css
File diff suppressed because it is too large
View File
2
public/vendors/dcat-admin/adminlte/adminlte-green.css
File diff suppressed because it is too large
View File
2
public/vendors/dcat-admin/adminlte/adminlte.css
File diff suppressed because it is too large
View File
2
public/vendors/dcat-admin/adminlte/adminlte.js
File diff suppressed because it is too large
View File
2
public/vendors/dcat-admin/adminlte/adminlte.js.map
File diff suppressed because it is too large
View File
2
public/vendors/dcat-admin/dcat/css/dcat-app-blue-dark.css
File diff suppressed because it is too large
View File
2
public/vendors/dcat-admin/dcat/css/dcat-app-blue-light.css
File diff suppressed because it is too large
View File
2
public/vendors/dcat-admin/dcat/css/dcat-app-blue.css
File diff suppressed because it is too large
View File
2
public/vendors/dcat-admin/dcat/css/dcat-app-green.css
File diff suppressed because it is too large
View File
2
public/vendors/dcat-admin/dcat/css/dcat-app.css
File diff suppressed because it is too large
View File
@ -1,2 +1,2 @@ |
|||
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=6)}({6:function(e,t,n){e.exports=n(7)},7:function(module,exports){function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),e}!function(Dcat){var Action=function(){function Action(e){_classCallCheck(this,Action),this.options=$.extend({selector:null,event:"click",method:"POST",key:null,url:null,data:{},confirm:null,calledClass:null,before:function(e,t){},html:function(e,t,n){e.html(t)},success:function(e,t){},error:function(e,t){}},e),this._bind()}return _createClass(Action,[{key:"_bind",value:function(){var e=this,t=e.options;$(t.selector).off(t.event).on(t.event,(function(n){var o=$(this).data(),r=$(this);if(!(r.attr("loading")>0)&&!1!==t.before(o,r,e)){var a=t.confirm;a?Dcat.confirm(a[0],a[1],i):i()}function i(){r.attr("loading",1),Object.assign(o,t.data),e._buildActionPromise(r,o).then(e._resolver()).catch(e._reject())}}))}},{key:"_resolver",value:function _resolver(){var _this=this,options=_this.options;return function(result){var response=result[0],target=result[1];if(!1!==options.success(target,response)){if("object"!==_typeof(response))return Dcat.error({type:"error",title:"Oops!"});var then=function then(_then){switch(_then.action){case"refresh":Dcat.reload();break;case"download":window.open(_then.value,"_blank");break;case"redirect":Dcat.reload(_then.value);break;case"location":window.location=_then.value;break;case"script":!function(){eval(_then.value)}()}};"string"==typeof response.html&&response.html&&options.html(target,response.html,response),"string"==typeof response.data.message&&response.data.type&&Dcat[response.data.type](response.data.message),response.data.then&&then(response.data.then)}}}},{key:"_reject",value:function(){var e=this.options;return function(t){var n=t[0],o=t[1];!1!==e.success(o,n)&&(n&&"object"===_typeof(n.responseJSON)&&Dcat.error(n.responseJSON.message),console.error(n))}}},{key:"_buildActionPromise",value:function(e,t){var n=this.options;return new Promise((function(o,r){Object.assign(t,{_token:Dcat.token,_action:n.calledClass,_key:n.key}),Dcat.NP.start(),$.ajax({method:n.method,url:n.url,data:t,success:function(t){e.attr("loading",0),Dcat.NP.done(),o([t,e])},error:function(t){e.attr("loading",0),Dcat.NP.done(),r([t,e])}})}))}}]),Action}();Dcat.Action=function(e){return new Action(e)}}(Dcat)}}); |
|||
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=6)}({6:function(e,t,n){e.exports=n(7)},7:function(module,exports){function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),e}!function(Dcat){var Action=function(){function Action(e){_classCallCheck(this,Action),this.options=$.extend({selector:null,event:"click",method:"POST",key:null,url:null,data:{},confirm:null,calledClass:null,before:function(e,t){},html:function(e,t,n){e.html(t)},success:function(e,t){},error:function(e,t){}},e),this.init()}return _createClass(Action,[{key:"init",value:function(){var e=this,t=e.options;$(t.selector).off(t.event).on(t.event,(function(n){var o=$(this).data(),r=$(this);if(!(r.attr("loading")>0)&&!1!==t.before(o,r,e)){var a=t.confirm;a?Dcat.confirm(a[0],a[1],s):s()}function s(){r.attr("loading",1),Object.assign(o,t.data),e.promise(r,o).then(e.resolve()).catch(e.reject())}}))}},{key:"resolve",value:function resolve(){var _this=this,options=_this.options;return function(result){var response=result[0],target=result[1];if(!1!==options.success(target,response)){if("object"!==_typeof(response))return Dcat.error({type:"error",title:"Oops!"});var then=function then(_then){switch(_then.action){case"refresh":Dcat.reload();break;case"download":window.open(_then.value,"_blank");break;case"redirect":Dcat.reload(_then.value);break;case"location":window.location=_then.value;break;case"script":!function(){eval(_then.value)}()}};"string"==typeof response.html&&response.html&&options.html(target,response.html,response),"string"==typeof response.data.message&&response.data.type&&Dcat[response.data.type](response.data.message),response.data.then&&then(response.data.then)}}}},{key:"reject",value:function(){var e=this.options;return function(t){var n=t[0],o=t[1];!1!==e.success(o,n)&&(n&&"object"===_typeof(n.responseJSON)&&Dcat.error(n.responseJSON.message),console.error(n))}}},{key:"promise",value:function(e,t){var n=this.options;return new Promise((function(o,r){Object.assign(t,{_action:n.calledClass,_key:n.key}),Dcat.NP.start(),$.ajax({method:n.method,url:n.url,data:t,success:function(t){e.attr("loading",0),Dcat.NP.done(),o([t,e])},error:function(t){e.attr("loading",0),Dcat.NP.done(),r([t,e])}})}))}}]),Action}();Dcat.Action=function(e){return new Action(e)}}(Dcat)}}); |
|||
//# sourceMappingURL=action.js.map
|
|||
2
public/vendors/dcat-admin/dcat/extra/action.js.map
File diff suppressed because it is too large
View File
2
public/vendors/dcat-admin/dcat/extra/grid-extend.js
File diff suppressed because it is too large
View File
2
public/vendors/dcat-admin/dcat/extra/grid-extend.js.map
File diff suppressed because it is too large
View File
2
public/vendors/dcat-admin/dcat/extra/upload-blue-dark.css
File diff suppressed because it is too large
View File
2
public/vendors/dcat-admin/dcat/extra/upload-blue-light.css
File diff suppressed because it is too large
View File
2
public/vendors/dcat-admin/dcat/extra/upload-blue.css
File diff suppressed because it is too large
View File
2
public/vendors/dcat-admin/dcat/extra/upload-green.css
File diff suppressed because it is too large
View File
2
public/vendors/dcat-admin/dcat/extra/upload.css
File diff suppressed because it is too large
View File
2
public/vendors/dcat-admin/dcat/extra/upload.js
File diff suppressed because it is too large
View File
2
public/vendors/dcat-admin/dcat/extra/upload.js.map
File diff suppressed because it is too large
View File
2
public/vendors/dcat-admin/dcat/js/dcat-app.js
File diff suppressed because it is too large
View File
2
public/vendors/dcat-admin/dcat/js/dcat-app.js.map
File diff suppressed because it is too large
View File
|
Before Width: 70 | Height: 70 | Size: 3.8 KiB After Width: 200 | Height: 200 | Size: 6.8 KiB |
|
Before Width: 120 | Height: 120 | Size: 6.3 KiB After Width: 225 | Height: 225 | Size: 7.8 KiB |
@ -0,0 +1,22 @@ |
|||
<?php |
|||
return [ |
|||
'labels' => [ |
|||
'Banner' => '横幅管理', |
|||
'banner' => '横幅管理', |
|||
], |
|||
'fields' => [ |
|||
'market_id' => '市场', |
|||
'title' => '标题', |
|||
'sub_title' => '副标题', |
|||
'cover' => '封面图', |
|||
'cover_url' => '封面图', |
|||
'cover_type' => '封面类型', |
|||
'path' => '链接', |
|||
'path_type' => '链接类型', |
|||
'sort' => '排序', |
|||
'status' => '状态', |
|||
'type' => '位置', |
|||
], |
|||
'options' => [ |
|||
], |
|||
]; |
|||
@ -0,0 +1,17 @@ |
|||
<?php |
|||
return [ |
|||
'labels' => [ |
|||
'Category' => '分类', |
|||
'category' => '分类', |
|||
], |
|||
'fields' => [ |
|||
'parent_id' => '父级', |
|||
'title' => '标题', |
|||
'cover_img' => '图标', |
|||
'cover_img_url' => '图标', |
|||
'sort' => '排序', |
|||
'status' => '状态', |
|||
], |
|||
'options' => [ |
|||
], |
|||
]; |
|||
@ -0,0 +1,40 @@ |
|||
<?php |
|||
return [ |
|||
'labels' => [ |
|||
'Goods' => '商品管理', |
|||
'goods' => '商品管理', |
|||
], |
|||
'fields' => [ |
|||
'name' => '商品名称', |
|||
'goods_type_id' => '商品所属分类', |
|||
'store_id' => '所属商家', |
|||
'cover_img' => '封面图', |
|||
'cover_img_url' => '封面图', |
|||
'banners' => '轮播图', |
|||
'banner_imgs' => '轮播图', |
|||
'banner_video' => '轮播图中的短视频', |
|||
'price' => '售价', |
|||
'original_price' => '原价', |
|||
'vip_price' => '会员价', |
|||
'on_sale' => '是否上架', |
|||
'inventory' => '库存', |
|||
'content' => '简介', |
|||
'sort' => '排序', |
|||
'restrict_num' => '限购份数', |
|||
'start_num' => '起售份数', |
|||
'is_infinite' => '开启无限库存', |
|||
'good_unit' => '商品单位', |
|||
'tags' => '标签', |
|||
'details_imgs' => '详情图片', |
|||
'spec' => '规格', |
|||
'unit_number' => '单位前的数', |
|||
'remark' => '备注', |
|||
'spec_key' =>'规格名称', |
|||
'spec_value' => '规格参数', |
|||
'market_id' => '市场', |
|||
'image_banners' => '轮播图片', |
|||
'video_banners' => '轮播视频' |
|||
], |
|||
'options' => [ |
|||
], |
|||
]; |
|||
@ -0,0 +1,43 @@ |
|||
<?php |
|||
return [ |
|||
'labels' => [ |
|||
'Store' => '店铺管理', |
|||
'store' => '店铺管理', |
|||
], |
|||
'fields' => [ |
|||
'market_id' => '所属市场', |
|||
'market_name' => '所属市场', |
|||
'name' => '商家名称', |
|||
'address' => '商家地址', |
|||
'time' => '营业时间', |
|||
'time2' => '营业时间', |
|||
'time3' => '营业时间', |
|||
'time4' => '营业时间', |
|||
'tel' => '电话(座机)', |
|||
'announcement' => '公告', |
|||
'is_rest' => '是否休息', |
|||
'logo' => 'logo', |
|||
'logo_url' => 'logo', |
|||
'introduction' => '商家简介', |
|||
'coordinates' => '经纬度', |
|||
'business_license' => '营业资质', |
|||
'store_type_id' => '店铺所属分类', |
|||
'store_type_name' => '店铺分类', |
|||
'is_open' => '开启门店', |
|||
'sort' => '排序', |
|||
'user_id' => '提现用户', |
|||
'environment' => '商家环境', |
|||
'expire_time' => '到期时间', |
|||
'zm_img' => '身份证正面', |
|||
'fm_img' => '身份证反面', |
|||
'link_name' => '联系人姓名', |
|||
'link_tel' => '手机号码', |
|||
'admin_id' => '管理员', |
|||
'loudspeaker_imei' => '喇叭终端的机器码IMEI码', |
|||
'mm_user_id' => '所属市场经理', |
|||
'cash_code_img' => '商家收银码', |
|||
'store_applet_img' => '商家小程序码' |
|||
], |
|||
'options' => [ |
|||
], |
|||
]; |
|||