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

bug

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