Commit 4736bd68 authored by clone's avatar clone

微信授权

parent 0e3a737c
...@@ -163,8 +163,9 @@ class PerformanceService ...@@ -163,8 +163,9 @@ class PerformanceService
$params['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) ); $params['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
$result = $this->nowTimeSum($params); $result = $this->nowTimeSum($params);
} else { } else {
$field = "agent_id,sum(look_at_num) as look_at_num,sum(march_in_num) as march_in_num , sum(paylog) as paylog , $field = "agent_id,sum(add_house_num) as add_house_num,sum(add_user_num) as add_user_num,
sum(bargain_sum) as bargain_sum"; sum(performance) as performance,sum(official_receipts) as official_receipts,sum(look_at_num) as look_at_num,
sum(march_in_num) as march_in_num , sum(paylog) as paylog , sum(bargain_sum) as bargain_sum";
$where_["agent_id"] = $agent_id; $where_["agent_id"] = $agent_id;
$where_['total_time'] = array( 'between', array( $start_time, $end_time ) ); $where_['total_time'] = array( 'between', array( $start_time, $end_time ) );
...@@ -292,7 +293,24 @@ class PerformanceService ...@@ -292,7 +293,24 @@ class PerformanceService
*/ */
private function nowTimeSum($params) private function nowTimeSum($params)
{ {
$result = []; $result = [];
//房源
$addHouseNum = $this->houseModel->getAddHouseNum($totalParams);
$result["add_house_num"] = isset($addHouseNum[0]["num"]) ? $addHouseNum[0]["num"] : 0;
//客源
$addUserNum = $this->userModel->getAddUserNum($totalParams);
$result["add_user_num"] = isset($addUserNum[0]["num"]) ? $addUserNum[0]["num"] : 0;
//业绩
$performanceSum = $this->bargainModel->getAddBargainNum($totalParams, 1);//1表示业绩 2表示实收
$result["performance"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
//实收
$receivedSum = $this->bargainModel->getAddBargainNum($totalParams, 2);//1表示业绩 2表示实收
$result["official_receipts"] = isset($receivedSum[0]["num"]) ? $receivedSum[0]["num"] : 0;
$reportNum = $this->reportModel->getAddReportNum($params); $reportNum = $this->reportModel->getAddReportNum($params);
$result["look_at_num"] = isset($reportNum[0]["num"]) ? $reportNum[0]["num"] : 0; $result["look_at_num"] = isset($reportNum[0]["num"]) ? $reportNum[0]["num"] : 0;
......
...@@ -2,14 +2,47 @@ ...@@ -2,14 +2,47 @@
namespace app\app_broker\controller; namespace app\app_broker\controller;
use app\api\untils\WxCallbackUntils;
use app\model\AppVersion; use app\model\AppVersion;
use app\model\HouseImgs; use app\model\HouseImgs;
use app\model\HouseInfos; use app\model\HouseInfos;
use think\Controller; use think\Controller;
use think\Log;
use think\Response; use think\Response;
class Index class Index
{ {
private $url = CURRENT_URL . "/index/getWxInfo";
private $_wxApi;
public function __construct()
{
$this->_wxApi = new WxCallbackUntils();
}
public function getWxInfo()
{
$code = empty($_GET['code']) ? null : $_GET['code'];
$userInfo = session("userInfo");
if (!$code) {
$this->_wxApi->getWxCode($this->url);
} else {
$this->_wxApi->getUserInfoByAccessToken($code);
Log::record("session wx -----------------" . json_encode($userInfo), "info");
if (!$userInfo) {
$this->_wxApi->getWxCode($this->url);
} else {
dump($userInfo);
return view("index/index");
}
}
}
public function achieve_fork() public function achieve_fork()
{ {
return view('index/achieve_fork'); return view('index/achieve_fork');
......
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