Commit 9d7f0591 by lizhilin

更新

parent 9688fd29
...@@ -44,7 +44,7 @@ protected function grid() ...@@ -44,7 +44,7 @@ protected function grid()
$card = new Card(null, $this->goods_desc); $card = new Card(null, $this->goods_desc);
return "<div style='padding:10px 10px 0;width:100%;'>$card</div>"; return "<div style='padding:10px 10px 0;width:100%;overflow:auto;'>$card</div>";
})->else(function ($column) { })->else(function ($column) {
return ''; return '';
}); });
......
...@@ -60,8 +60,12 @@ protected function grid() ...@@ -60,8 +60,12 @@ protected function grid()
}); });
$grid->actions(function (Grid\Displayers\Actions $actions) { $grid->actions(function (Grid\Displayers\Actions $actions) {
$actions->append(new MerchantAddStore('增加库存', $actions->row->goods_id)); $gid = $actions->row->goods_id;
$actions->append(new MerchantSubStore('减少库存', $actions->row->goods_id)); $goodObj = Good::find($gid);
if ($goodObj) {
$actions->append(new MerchantAddStore('增加库存', $actions->row->goods_id));
$actions->append(new MerchantSubStore('减少库存', $actions->row->goods_id));
}
}); });
}); });
} }
......
...@@ -29,8 +29,8 @@ public function getList(Request $request) ...@@ -29,8 +29,8 @@ public function getList(Request $request)
foreach ($listData as $item) { foreach ($listData as $item) {
$data['list'][] = [ $data['list'][] = [
'id' => $item->id, 'id' => $item->id,
'title' => $item->title, 'title' => $item->title ?? '',
'brief' => $item->brief, 'brief' => $item->brief ?? '',
'cover' => $item->cover ? env('IMAGE_URL') . $item->cover : '', 'cover' => $item->cover ? env('IMAGE_URL') . $item->cover : '',
'content' => $item->content, 'content' => $item->content,
'created_at' => $item->created_at ? date("Y-m-d H:i:s", strtotime($item->created_at)) : '', 'created_at' => $item->created_at ? date("Y-m-d H:i:s", strtotime($item->created_at)) : '',
......
...@@ -189,9 +189,9 @@ public function getIndexGoods(Request $request) ...@@ -189,9 +189,9 @@ public function getIndexGoods(Request $request)
'id' => $datum->id, 'id' => $datum->id,
'goods_name' => $datum->goods_name, 'goods_name' => $datum->goods_name,
'is_hot' => $datum->is_hot, 'is_hot' => $datum->is_hot,
'dg_price' => sprintf("%.2f", $dg_price), 'dg_price' => ceil($dg_price),
'market_price' => sprintf("%.2f", $market_price), 'market_price' => ceil($market_price),
'goods_price' => $mer_id ? sprintf("%.2f", $dg_price) : sprintf("%.2f", $market_price), 'goods_price' => $mer_id ? ceil($dg_price) : ceil($market_price),
'tags' => $tags, 'tags' => $tags,
'cover_img' => ($datum->cover_img) ? env('IMAGE_URL') . $datum->cover_img : '', 'cover_img' => ($datum->cover_img) ? env('IMAGE_URL') . $datum->cover_img : '',
]; ];
...@@ -262,8 +262,8 @@ public function getDetail(Request $request) ...@@ -262,8 +262,8 @@ public function getDetail(Request $request)
$data = [ $data = [
'id' => $goods->id, 'id' => $goods->id,
'goods_img' => $cover, 'goods_img' => $cover,
'goods_price' => $mer_id ? $dg_price : $market_price, 'goods_price' => $mer_id ? ceil($dg_price) : ceil($market_price),
'market_price' => $mer_id ? $market_price : '', 'market_price' => $mer_id ? ceil($market_price) : '',
'stock' => $stock, 'stock' => $stock,
'goods_name' => $goods->goods_name, 'goods_name' => $goods->goods_name,
'sale' => $goods->sale ?? 0, 'sale' => $goods->sale ?? 0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment