Browse Source

Merge branch 'phoenix' into develop

# Conflicts:
#	.gitignore
#	app/Admin/routes.php
#	app/Models/ImsCjdcUser.php
#	app/Models/LanzuGoods.php
#	app/Models/LanzuMmInfo.php
#	composer.lock
master
liangyuyan 5 years ago
parent
commit
6c0a8802c3
  1. 3
      .gitignore
  2. 46
      app/Admin/Common/Images.php
  3. 122
      app/Admin/Common/StoreQRCode.php
  4. 104
      app/Admin/Controllers/BannerController.php
  5. 71
      app/Admin/Controllers/CategoryController.php
  6. 162
      app/Admin/Controllers/GoodsController.php
  7. 197
      app/Admin/Controllers/StoreController.php
  8. 34
      app/Admin/Extensions/TypeCorrelationBind.php
  9. 16
      app/Admin/Repositories/Banner.php
  10. 16
      app/Admin/Repositories/Goods.php
  11. 16
      app/Admin/Repositories/Store.php
  12. 8
      app/Admin/Repositories/StoreUserReport.php
  13. 49
      app/Admin/bootstrap.php
  14. 12
      app/Admin/routes.php
  15. 79
      app/Console/Commands/MigrateMarketData.php
  16. 75
      app/Console/Commands/MigrateOrder.php
  17. 80
      app/Console/Commands/MigrateOrderGoods.php
  18. 96
      app/Console/Commands/MigrateOrderMain.php
  19. 72
      app/Console/Commands/MigrateUserAddr.php
  20. 65
      app/Console/Commands/SetGoodsMarketId.php
  21. 45
      app/Models/Banner.php
  22. 72
      app/Models/Category.php
  23. 55
      app/Models/Goods.php
  24. 18
      app/Models/GoodsBanners.php
  25. 17
      app/Models/ImsCjdcMarket.php
  26. 34
      app/Models/ImsCjdcUser.php
  27. 4
      app/Models/LanzuGoods.php
  28. 27
      app/Models/LanzuMmInfo.php
  29. 10
      app/Models/LanzuStore.php
  30. 98
      app/Models/Store.php
  31. 15
      app/Models/storeUserReport.php
  32. 1
      composer.json
  33. 88
      composer.lock
  34. 16
      config/wechat.php
  35. 36
      database/migrations/2014_10_12_000000_create_users_table.php
  36. 122
      database/migrations/2016_01_04_173148_create_admin_tables.php
  37. 35
      database/migrations/2019_08_19_000000_create_failed_jobs_table.php
  38. 35
      database/migrations/2020_08_31_112634_create_lanzu_store_type_table.php
  39. 35
      database/migrations/2020_08_31_171746_create_lanzu_goods_type_table.php
  40. 32
      database/migrations/2020_08_31_180258_create_lanzu_type_correlation_table.php
  41. 59
      database/migrations/2020_09_01_094230_create_lanzu_store_table.php
  42. 50
      database/migrations/2020_09_01_095556_create_lanzu_goods_table.php
  43. 42
      database/migrations/2020_09_03_192404_create_lanzu_banners_table.php
  44. 610
      dcat_admin_ide_helper.php
  45. 2
      public/vendors/dcat-admin/adminlte/adminlte-blue-dark.css
  46. 2
      public/vendors/dcat-admin/adminlte/adminlte-blue-light.css
  47. 2
      public/vendors/dcat-admin/adminlte/adminlte-blue.css
  48. 2
      public/vendors/dcat-admin/adminlte/adminlte-green.css
  49. 2
      public/vendors/dcat-admin/adminlte/adminlte.css
  50. 2
      public/vendors/dcat-admin/adminlte/adminlte.js
  51. 2
      public/vendors/dcat-admin/adminlte/adminlte.js.map
  52. 2
      public/vendors/dcat-admin/dcat/css/dcat-app-blue-dark.css
  53. 2
      public/vendors/dcat-admin/dcat/css/dcat-app-blue-light.css
  54. 2
      public/vendors/dcat-admin/dcat/css/dcat-app-blue.css
  55. 2
      public/vendors/dcat-admin/dcat/css/dcat-app-green.css
  56. 2
      public/vendors/dcat-admin/dcat/css/dcat-app.css
  57. 2
      public/vendors/dcat-admin/dcat/extra/action.js
  58. 2
      public/vendors/dcat-admin/dcat/extra/action.js.map
  59. 2
      public/vendors/dcat-admin/dcat/extra/grid-extend.js
  60. 2
      public/vendors/dcat-admin/dcat/extra/grid-extend.js.map
  61. 2
      public/vendors/dcat-admin/dcat/extra/upload-blue-dark.css
  62. 2
      public/vendors/dcat-admin/dcat/extra/upload-blue-light.css
  63. 2
      public/vendors/dcat-admin/dcat/extra/upload-blue.css
  64. 2
      public/vendors/dcat-admin/dcat/extra/upload-green.css
  65. 2
      public/vendors/dcat-admin/dcat/extra/upload.css
  66. 2
      public/vendors/dcat-admin/dcat/extra/upload.js
  67. 2
      public/vendors/dcat-admin/dcat/extra/upload.js.map
  68. 2
      public/vendors/dcat-admin/dcat/js/dcat-app.js
  69. 2
      public/vendors/dcat-admin/dcat/js/dcat-app.js.map
  70. BIN
      public/vendors/dcat-admin/images/default-avatar.jpg
  71. BIN
      public/vendors/dcat-admin/images/logo.png
  72. 22
      resources/lang/zh-CN/banner.php
  73. 17
      resources/lang/zh-CN/category.php
  74. 6
      resources/lang/zh-CN/global.php
  75. 40
      resources/lang/zh-CN/goods.php
  76. 43
      resources/lang/zh-CN/store.php

