Commit 9cc293c1 authored by zhuwei's avatar zhuwei

selectPerformanceByTime

parent 33a88da5
......@@ -11,6 +11,7 @@ use app\extra\RedisExt;
use app\model\AAgents;
use app\model\OBargainModel;
use app\model\OMarchInModel;
use app\model\OrderModel;
use app\model\ORefundModel;
use think\Exception;
use Think\Log;
......@@ -738,4 +739,48 @@ class OrderLog extends Basic
return $this->response("200", "request null");
}
}
/**
* 商铺详情-带看记录
* User: 朱伟
* Date: 2018-07-24
* Time: 16:01:27
*/
public function getLook()
{
$params = $this->params;
//$params['house_id']=260;//
if (!isset($params['house_id'])) {
return $this->response("300", "参数不全");
}
//todo 该商铺7日带看次数
$model = new OrderModel();
$params["house_id"] = $params['house_id'];
$start_time = date("Y-m-d", strtotime("-7 day"));
$end_time = date("Y-m-d", time());
$params['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
$res_7 = $model->getCountByHouseId($params);
//dump($params);
$return['7']=$res_7;
//todo 该商铺30日带看次数
$start_time = date("Y-m-d", strtotime("-30 day"));
$end_time = date("Y-m-d", time());
$params['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
$res_30 = $model->getCountByHouseId($params);
//dump($params);
$return['30']=$res_30;
return $this->response("200", "success!", $return);
}
}
\ No newline at end of file
......@@ -52,6 +52,7 @@ class Performance extends Basic
$start_day = !empty($params["start_day"]) ? $params["start_day"] : date("Y-m-01", time());
$list = $this->service_->totalAgent($params["agent_id"], $params["type"], $end_day, $start_day);
//dump($list);
if (count($list) > 0) {
......
......@@ -242,4 +242,19 @@ class OrderModel extends Model
}
/**
* 获取7日30日次数
*/
public function getCountByHouseId($params)
{
$result = Db::table($this->table)
->field("id")
->where($params)
->count();
//echo Db::table($this->table)->getLastSql();
//dump($this->getLastSql());
return $result;
}
}
\ No newline at end of file
......@@ -397,6 +397,7 @@ Route::group('broker', [
'bargain' => [ 'api_broker/OrderLog/bargain', [ 'method' => 'get|post' ] ],
'statusBargain' => [ 'api_broker/OrderLog/statusBargain', [ 'method' => 'get|post' ] ],
'getIsAccountStatement' => [ 'api_broker/OrderLog/getIsAccountStatement', [ 'method' => 'get|post' ] ],
'getLook' => [ 'api_broker/OrderLog/getLook', [ 'method' => 'get|post' ] ],
'login' => [ 'api_broker/Broker/login', [ 'method' => 'post' ] ], //经纪人登陆 废弃
'loginV2' => [ 'api_broker/Broker/loginV2', [ 'method' => 'post' ] ], //经纪人登陆
......
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