diff --git a/app/api/controller/User.php b/app/api/controller/User.php index f77b961d..c7f8557a 100755 --- a/app/api/controller/User.php +++ b/app/api/controller/User.php @@ -306,7 +306,56 @@ class User extends Api ]; return JsonServer::success('', $data); } + // 推广店铺收益明细 + public function shopDtails(){ + $page = $this->request->get('page_no', $this->page_no); + $size = $this->request->get('page_size', $this->page_size); + $type = $this->request->get('type'); + $shop_id = $this->request->get('shop_id'); + $start_time = $this->request->get('start_time',date("Y-m-d")); + $end_time = $this->request->get('end_time',date("Y-m-d")); + $start_time = strtotime($start_time['start_time']); + $end_time = strtotime($end_time['end_time']); + $pa = $page-1; + $p = $pa*$size; + if($type == 1){ + }else{ + $all_total = Db::name("account_log") + ->where("source_type",409) + ->where("change_type",1) + ->where("shop_id",$shop_id) + ->sum("change_amount"); + $day_total = Db::name("account_log") + ->where([['create_time', 'between', [$start_time, $end_time]]]) + ->where("source_type",409) + ->where("change_type",1) + ->where("shop_id",$shop_id) + ->sum("change_amount"); + $sql = "SELECT * FROM ls_account_log WHERE source_type = 409 and + change_type = 1 and shop_id = $shop_id and create_time between + $start_time and $end_time + limit ".$p.",".$size; +// var_dump($sql); + $lists = Db::query($sql); + $count = Db::name("account_log") + ->where("source_type",409) + ->where("change_type",1) + ->where("shop_id",$shop_id) + ->where([['create_time', 'between', [$start_time, $end_time]]]) + ->count(); + $data = [ + 'list' => $lists, + 'page' => $page, + 'size' => $size, + 'all_total' => $all_total, + 'day_total' => $day_total, + 'count'=>$count, + 'more' => is_more($count, $page, $size) + ]; + return JsonServer::success('', $data); + } + } /** * @notes 用户聊天记录 * @return \think\response\Json diff --git a/app/api/logic/PayLogic.php b/app/api/logic/PayLogic.php index 9a89ce72..fe1a59a2 100755 --- a/app/api/logic/PayLogic.php +++ b/app/api/logic/PayLogic.php @@ -784,6 +784,7 @@ class PayLogic extends Logic 'change_amount' => $earnings, 'left_amount' => $earnings_buy + $earnings, 'change_type' => 1, + 'shop_id'=>$post['lid'], 'remark' => '本地商家支付佣金增加' ]); }