Commit ed851adc by lizhilin

更新

parent 3342603a
...@@ -233,6 +233,9 @@ protected function form() ...@@ -233,6 +233,9 @@ protected function form()
$skuCon = json_encode($skuArr, JSON_UNESCAPED_UNICODE); $skuCon = json_encode($skuArr, JSON_UNESCAPED_UNICODE);
DB::table('li_goods')->where("id", $goods_id)->update(['sku' => $skuCon]); DB::table('li_goods')->where("id", $goods_id)->update(['sku' => $skuCon]);
} }
if (isset($_POST['is_show']) && $_POST['is_show'] == 0) {
DB::table('li_user_collect')->where('goods_id', $goods_id)->update(['deleted_at' => DB::raw('CURRENT_TIMESTAMP')]);
}
}); });
$form->submitted(function (Form $form) { $form->submitted(function (Form $form) {
$goods_id = $form->getKey(); $goods_id = $form->getKey();
......
...@@ -76,6 +76,12 @@ protected function form() ...@@ -76,6 +76,12 @@ protected function form()
$form->disableViewCheck(); $form->disableViewCheck();
$form->disableDeleteButton(); $form->disableDeleteButton();
$form->disableViewButton(); $form->disableViewButton();
$form->disableListButton();
$form->disableResetButton();
$form->saved(function (Form $form) {
return $form->response()->success('保存成功')->redirect('/setting/1/edit');
});
}); });
} }
} }
...@@ -586,6 +586,7 @@ public function OrderInfo(Request $request) ...@@ -586,6 +586,7 @@ public function OrderInfo(Request $request)
'mobile' => $orderObj->mobile, 'mobile' => $orderObj->mobile,
'order_status' => $order_status, 'order_status' => $order_status,
'status_txt' => $status_txt, 'status_txt' => $status_txt,
'verification_code' => $orderObj->verification_code ?? '',
'delivery' => $delivery, 'delivery' => $delivery,
'delivery_type' => $orderObj->delivery_type, 'delivery_type' => $orderObj->delivery_type,
'delivery_typename' => ($orderObj->delivery_type == 1) ? '快递代收点' : '送货上门', 'delivery_typename' => ($orderObj->delivery_type == 1) ? '快递代收点' : '送货上门',
......
...@@ -46,7 +46,9 @@ public function collectOpt(Request $request) ...@@ -46,7 +46,9 @@ public function collectOpt(Request $request)
public function collectList(Request $request) public function collectList(Request $request)
{ {
$user_id = $request->user()->id; $userObj = $request->user();
$user_id = $userObj->id;
$merchant_id = $userObj->merchant_id;
$page = $request->page ?? 1; $page = $request->page ?? 1;
$limit = $request->limit ?? 10; $limit = $request->limit ?? 10;
$sql = UserCollect::where(['uid' => $user_id, 'deleted_at' => null]); $sql = UserCollect::where(['uid' => $user_id, 'deleted_at' => null]);
...@@ -60,18 +62,14 @@ public function collectList(Request $request) ...@@ -60,18 +62,14 @@ public function collectList(Request $request)
foreach ($listData as $datum) { foreach ($listData as $datum) {
$goods_id = $datum->goods_id; $goods_id = $datum->goods_id;
$goodObj = GoodModel::select(['goods_name', 'cover_img', 'tags'])->find($goods_id); $goodObj = GoodModel::select(['goods_name', 'cover_img', 'tags'])->find($goods_id);
$is_jd = (int)$goodObj->is_jd;
$attrRowObj = GoodSku::where("goods_id", $goods_id)->first(); $attrRowObj = GoodSku::where("goods_id", $goods_id)->first();
$attrcon = $attrRowObj ? json_decode($attrRowObj->content, true) : [];
$jd_price = isset($attrcon['jd_price']) ? (float)$attrcon['jd_price'] : 0;
$market_price = isset($attrcon['market_price']) ? (float)$attrcon['market_price'] : 0;
$tags = $goodObj->tags ? json_decode($goodObj->tags, true) : []; $tags = $goodObj->tags ? json_decode($goodObj->tags, true) : [];
$data['list'][] = [ $data['list'][] = [
'goods_id' => $goods_id, 'goods_id' => $goods_id,
'goods_name' => $goodObj->goods_name ?? '', 'goods_name' => $goodObj->goods_name ?? '',
'attr' => $attrRowObj ? $attrRowObj->attr_val : '', 'attr' => $attrRowObj ? $attrRowObj->attr_val : '',
'tags' => $tags, 'tags' => $tags,
'goods_price' => $is_jd ? sprintf("%.2f", $jd_price) : sprintf("%.2f", $market_price), 'goods_price' => $merchant_id ? sprintf("%.2f", $attrRowObj->cg_price) : sprintf("%.2f", $attrRowObj->market_price),
'cover_img' => ($goodObj->cover_img ? env('IMAGE_URL') . $goodObj->cover_img : ''), 'cover_img' => ($goodObj->cover_img ? env('IMAGE_URL') . $goodObj->cover_img : ''),
'addtime' => date('Y-m-d H:i:s', strtotime($datum->created_at)) 'addtime' => date('Y-m-d H:i:s', strtotime($datum->created_at))
]; ];
......
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