3
.gitignore

@ -17,4 +17,5 @@ yarn-error.log
/public/certs
/public/es_dicts.txt
/public/es_use_dicts.txt
/public/es_unuse_dicts.txt
/public/es_unuse_dicts.txt
/public/vendors

46
app/Admin/Common/Images.php

@ -9,17 +9,16 @@ use GuzzleHttp\Client;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Storage;
class Images extends AdminController
{
/**
* 获取token
*/
private function getWxToken()
{
//获取token
$row = DB::table('ims_cjdc_system')
->select('appid','appsecret')
->where('uniacid', 2)
->first();
$appid=$row->appid;
$secret=$row->appsecret;
$appid= env('WECHAT_MINI_PROGRAM_APPID');
$secret=env('WECHAT_MINI_PROGRAM_SECRET');
$url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=".$appid."&secret=".$secret;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
@ -31,6 +30,9 @@ class Images extends AdminController
return $data['access_token'];
}
/**
* 请求生成微信小程序码
*/
public function createQrCode($param,$path)
{
$access_token = $this->getWxToken();
@ -53,6 +55,31 @@ class Images extends AdminController
}
/**
* 请求生成微信二维码
* @param $param 参数
*/
public function createWeChatQrCode($param,$path)
{
$access_token = $this->getWxToken();
$data=array(
"path"=>$path.$param,
"width"=>280
);
$data = json_encode($data);
$url = "https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=".$access_token."";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$data);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
/**
* 上传文件到oss
* @param $base64 //文件流
@ -64,7 +91,6 @@ class Images extends AdminController
return Storage::put($fileName,$base64);
}
public function test()
{
$wx_head = 'http://www.marketmanage.com/uploads/20200728/d5a491cd3d8d071e3212c3478e8e35a1.jpg';
@ -72,11 +98,7 @@ class Images extends AdminController
file_put_contents('./logo.jpg',$avatar_file);
$logo = $this->changeAvatar($avatar_file);
file_put_contents('./logo_new.jpg',$logo);
//$qr_code = $this->createQrCode('','');
}

122
app/Admin/Common/StoreQRCode.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);
}
}
}

104
app/Admin/Controllers/BannerController.php

@ -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();
});
}
}

71
app/Admin/Controllers/CategoryController.php

@ -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');
});
}
}

162
app/Admin/Controllers/GoodsController.php

@ -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();
});
});
}
}

197
app/Admin/Controllers/StoreController.php

@ -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();
});
}
}

34
app/Admin/Extensions/TypeCorrelationBind.php

@ -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();
}
}

16
app/Admin/Repositories/Banner.php

@ -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;
}

16
app/Admin/Repositories/Goods.php

@ -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;
}

16
app/Admin/Repositories/Store.php

@ -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;
}

8
app/Admin/Repositories/StoreUserReport.php

@ -2,12 +2,10 @@
namespace App\Admin\Repositories;
use App\Models\storeUserReport as Model;
use App\Models\Store as Model;
use Dcat\Admin\Grid\Model as GridModel;
use Dcat\Admin\Repositories\EloquentRepository;
use App\Models\ImsCjdcOrder as orderModel;
use App\Models\StoreAccount as storeAccountModel;
use App\Models\ImsCjdcStore as storeModel;
use App\Models\StoreAccount as StoreAccountModel;
use Illuminate\Support\Facades\DB;
class StoreUserReport extends EloquentRepository
@ -28,7 +26,7 @@ class StoreUserReport extends EloquentRepository
$this->setPaginate($model);
/* 根据流水查询 2020-08-18 目前用全匹配文字方式查询新用户 */
$storeAccountModel = new storeAccountModel();
$storeAccountModel = new StoreAccountModel();
$query = $storeAccountModel::join('ims_cjdc_store as store','ims_cjdc_store_account.store_id','store.id')
->select('store_id','store.market_id','store.name as store_name',DB::raw("count(distinct ims_cjdc_store_account.id) as new_user_total"))
->whereRaw("note = '新用户下单成功,平台奖励'")

49
app/Admin/bootstrap.php

@ -5,6 +5,7 @@ use Dcat\Admin\Grid;
use Dcat\Admin\Form;
use Dcat\Admin\Grid\Filter;
use Dcat\Admin\Show;
use Dcat\Admin\Form\Field;
/**
* Dcat-admin - admin builder based on Laravel.
@ -24,3 +25,51 @@ use Dcat\Admin\Show;
* Admin::js('/packages/prettydocs/js/main.js');
*
*/
// 地图
Form\Field\Map::collectAssets();
// 官方例子,验证字符长度
Field\Text::macro('len', function (int $length, ?string $error = null) {
// 前端验证逻辑扩展
Admin::script(
<<<'JS'
Dcat.validator.extend('len', function ($el) {
console.log($el.val().length , $el.attr('data-len'));
return $el.val().length != $el.attr('data-len');
});
JS
);
// 同时添加后端验证逻辑,这个可以看需要
$this->rules('size:'.$length);
return $this->attribute([
'data-len' => $length,
'data-len-error' => str_replace(
[':attribute', ':len'],
[$this->label, $length],
$error ?: "只能输入:len个字符"
),
]);
});
/* 验证最多包含两位小数的浮点数,可不带小数 */
Field\Text::macro('floatTwo', function (int $bit = 2, ?string $error = null) {
// 前端验证逻辑扩展
Admin::script(
<<<'JS'
Dcat.validator.extend('floatTwo', function ($el) {
return !(/^(([1-9]{1}\d*)|(0{1}))(\.\d{0,2})?$/.test($el.val()));
});
JS
);
// 同时添加后端验证逻辑,这个可以看需要
// $this->rules('size:'.$length);
return $this->attribute([
'data-floatTwo' => '^(([1-9]{1}\d*)|(0{1}))(\.\d{0,2})?$',
'data-floatTwo-error' => "只能输入数字(最多包含两位小数)"
]);
});

12
app/Admin/routes.php

@ -44,5 +44,15 @@ Route::group([
//统计店铺新增用户
$router->resource('/storeUserReport', 'StoreUserReportController');
$router->any('/test', 'Test@test');
// 分类
$router->resource('/storeType', 'StoreTypeController');
$router->resource('/goodsType', 'GoodsTypeController');
$router->resource('/category', 'CategoryController');
// 店铺
$router->resource('/store', 'StoreController');
// 商品
$router->resource('/goods', 'GoodsController');
// banner
$router->resource('/banner', 'BannerController');
$router->any('/test', 'Test@test
});

79
app/Console/Commands/MigrateMarketData.php

@ -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;
}
}

