Commit 29c68379 by lizhilin

更新

parent 9d7f0591
......@@ -189,9 +189,9 @@ public function getIndexGoods(Request $request)
'id' => $datum->id,
'goods_name' => $datum->goods_name,
'is_hot' => $datum->is_hot,
'dg_price' => ceil($dg_price),
'market_price' => ceil($market_price),
'goods_price' => $mer_id ? ceil($dg_price) : ceil($market_price),
'dg_price' => floor($dg_price),
'market_price' => floor($market_price),
'goods_price' => $mer_id ? floor($dg_price) : floor($market_price),
'tags' => $tags,
'cover_img' => ($datum->cover_img) ? env('IMAGE_URL') . $datum->cover_img : '',
];
......@@ -262,8 +262,9 @@ public function getDetail(Request $request)
$data = [
'id' => $goods->id,
'goods_img' => $cover,
'goods_price' => $mer_id ? ceil($dg_price) : ceil($market_price),
'market_price' => $mer_id ? ceil($market_price) : '',
'dg_price' => floor($dg_price),
'goods_price' => $mer_id ? floor($dg_price) : floor($market_price),
'market_price' => floor($market_price),
'stock' => $stock,
'goods_name' => $goods->goods_name,
'sale' => $goods->sale ?? 0,
......
......@@ -85,8 +85,12 @@ public function add(Request $request)
} else { //用户
$memObj = User::find($um_id);
}
$balance = $memObj->balance;
$freeze_balance = $memObj->balance;
Log::add('提现前', [$balance, $freeze_balance]);
$memObj->balance -= $money;
$memObj->freeze_balance += $money;
Log::add('提现人员', $memObj->toArray());
$memObj->save();
$comObj = new Income();
......
......@@ -96,6 +96,9 @@ public function login(Request $request)
$user->name = 'wx_' . uniqid();
$user->openid = $openId;
$user->phone = $data->phoneNumber;
$user->balance = 0;
$user->freeze_balance = 0;
$user->total_revenue = 0;
$user->save();
}
if ($user->openid != $openId) {
......
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