Commit e94beade authored by zhuwei's avatar zhuwei

1

parent 83b6b5f5
...@@ -157,7 +157,7 @@ class OfficeOMarchInModel extends Model ...@@ -157,7 +157,7 @@ class OfficeOMarchInModel extends Model
$return = Db::table($this->table) $return = Db::table($this->table)
->field($field) ->field($field)
->alias("a") ->alias("a")
->join("o_order b", "a.order_id = b.id", "left") ->join("office_o_order b", "a.order_id = b.id", "left")
->where($where_) ->where($where_)
->select(); ->select();
//echo $this->getLastSql(); //echo $this->getLastSql();
...@@ -186,7 +186,7 @@ class OfficeOMarchInModel extends Model ...@@ -186,7 +186,7 @@ class OfficeOMarchInModel extends Model
$return = Db::table($this->table) $return = Db::table($this->table)
->field("count(1) as num,max(a.create_time) as create_time") ->field("count(1) as num,max(a.create_time) as create_time")
->alias("a") ->alias("a")
->join("o_order b", "a.order_id = b.id", "left") ->join("office_o_order b", "a.order_id = b.id", "left")
->where($where_) ->where($where_)
->select(); ->select();
return $return; return $return;
...@@ -213,7 +213,7 @@ class OfficeOMarchInModel extends Model ...@@ -213,7 +213,7 @@ class OfficeOMarchInModel extends Model
$return=Db::table($this->table) $return=Db::table($this->table)
->field($field) ->field($field)
->alias("a") ->alias("a")
->join("o_order b", "a.order_id = b.id", "left") ->join("office_o_order b", "a.order_id = b.id", "left")
->join("a_agents c", "a.reception_id = c.id", "left") ->join("a_agents c", "a.reception_id = c.id", "left")
->where($where_) ->where($where_)
->order("a.create_time desc") ->order("a.create_time desc")
...@@ -246,8 +246,8 @@ class OfficeOMarchInModel extends Model ...@@ -246,8 +246,8 @@ class OfficeOMarchInModel extends Model
return Db::table($this->table) return Db::table($this->table)
->field($field) ->field($field)
->alias("a") ->alias("a")
->join("o_order b", "a.order_id = b.id", "left") ->join("office_o_order b", "a.order_id = b.id", "left")
->join("o_report c", "b.f_id = c.id", "left") ->join("office_o_report c", "b.f_id = c.id", "left")
->where($where_) ->where($where_)
->limit($page_size) ->limit($page_size)
->page($page_no) ->page($page_no)
...@@ -269,8 +269,8 @@ class OfficeOMarchInModel extends Model ...@@ -269,8 +269,8 @@ class OfficeOMarchInModel extends Model
return Db::table($this->table) return Db::table($this->table)
->field($field) ->field($field)
->alias("a") ->alias("a")
->join("o_order b", "a.order_id = b.id", "left") ->join("office_o_order b", "a.order_id = b.id", "left")
->join("o_report c", "b.f_id = c.id", "left") ->join("office_o_report c", "b.f_id = c.id", "left")
->join('a_store e', 'c.report_store_id = e.id', 'left') ->join('a_store e', 'c.report_store_id = e.id', 'left')
->where($where_) ->where($where_)
->limit($page_size) ->limit($page_size)
...@@ -293,8 +293,8 @@ class OfficeOMarchInModel extends Model ...@@ -293,8 +293,8 @@ class OfficeOMarchInModel extends Model
return Db::table($this->table) return Db::table($this->table)
->field($field) ->field($field)
->alias("a") ->alias("a")
->join("o_order b", "a.order_id = b.id", "left") ->join("office_o_order b", "a.order_id = b.id", "left")
->join("o_report c", "b.f_id = c.id", "left") ->join("office_o_report c", "b.f_id = c.id", "left")
->join('a_store e', 'c.report_store_id = e.id', 'left') ->join('a_store e', 'c.report_store_id = e.id', 'left')
->where($where_) ->where($where_)
->count(); ->count();
...@@ -315,8 +315,8 @@ class OfficeOMarchInModel extends Model ...@@ -315,8 +315,8 @@ class OfficeOMarchInModel extends Model
return Db::table($this->table) return Db::table($this->table)
->field($field) ->field($field)
->alias("a") ->alias("a")
->join("o_order b", "a.order_id = b.id", "left") ->join("office_o_order b", "a.order_id = b.id", "left")
->join("o_report c", "b.f_id = c.id", "left") ->join("office_o_report c", "b.f_id = c.id", "left")
// ->join('g_houses d', 'b.house_id = d.id', 'left') // ->join('g_houses d', 'b.house_id = d.id', 'left')
->where($where_) ->where($where_)
->select(); ->select();
...@@ -334,7 +334,7 @@ class OfficeOMarchInModel extends Model ...@@ -334,7 +334,7 @@ class OfficeOMarchInModel extends Model
return Db::table($this->table) return Db::table($this->table)
->field($field) ->field($field)
->alias("a") ->alias("a")
->join("o_order b", "a.order_id = b.id", "left") ->join("office_o_order b", "a.order_id = b.id", "left")
->join("a_agents c", "a.reception_id = c.id", "left") ->join("a_agents c", "a.reception_id = c.id", "left")
->join("a_store d", "c.store_id = d.id", "left") ->join("a_store d", "c.store_id = d.id", "left")
->where($where_) ->where($where_)
...@@ -348,8 +348,8 @@ class OfficeOMarchInModel extends Model ...@@ -348,8 +348,8 @@ class OfficeOMarchInModel extends Model
->field($field) ->field($field)
->alias('a') ->alias('a')
->join('a_agents b', 'a.reception_id = b.id', 'left') ->join('a_agents b', 'a.reception_id = b.id', 'left')
->join('office_o_order c', 'a.order_id = c.id', 'left') ->join('office_office_o_order c', 'a.order_id = c.id', 'left')
->join('office_o_report d', 'a.report_id = d.id', 'left') ->join('office_office_o_report d', 'a.report_id = d.id', 'left')
->join('a_store e', 'd.report_store_id = e.id', 'left') ->join('a_store e', 'd.report_store_id = e.id', 'left')
->join('office_g_room f', 'c.house_id = f.id', 'left') ->join('office_g_room f', 'c.house_id = f.id', 'left')
->join('office_g_building g', 'f.building_id = g.id', 'left') ->join('office_g_building g', 'f.building_id = g.id', 'left')
...@@ -372,8 +372,8 @@ class OfficeOMarchInModel extends Model ...@@ -372,8 +372,8 @@ class OfficeOMarchInModel extends Model
return $this->field($field) return $this->field($field)
->alias('a') ->alias('a')
->join('a_agents b', 'a.reception_id = b.id', 'left') ->join('a_agents b', 'a.reception_id = b.id', 'left')
->join('office_o_order c', 'a.order_id = c.id', 'left') ->join('office_office_o_order c', 'a.order_id = c.id', 'left')
->join('office_o_report d', 'a.report_id = d.id', 'left') ->join('office_office_o_report d', 'a.report_id = d.id', 'left')
->join('a_store e', 'd.report_store_id = e.id', 'left') ->join('a_store e', 'd.report_store_id = e.id', 'left')
->join('office_g_room f', 'c.house_id = f.id', 'left') ->join('office_g_room f', 'c.house_id = f.id', 'left')
->join('office_g_building g', 'f.building_id = g.id', 'left') ->join('office_g_building g', 'f.building_id = g.id', 'left')
...@@ -392,7 +392,7 @@ class OfficeOMarchInModel extends Model ...@@ -392,7 +392,7 @@ class OfficeOMarchInModel extends Model
//dump($params); //dump($params);
$return = Db::table($this->table) $return = Db::table($this->table)
->alias("a") ->alias("a")
->join("o_order b", "a.order_id = b.id", "left") ->join("office_o_order b", "a.order_id = b.id", "left")
->join('g_houses c', 'b.house_id = c.id', 'LEFT') ->join('g_houses c', 'b.house_id = c.id', 'LEFT')
->where($params) ->where($params)
->count(); ->count();
...@@ -411,7 +411,7 @@ class OfficeOMarchInModel extends Model ...@@ -411,7 +411,7 @@ class OfficeOMarchInModel extends Model
public function getMaxMarchInAgent($field, $where) { public function getMaxMarchInAgent($field, $where) {
return $this->alias('a') return $this->alias('a')
->field($field) ->field($field)
->join('office_o_order b', 'a.order_id = b.id', 'left') ->join('office_office_o_order b', 'a.order_id = b.id', 'left')
->where($where) ->where($where)
->group('a.reception_id ') ->group('a.reception_id ')
->find(); ->find();
......
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