75
app/Console/Commands/MigrateOrder.php

@ -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;
}
}

80
app/Console/Commands/MigrateOrderGoods.php

@ -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;
}
}

96
app/Console/Commands/MigrateOrderMain.php

@ -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;
}
}

72
app/Console/Commands/MigrateUserAddr.php

@ -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;
}
}

65
app/Console/Commands/SetGoodsMarketId.php

@ -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;
}
}

45
app/Models/Banner.php

@ -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;
}
}
}

72
app/Models/Category.php

@ -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;
}
}
}

55
app/Models/Goods.php

@ -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;
}
}
}

18
app/Models/GoodsBanners.php

@ -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'];
}

17
app/Models/ImsCjdcMarket.php

@ -11,7 +11,7 @@ class ImsCjdcMarket extends Model
use HasDateTimeFormatter;
use SoftDeletes;
protected $table = 'ims_cjdc_market';
protected $table = 'lanzu_market';
protected $dateFormat = 'U';
public function setImgsAttribute($imgs)
{
@ -35,12 +35,23 @@ class ImsCjdcMarket extends Model
*/
public static function getMarket()
{
$markets = self::get();
$item = [];
$markets = self::select('id','name')
->where('status',1)
->whereNull('deleted_at')
->get();
$item = [];
foreach ($markets as $market) {
$item[$market->id] = $market->name;
}
return $item;
}
/**
* 获取单个市场信息
*/
public static function getMarketInfo($id,$field = '*')
{
return self::select($field)->find($id);
}
}

