Commit 936579ba authored by clone's avatar clone Committed by hujun

bug

parent a04000bc
...@@ -692,20 +692,31 @@ class AAgents extends BaseModel ...@@ -692,20 +692,31 @@ class AAgents extends BaseModel
/** /**
* @param $field * @param $field
* @param $params * @param $params
* @param $is_store
* @return false|\PDOStatement|string|\think\Collection * @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException * @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException * @throws \think\exception\DbException
*/ */
public function getStoreOrAgentInfo($field, $params) public function getStoreOrAgentInfo($field, $params,$is_store)
{ {
$result = Db::table($this->table) if($is_store == 2){
->field($field) $result = Db::table($this->table)
->alias("a") ->field($field)
->join("a_store b", "a.store_id = b.id", "left") ->alias("a")
->join("a_agents c", "a.store_id = c.store_id", "left") ->join("a_store b", "a.store_id = b.id", "left")
->where($params) ->join("a_agents c", "a.store_id = c.store_id", "left")
->select(); ->where($params)
->select();
}else{
$result = Db::table($this->table)
->field($field)
->alias("a")
->join("a_store b", "a.store_id = b.id", "left")
->where($params)
->select();
}
// echo $this->getLastSql(); // echo $this->getLastSql();
return $result; 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