|
|
@@ -58,6 +58,9 @@ class UserController
|
|
|
$info['commissionCount'] = bcsub($info['brokerage_price'], $info['broken_commission'], 2);
|
|
|
if ($info['commissionCount'] < 0)
|
|
|
$info['commissionCount'] = 0;
|
|
|
+// $buy = AuctionOrder::where([['status', '=', 3], ['uid', '=', $request->uid()]])->sum('price');// 购买商品总额
|
|
|
+// $sell = AuctionOrder::where([['status', '=', 3], ['collection_id', '=', $request->uid()]])->sum('price');// 出售商品总额
|
|
|
+ $sell = UserBill::where('uid', $info['uid'])->where('type', 'gs_integral')->sum('number');
|
|
|
$level = UserLevel::where('id', $info['level'])->find();
|
|
|
$info['level_name'] = $level['name']? $level['name'] : '会员';
|
|
|
$info['profit'] = $this->profit($info['uid']);
|
|
|
@@ -72,13 +75,12 @@ class UserController
|
|
|
$order = AuctionOrder::alias('a')
|
|
|
->field('a.*,b.rise,b.deduct')
|
|
|
->leftJoin('auction_product b', 'a.product_id = b.id')
|
|
|
- ->where('status', 3)
|
|
|
->where('a.uid', $uid)
|
|
|
->select();
|
|
|
$profit = 0;
|
|
|
if (count($order) > 0){
|
|
|
foreach ($order as $item) {
|
|
|
- $profit += ($item['price'] * $item['rise']/100) - ($item['price'] * $item['deduct']/100);
|
|
|
+ $profit += ($item['price'] - $item['gs_price']) * ($item['deduct']/$item['rise']);
|
|
|
}
|
|
|
}
|
|
|
return $profit;
|
|
|
@@ -113,21 +115,21 @@ class UserController
|
|
|
return app('json')->fail('上传失败');
|
|
|
|
|
|
}
|
|
|
- /**
|
|
|
- * 实名信息查询
|
|
|
- * @param Request $request
|
|
|
- * @return mixed
|
|
|
- */
|
|
|
- public function rate(Request $request){
|
|
|
- $model=new User;
|
|
|
- $res=$model->where('uid',$request->uid())->find();
|
|
|
- $data=[
|
|
|
- 'is_auth'=>$res['is_auth'],
|
|
|
- 'off'=>$res['off']
|
|
|
-
|
|
|
- ];
|
|
|
- return app('json')->success($data);
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 实名信息查询
|
|
|
+ * @param Request $request
|
|
|
+ * @return mixed
|
|
|
+ */
|
|
|
+ public function rate(Request $request){
|
|
|
+ $model=new User;
|
|
|
+ $res=$model->where('uid',$request->uid())->find();
|
|
|
+ $data=[
|
|
|
+ 'is_auth'=>$res['is_auth'],
|
|
|
+ 'off'=>$res['off']
|
|
|
+
|
|
|
+ ];
|
|
|
+ return app('json')->success($data);
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 用户资金统计
|