34
app/Models/ImsCjdcUser.php

@ -10,7 +10,39 @@ use Illuminate\Database\Eloquent\Model;
class ImsCjdcUser extends Model
{
protected $table = 'ims_cjdc_user';
protected $table = 'lanzu_user';
protected $dateFormat = 'U';
/**
* 获取单个用户信息
* @param int $id
* @param string $field
* @return object
*/
public static function getUserInfo($id,$field = '*')
{
return self::select($field)->find($id);
}
/**
* 获取用户数组
* id为键,name为值
* @return array
*/
public static function getUserArray()
{
$list = self::select('id','nick_name')
->where('status',1)
->whereNull('deleted_at')
->get();
$array = [];
if(count($list) > 0){
foreach ($list as $value) {
$array[$value->id] = $value->nick_name;
}
}
return $array;
}
}

4
app/Models/LanzuGoods.php

@ -36,7 +36,7 @@ class LanzuGoods extends Model
}
/**
* 鎸囧畾 鎼滅储绱㈠紩涓�瓨鍌ㄧ殑鍞�竴ID
* 指定 搜索索引中存储的唯一ID
* @return mixed
*/
public function getScoutKey()
@ -45,7 +45,7 @@ class LanzuGoods extends Model
}
/**
* 鎸囧畾 鎼滅储绱㈠紩涓�瓨鍌ㄧ殑鍞�竴ID鐨勯敭鍚�
* 指定 搜索索引中存储的唯一ID的键名
* @return string
*/
public function getScoutKeyName()

27
app/Models/LanzuMmInfo.php

