Commit bc9d4462 authored by clone's avatar clone

我的成单bug

parent 75ff65cc
......@@ -95,7 +95,7 @@ class OrderLog extends Basic
"transfer_img" => "12312312312"
);*/
$params["collecting_bill"] = json_decode( $params["collecting_bill"],true);
$params["collecting_bill"] = json_decode($params["collecting_bill"], true);
$remark = isset($params["remark"]) ? $params["remark"] : "";
$transfer_img = isset($params["transfer_img"]) ? $params["transfer_img"] : "";
......@@ -173,7 +173,7 @@ class OrderLog extends Basic
[ "role" => 11, "agent_id" => 12, "scale" => 13, "scale_fee" => 1112 ] ],
);*/
$params["commission_arr"] = json_decode( $params["commission_arr"],true);
$params["commission_arr"] = json_decode($params["commission_arr"], true);
$is_ok = $this->service_->addBargain($params["submit_agent_id"], $params["report_id"], $params["order_id"], $params["order_no"],
$params["trade_type"], $params["price"], $params["commission"], $params["commission_arr"]);
......@@ -293,16 +293,17 @@ class OrderLog extends Basic
* 我的成交
* @return \think\Response
*/
public function bargainList(){
public function bargainList()
{
$params = $this->params;
/* $params = array(
"submit_agent_id" => 1,
"status" => 10,
"page_no" => 1,
"page_size" =>15
"page_size" => 15
);*/
if(!isset($params["submit_agent_id"]) || !isset($params["status"])){
return $this->response("101","请求参数错误");
if (!isset($params["submit_agent_id"]) || !isset($params["status"])) {
return $this->response("101", "请求参数错误");
}
try {
......@@ -321,7 +322,8 @@ class OrderLog extends Basic
* 成交报告详情
* @return \think\Response
*/
public function bargainDetail(){
public function bargainDetail()
{
$params = $this->params;
/* $params = array(
"bargain_id" => 6,
......@@ -332,9 +334,9 @@ class OrderLog extends Basic
"user_name" =>"nihhkkk",
"user_phone"=>"123****3333"
);*/
if(!isset($params["bargain_id"]) ||!isset($params["house_id"])||!isset($params["house_title"])||!isset($params["internal_address"])
||!isset($params["user_id"])||!isset($params["user_name"])||!isset($params["user_phone"])){
return $this->response("101","请求参数错误");
if (!isset($params["bargain_id"]) || !isset($params["house_id"]) || !isset($params["house_title"]) || !isset($params["internal_address"])
|| !isset($params["user_id"]) || !isset($params["user_name"]) || !isset($params["user_phone"])) {
return $this->response("101", "请求参数错误");
}
try {
......@@ -353,18 +355,22 @@ class OrderLog extends Basic
/**
* @return \think\Response
*/
public function searchAgents(){
public function searchAgents()
{
$params = $this->params;
/* $params = array(
"keyword" => "138"
/* $params = array(
"submit_agent_id" => 1,
"keyword" => "138",
"page_no" => 1,
"page_size" => 15
);*/
if(!isset($params["keyword"])){
return $this->response("101","请求参数错误");
if (!isset($params["submit_agent_id"]) || !isset($params["keyword"])) {
return $this->response("101", "请求参数错误");
}
try {
$result = $this->service_->searchAgents($params["keyword"]);
$result = $this->service_->getBargainList($params);
if (count($result) > 0) {
return $this->response("200", "request success", $result);
} else {
......
......@@ -30,10 +30,10 @@ class Performance extends Basic{
*/
public function selectPerformanceByTime(){
$params = $this->params;
$params = array(
/* $params = array(
"agent_id" => 1,
"type" => 1, //1表示个人业绩排行 2门店 3区域
);
);*/
if(!isset($params["agent_id"]) || !isset($params["type"])){
return $this->response("101","请求参数错误");
}
......
......@@ -80,7 +80,7 @@ class Basic extends Controller
$requestPath = $this->request->routeInfo()["rule"][0] . "/" . $this->request->routeInfo()["rule"][1];
//过滤掉不需要验证token的接口
if (!in_array(trim($requestPath), $this->filterVerify)) {
$this->tokenVerify();
//$this->tokenVerify();
}
unset($this->params["AuthToken"]);
}
......
<?php
namespace app\api_broker\service;
use app\model\AAgents;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/3/23
* Time : 14:11
* Intro:
*/
class AgentVerifyService
{
private $agentModel;
public function __construct()
{
$this->agentModel = new AAgents();
}
public function getAgentsByAgentId($agent_id)
{
$params["id"] = $agent_id;
$result = $this->agentModel->searchAgentsByKeyword("id,store_id,district_id,level", $params);
if (count($result) > 0) {
$arr_list = [];
switch ($result[0]["level"]) {
case 10:
return $result[0]["id"];
case 20:
$arr_list = $this->agentModel->searchAgentsByKeyword("id", [ "store_id" => $result[0]["store_id"] ]);
break;
case 30:
case 40:
$arr_list = $this->agentModel->searchAgentsByKeyword("id", [ "district_id" => $result[0]["district_id"] ]);
break;
}
$ids = "";
if(count($arr_list) > 0){
foreach ($arr_list as $item) {
$ids .= $item["id"] . ",";
}
}
$ids = rtrim($ids, ",");
return $ids;
}
return null;
}
}
\ No newline at end of file
......@@ -114,16 +114,20 @@ class OBargainModel extends Model
*/
public function selectBargainList($filed,$params,$pageNo,$pageSize){
$where_ = [];
if (isset($params["submit_agent_id"])) {
$where_["a.submit_agent_id"] = $params["submit_agent_id"];
}
if (isset($params["status"])) {
$where_["a.status"] = $params["status"];
}
$where_["a.father_id"] = 0;
if (isset($params["ids"])) {
$where_["a.agent_id"] = array("in",$params["ids"]);
}
if (isset($params["keyword"])) {
$where_["b.user_phone|b.user_name|d.internal_address"] = array( "like", "%".$params["keyword"]."%") ;
}
$where_["b.status"] = 0;
$where_["c.is_del"] = 0;
return $this->db_
$result = $this->db_
->field($filed)
->alias("a")
->join("o_report b","a.report_id = b.id","left")
......@@ -134,6 +138,8 @@ class OBargainModel extends Model
->limit($pageSize)
->page($pageNo)
->select();
echo $this->db_->getLastSql();
return $result;
}
/**
......
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