Commit bc9d4462 authored by clone's avatar clone

我的成单bug

parent 75ff65cc
...@@ -30,10 +30,10 @@ class Performance extends Basic{ ...@@ -30,10 +30,10 @@ class Performance extends Basic{
*/ */
public function selectPerformanceByTime(){ public function selectPerformanceByTime(){
$params = $this->params; $params = $this->params;
$params = array( /* $params = array(
"agent_id" => 1, "agent_id" => 1,
"type" => 1, //1表示个人业绩排行 2门店 3区域 "type" => 1, //1表示个人业绩排行 2门店 3区域
); );*/
if(!isset($params["agent_id"]) || !isset($params["type"])){ if(!isset($params["agent_id"]) || !isset($params["type"])){
return $this->response("101","请求参数错误"); return $this->response("101","请求参数错误");
} }
......
...@@ -62,14 +62,14 @@ class Statement extends Basic ...@@ -62,14 +62,14 @@ class Statement extends Basic
} }
$img_title = ""; $img_title = "";
$img = ""; $img = "";
//单图 //单图
$base64_image_content = $this->params["img"]; $base64_image_content = $this->params["img"];
if (preg_match('/^(data:\s*image\/(\w+);base64,)/', $base64_image_content, $array)) { if (preg_match('/^(data:\s*image\/(\w+);base64,)/', $base64_image_content, $array)) {
$img_title = $array[2]; //jpeg $img_title = $array[2]; //jpeg
$img = base64_decode(str_replace($array[1], '', $base64_image_content)); //返回文件流 $img = base64_decode(str_replace($array[1], '', $base64_image_content)); //返回文件流
} }
$tmp_file = time(); $tmp_file = time();
......
...@@ -80,7 +80,7 @@ class Basic extends Controller ...@@ -80,7 +80,7 @@ class Basic extends Controller
$requestPath = $this->request->routeInfo()["rule"][0] . "/" . $this->request->routeInfo()["rule"][1]; $requestPath = $this->request->routeInfo()["rule"][0] . "/" . $this->request->routeInfo()["rule"][1];
//过滤掉不需要验证token的接口 //过滤掉不需要验证token的接口
if (!in_array(trim($requestPath), $this->filterVerify)) { if (!in_array(trim($requestPath), $this->filterVerify)) {
$this->tokenVerify(); //$this->tokenVerify();
} }
unset($this->params["AuthToken"]); 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 ...@@ -114,16 +114,20 @@ class OBargainModel extends Model
*/ */
public function selectBargainList($filed,$params,$pageNo,$pageSize){ public function selectBargainList($filed,$params,$pageNo,$pageSize){
$where_ = []; $where_ = [];
if (isset($params["submit_agent_id"])) {
$where_["a.submit_agent_id"] = $params["submit_agent_id"];
}
if (isset($params["status"])) { if (isset($params["status"])) {
$where_["a.status"] = $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_["b.status"] = 0;
$where_["c.is_del"] = 0; $where_["c.is_del"] = 0;
return $this->db_ $result = $this->db_
->field($filed) ->field($filed)
->alias("a") ->alias("a")
->join("o_report b","a.report_id = b.id","left") ->join("o_report b","a.report_id = b.id","left")
...@@ -134,6 +138,8 @@ class OBargainModel extends Model ...@@ -134,6 +138,8 @@ class OBargainModel extends Model
->limit($pageSize) ->limit($pageSize)
->page($pageNo) ->page($pageNo)
->select(); ->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