@ -36,4 +36,29 @@ class LanzuMmInfo extends Model
return self::count();
}
}
}
/**
* 获取市场经理(只搜索状态为正常的经理)
* id为键,name为值
*/
public static function getMmInfoArray()
{
$list = self::select('id','name')
->where('status',2)
->whereNull('deleted_at')
->get();
$array = [];
if(count($list) > 0){
foreach ($list as $key => $value){
$array[$value->id] = $value->name;
}
}
return $array;
}
/**
* 根据id获取单条记录
*/
public static function getMmInfo($id,$field = '*')
{
return self::select($field)->find($id);
}}

10
app/Models/LanzuStore.php

@ -11,4 +11,14 @@ class LanzuStore extends Model
use HasDateTimeFormatter;
protected $table = 'lanzu_store';
protected $dateFormat = 'U';
public $timestamps = false;
public function market(){
return $this->hasOne('\App\Models\ImsCjdcMarket','id','market_id');
}
public function storeAccount(){
return $this->hasMany(StoreAccount::class,'store_id','id');
}
}

98
app/Models/Store.php

@ -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;
}
}
}

15
app/Models/storeUserReport.php

@ -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
composer.json

@ -14,6 +14,7 @@
"fruitcake/laravel-cors": "^1.0",
"guzzlehttp/guzzle": "^6.3",
"iidestiny/laravel-filesystem-oss": "^2.0",
"intervention/image": "^2.5",
"laravel/framework": "^7.0",
"laravel/scout": "^8.3",
"laravel/tinker": "^2.0",

