6
0
Fork 0

store excel

base
panliang 2023-02-15 11:53:38 +08:00
parent 8fcfc148e9
commit fddb704877
4 changed files with 64 additions and 65 deletions

View File

@ -20,18 +20,19 @@ class HomeController extends Controller
->header('首页') ->header('首页')
->description('首页') ->description('首页')
->body(function (Row $row) { ->body(function (Row $row) {
$row->column(6, function (Column $column) { $user = Admin::user();
$row->column(6, function (Column $column) use ($user) {
$column->row(Dashboard::title()); $column->row(Dashboard::title());
if (Admin::user()->can('dcat.admin.home.statistics')) { if ($user->can('dcat.admin.home.statistics')) {
$column->row(new StatisticsTotal()); $column->row(new StatisticsTotal());
} }
}); });
$row->column(6, function (Column $column) { $row->column(6, function (Column $column) use ($user) {
if (Admin::user()->can('dcat.admin.home.new_users')) { if ($user->can('dcat.admin.home.new_users')) {
$column->row(new NewUsers()); $column->row(new NewUsers());
} }
if (Admin::user()->can('dcat.admin.home.orders')) { if ($user->can('dcat.admin.home.orders')) {
$column->row(new Orders()); $column->row(new Orders());
} }
}); });

View File

@ -27,6 +27,7 @@ class StoreProduct
$index = 0; $index = 0;
$storeName = $cells[$index];// 店铺名称 $storeName = $cells[$index];// 店铺名称
$goodsName = $cells[++$index];// 商品名称 $goodsName = $cells[++$index];// 商品名称
$stock = $cells[++$index];// 库存
$goodsTitle = $cells[++$index];// 商品副标题 $goodsTitle = $cells[++$index];// 商品副标题
$categoryName = $cells[++$index];// 分类名称 $categoryName = $cells[++$index];// 分类名称
$goodsImage = $cells[++$index];// 商品图片 $goodsImage = $cells[++$index];// 商品图片
@ -47,13 +48,13 @@ class StoreProduct
// https://qiniu.abcdefg.fun/banner/banner4.png,https://qiniu.abcdefg.fun/banner/banner5.png // https://qiniu.abcdefg.fun/banner/banner4.png,https://qiniu.abcdefg.fun/banner/banner5.png
$goodsContent = $cells[++$index]; $goodsContent = $cells[++$index];
$stock = $cells[++$index];// 库存
$store = Store::where(['title' => $storeName])->first(); $store = Store::where(['title' => $storeName])->first();
if (!$store) { if (!$store) {
throw new ImportException('门店 '.$storeName.' 不存在'); throw new ImportException('门店 '.$storeName.' 不存在');
} }
$product = ProductSpu::where('name', $goodsName)->first();
if (!$product) {
$goods = [ $goods = [
'name' => $goodsName, 'name' => $goodsName,
'subtitle' => $goodsTitle, 'subtitle' => $goodsTitle,
@ -103,9 +104,6 @@ class StoreProduct
'sales_value' => $saleValue, 'sales_value' => $saleValue,
'stock' => $stock, 'stock' => $stock,
]); ]);
$product = ProductSpu::where('name', $goods['name'])->first();
if (!$product) {
$product = ProductSpu::create($goods); $product = ProductSpu::create($goods);
// 属性规格 // 属性规格
if ($rowAttrs) { if ($rowAttrs) {

View File

@ -70,9 +70,9 @@ class AdminPermissionSeeder extends Seeder
'name'=>'主页', 'name'=>'主页',
'curd' => false, 'curd' => false,
'children' =>[ 'children' =>[
'home.statistics'=>['name' =>'统计预览'], 'statistics'=>['name' =>'统计预览'],
'home.new_users'=>['name' =>'新注册'], 'new_users'=>['name' =>'新注册'],
'home.orders'=>['name' =>'订单'], 'orders'=>['name' =>'订单'],
], ],
], ],
'users'=>[ 'users'=>[

Binary file not shown.