1.分销推广店铺收益

This commit is contained in:
xucong 2024-09-06 16:27:45 +08:00
parent e5a7614e91
commit e95eadf072
2 changed files with 50 additions and 0 deletions

@ -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

@ -784,6 +784,7 @@ class PayLogic extends Logic
'change_amount' => $earnings,
'left_amount' => $earnings_buy + $earnings,
'change_type' => 1,
'shop_id'=>$post['lid'],
'remark' => '本地商家支付佣金增加'
]);
}