88
composer.lock

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "84376492bcb35a9e12770be80cda5b0e",
"content-hash": "f898c3e5903c41e38a0a604e55f7da6e",
"packages": [
{
"name": "aliyuncs/oss-sdk-php",
@ -165,16 +165,16 @@
},
{
"name": "dcat/laravel-admin",
"version": "1.6.5",
"version": "1.7.1",
"source": {
"type": "git",
"url": "https://github.com/jqhph/dcat-admin.git",
"reference": "684ea3da59a6caa8f00771781b7ff50d18759b81"
"reference": "b2694de229a9fd52f9ab048870d4e93b8ee7a505"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/jqhph/dcat-admin/zipball/684ea3da59a6caa8f00771781b7ff50d18759b81",
"reference": "684ea3da59a6caa8f00771781b7ff50d18759b81",
"url": "https://api.github.com/repos/jqhph/dcat-admin/zipball/b2694de229a9fd52f9ab048870d4e93b8ee7a505",
"reference": "b2694de229a9fd52f9ab048870d4e93b8ee7a505",
"shasum": "",
"mirrors": [
{
@ -233,7 +233,7 @@
"laravel",
"laravel admin"
],
"time": "2020-07-28T03:26:18+00:00"
"time": "2020-09-02T13:19:24+00:00"
},
{
"name": "dnoegel/php-xdg-base-dir",
@ -1501,6 +1501,82 @@
"description": "Oss storage filesystem for Laravel.",
"time": "2020-03-28T15:21:51+00:00"
},
{
"name": "intervention/image",
"version": "2.5.1",
"source": {
"type": "git",
"url": "https://github.com/Intervention/image.git",
"reference": "abbf18d5ab8367f96b3205ca3c89fb2fa598c69e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Intervention/image/zipball/abbf18d5ab8367f96b3205ca3c89fb2fa598c69e",
"reference": "abbf18d5ab8367f96b3205ca3c89fb2fa598c69e",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"ext-fileinfo": "*",
"guzzlehttp/psr7": "~1.1",
"php": ">=5.4.0"
},
"require-dev": {
"mockery/mockery": "~0.9.2",
"phpunit/phpunit": "^4.8 || ^5.7"
},
"suggest": {
"ext-gd": "to use GD library based image processing.",
"ext-imagick": "to use Imagick based image processing.",
"intervention/imagecache": "Caching extension for the Intervention Image library"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.4-dev"
},
"laravel": {
"providers": [
"Intervention\\Image\\ImageServiceProvider"
],
"aliases": {
"Image": "Intervention\\Image\\Facades\\Image"
}
}
},
"autoload": {
"psr-4": {
"Intervention\\Image\\": "src/Intervention/Image"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Oliver Vogel",
"email": "oliver@olivervogel.com",
"homepage": "http://olivervogel.com/"
}
],
"description": "Image handling and manipulation library with support for Laravel integration",
"homepage": "http://image.intervention.io/",
"keywords": [
"gd",
"image",
"imagick",
"laravel",
"thumbnail",
"watermark"
],
"time": "2019-11-02T09:15:47+00:00"
},
{
"name": "laravel/framework",
"version": "v7.22.4",

16
config/wechat.php

@ -92,14 +92,14 @@ return [
/*
* 小程序
*/
// 'mini_program' => [
// 'default' => [
// 'app_id' => env('WECHAT_MINI_PROGRAM_APPID', ''),
// 'secret' => env('WECHAT_MINI_PROGRAM_SECRET', ''),
// 'token' => env('WECHAT_MINI_PROGRAM_TOKEN', ''),
// 'aes_key' => env('WECHAT_MINI_PROGRAM_AES_KEY', ''),
// ],
// ],
'mini_program' => [
'default' => [
'app_id' => env('WECHAT_MINI_PROGRAM_APPID', ''),
'secret' => env('WECHAT_MINI_PROGRAM_SECRET', ''),
'token' => env('WECHAT_MINI_PROGRAM_TOKEN', ''),
'aes_key' => env('WECHAT_MINI_PROGRAM_AES_KEY', ''),
],
],
/*
* 微信支付

36
database/migrations/2014_10_12_000000_create_users_table.php

@ -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');
}
}

122
database/migrations/2016_01_04_173148_create_admin_tables.php

@ -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'));
}
}

35
database/migrations/2019_08_19_000000_create_failed_jobs_table.php

@ -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');
}
}

35
database/migrations/2020_08_31_112634_create_lanzu_store_type_table.php

@ -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');
}
}

35
database/migrations/2020_08_31_171746_create_lanzu_goods_type_table.php

@ -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');
}
}

32
database/migrations/2020_08_31_180258_create_lanzu_type_correlation_table.php

@ -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');
}
}

59
database/migrations/2020_09_01_094230_create_lanzu_store_table.php

@ -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');
}
}

50
database/migrations/2020_09_01_095556_create_lanzu_goods_table.php

@ -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');
}
}

42
database/migrations/2020_09_03_192404_create_lanzu_banners_table.php

@ -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

2
public/vendors/dcat-admin/dcat/extra/action.js

@ -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

BIN
public/vendors/dcat-admin/images/default-avatar.jpg

Before

Width: 70  |  Height: 70  |  Size: 3.8 KiB

After

Width: 200  |  Height: 200  |  Size: 6.8 KiB

BIN
public/vendors/dcat-admin/images/logo.png

Before

Width: 120  |  Height: 120  |  Size: 6.3 KiB

After

Width: 225  |  Height: 225  |  Size: 7.8 KiB

22
resources/lang/zh-CN/banner.php

@ -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' => [
],
];

17
resources/lang/zh-CN/category.php

@ -0,0 +1,17 @@
<?php
return [
'labels' => [
'Category' => '分类',
'category' => '分类',
],
'fields' => [
'parent_id' => '父级',
'title' => '标题',
'cover_img' => '图标',
'cover_img_url' => '图标',
'sort' => '排序',
'status' => '状态',
],
'options' => [
],
];

6
resources/lang/zh-CN/global.php

@ -30,11 +30,7 @@ return [
'root' => '顶级',
'scaffold' => '代码生成器',
],
'options' => [
'permissions' => [
],
//
],
];

40
resources/lang/zh-CN/goods.php

@ -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' => [
],
];

43
resources/lang/zh-CN/store.php

@ -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' => [
],
];
Loading…
Cancel
Save