Commit ed56740a authored by zhuwei's avatar zhuwei

1

parent 03b0dac1
......@@ -287,8 +287,8 @@ class OfficeOBargainModel extends Model
$result = $this->db_
->field($filed)
->alias("a")
->join("office_office_o_report b", "a.report_id = b.id", "left")
->join("office_office_o_order c", "a.order_id = c.id", "left")
->join("office_o_report b", "a.report_id = b.id", "left")
->join("office_o_order c", "a.order_id = c.id", "left")
->join("office_g_room d", "c.house_id = d.id", "left")
->join("office_g_building e", "e.id = d.building_id", "left")
->where($where_)
......@@ -320,10 +320,10 @@ class OfficeOBargainModel extends Model
$result = $this->db_
->field($filed)
->alias("a")
->join("office_office_o_order b", "a.order_id = b.id", "left")
->join("office_o_order b", "a.order_id = b.id", "left")
->join("office_g_room c", "b.house_id = c.id", "left")
->join("office_g_building e", "e.id = c.building_id", "left")
->join("office_office_o_report d", "a.report_id = d.id", "left")
->join("office_o_report d", "a.report_id = d.id", "left")
->where($where_)
->whereOr($whereOr_)
->order("a.id asc")
......@@ -469,8 +469,8 @@ class OfficeOBargainModel extends Model
public function getBargainInfo($field, $params)
{
return $this->field($field)->alias('a')
->join('office_office_o_report b', 'a.report_id = b.id', 'left')
->join('office_office_o_order c', 'a.order_id = c.id', 'left')
->join('office_o_report b', 'a.report_id = b.id', 'left')
->join('office_o_order c', 'a.order_id = c.id', 'left')
->join('office_g_room d', 'c.house_id = d.id', 'left')
->join('office_g_building f', 'd.building_id = f.id', 'left')
->join('o_partial_commission e', 'e.bargain_id = a.id', 'left')
......@@ -1626,8 +1626,8 @@ class OfficeOBargainModel extends Model
public function getBargainList($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field = '', $params = '')
{
return $this->db_->field($field)->alias('a')
->join('office_office_o_report b', 'a.report_id = b.id', 'left')
->join('office_office_o_order c', 'a.order_id = c.id', 'left')
->join('office_o_report b', 'a.report_id = b.id', 'left')
->join('office_o_order c', 'a.order_id = c.id', 'left')
->join('office_g_room d', 'c.house_id = d.id', 'left')
->join('office_o_partial_commission e', 'a.id = e.bargain_id', 'left')
->join('office_g_building f', 'd.building_id=f.id','left')
......@@ -1648,8 +1648,8 @@ class OfficeOBargainModel extends Model
public function getBargainTotal(array $params = [])
{
return $this->db_->alias('a')
->join('office_office_o_report b', 'a.report_id = b.id', 'left')
->join('office_office_o_order c', 'a.order_id = c.id', 'left')
->join('office_o_report b', 'a.report_id = b.id', 'left')
->join('office_o_order c', 'a.order_id = c.id', 'left')
->join('office_g_room d', 'c.house_id = d.id', 'left')
->join('office_o_partial_commission e', 'a.id = e.bargain_id', 'left')
->join('office_g_building f', 'd.building_id=f.id','left')
......@@ -1666,8 +1666,8 @@ class OfficeOBargainModel extends Model
public function getBargainListSum($field = '', $params = '')
{
return $this->db_->alias('a')
->join('office_office_o_report b', 'a.report_id = b.id', 'left')
->join('office_office_o_order c', 'a.order_id = c.id', 'left')
->join('office_o_report b', 'a.report_id = b.id', 'left')
->join('office_o_order c', 'a.order_id = c.id', 'left')
->join('office_g_room d', 'c.house_id = d.id', 'left')
->join('office_o_partial_commission e', 'a.id = e.bargain_id', 'left')
->join('office_g_building f', 'd.building_id=f.id','left')
......
......@@ -348,8 +348,8 @@ class OfficeOMarchInModel extends Model
->field($field)
->alias('a')
->join('a_agents b', 'a.reception_id = b.id', 'left')
->join('office_office_o_order c', 'a.order_id = c.id', 'left')
->join('office_office_o_report d', 'a.report_id = d.id', 'left')
->join('office_o_order c', 'a.order_id = c.id', 'left')
->join('office_o_report d', 'a.report_id = d.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_building g', 'f.building_id = g.id', 'left')
......@@ -372,8 +372,8 @@ class OfficeOMarchInModel extends Model
return $this->field($field)
->alias('a')
->join('a_agents b', 'a.reception_id = b.id', 'left')
->join('office_office_o_order c', 'a.order_id = c.id', 'left')
->join('office_office_o_report d', 'a.report_id = d.id', 'left')
->join('office_o_order c', 'a.order_id = c.id', 'left')
->join('office_o_report d', 'a.report_id = d.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_building g', 'f.building_id = g.id', 'left')
......@@ -411,7 +411,7 @@ class OfficeOMarchInModel extends Model
public function getMaxMarchInAgent($field, $where) {
return $this->alias('a')
->field($field)
->join('office_office_o_order b', 'a.order_id = b.id', 'left')
->join('office_o_order b', 'a.order_id = b.id', 'left')
->where($where)
->group('a.reception_id ')
->find();
......
......@@ -343,7 +343,7 @@ class OfficeOPayLogModel extends Model
$params["a.is_del"] = 0;
return $this->db_->field($field)
->alias("a")
->join("office_office_o_order b", "a.order_id = b.id", "left")
->join("office_o_order b", "a.order_id = b.id", "left")
->join('office_g_room d', 'b.house_id = d.id', 'left')
->join('a_agents e', 'a.agent_id=e.id', 'left')
->join('office_o_bargain f', 'a.bargain_id=f.id', 'left')
......@@ -367,7 +367,7 @@ class OfficeOPayLogModel extends Model
{
$params["a.is_del"] = 0;
return $this->db_->alias("a")
->join("office_office_o_order b", "a.order_id = b.id", "left")
->join("office_o_order b", "a.order_id = b.id", "left")
->join('office_g_room d', 'b.house_id = d.id', 'left')
->join('a_agents e', 'a.agent_id=e.id', 'left')
->join('office_o_bargain f', 'a.bargain_id=f.id', 'left')
......@@ -441,10 +441,10 @@ class OfficeOPayLogModel extends Model
{
return $this->db_->field($filed)
->alias("a")
->join("office_office_o_order b", "a.order_id = b.id", "left")
->join("office_o_order b", "a.order_id = b.id", "left")
// ->join("o_bargain c", "c.order_id = b.id", "left")
->join("office_o_bargain c", "c.id = a.bargain_id", "left")
->join("office_office_o_report d", "a.report_id = d.id", "left")
->join("office_o_report d", "a.report_id = d.id", "left")
->where($params)
->group("a.id")
->select();
......@@ -461,8 +461,8 @@ class OfficeOPayLogModel extends Model
{
$result = $this->db_->field($filed)
->alias("a")
->join("office_office_o_order b", "a.order_id = b.id", "left")
->join("office_office_o_report d", "a.report_id = d.id", "left")
->join("office_o_order b", "a.order_id = b.id", "left")
->join("office_o_report d", "a.report_id = d.id", "left")
->where($params)
->select();
//echo $this->getLastSql();
......@@ -483,7 +483,7 @@ class OfficeOPayLogModel extends Model
return $this->db_->field($filed)
->alias("a")
->join("office_o_paylog_adjustment b", "a.id = b.paylog_id", "right")
->join("office_office_o_order c", "a.order_id = c.id", "left")
->join("office_o_order c", "a.order_id = c.id", "left")
->where($params)
->select();
}
......@@ -544,7 +544,7 @@ class OfficeOPayLogModel extends Model
public function getOrderHouse($field, $where) {
return $this->db_->alias('a')
->field($field)
->join('office_office_o_order b', 'a.order_id=b.id', 'left')
->join('office_o_order b', 'a.order_id=b.id', 'left')
->join('office_g_room c', 'b.house_id=c.id', 'left')
->join('office_g_building d', 'c.building_id=d.id', 'left')
->where($where)
......
......@@ -155,7 +155,7 @@ class OfficeOReportModel extends Model
return $this->db
->field($filed)
->alias("a")
->join("office_office_o_order b", "a.id = b.f_id", "left")
->join("office_o_order b", "a.id = b.f_id", "left")
->join("a_agents c", "a.report_agent_id = c.id", "left")
->join("a_store d", "c.store_id = d.id", "left")
->where($where_)
......@@ -198,7 +198,7 @@ class OfficeOReportModel extends Model
case 2:
$result = $this->db->field($filed)
->alias("a")
->join("office_office_o_order b", "a.id=b.f_id", "left")
->join("office_o_order b", "a.id=b.f_id", "left")
->join("office_o_march_in c", "b.id=c.order_id", "right")
->where($where)
->order("b.id desc")
......@@ -209,7 +209,7 @@ class OfficeOReportModel extends Model
case 3:
$result = $this->db->field($filed)
->alias("a")
->join("office_office_o_order b", "a.id=b.f_id", "left")
->join("office_o_order b", "a.id=b.f_id", "left")
->join("office_o_paylog c", "b.id=c.order_id", "right")
->where($where)
->order("b.id desc")
......@@ -221,7 +221,7 @@ class OfficeOReportModel extends Model
case 4:
$result = $this->db->field($filed)
->alias("a")
->join("office_office_o_order b", "a.id=b.f_id", "left")
->join("office_o_order b", "a.id=b.f_id", "left")
->join("office_o_bargain c", "b.id=c.order_id", "right")
->where($where)
->order("b.id desc")
......@@ -233,7 +233,7 @@ class OfficeOReportModel extends Model
default:
$result = $this->db->field($filed)
->alias("a")
->join("office_office_o_order b", "a.id=b.f_id", "left")
->join("office_o_order b", "a.id=b.f_id", "left")
->where($where)
->order("b.id desc")
->page($pageNo)
......@@ -331,7 +331,7 @@ class OfficeOReportModel extends Model
$filed
FROM
`office_o_report` `a`
LEFT JOIN `office_office_o_order` `b` ON `a`.`id` = `b`.`f_id`
LEFT JOIN `office_o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `office_o_march_in` `c` ON `b`.`id` = `c`.`order_id`
WHERE
$report_agent_str
......@@ -344,7 +344,7 @@ class OfficeOReportModel extends Model
$filed
FROM
`office_o_report` `a`
LEFT JOIN `office_office_o_order` `b` ON `a`.`id` = `b`.`f_id`
LEFT JOIN `office_o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `office_o_march_in` `c` ON `b`.`id` = `c`.`order_id`
WHERE
$house_str
......@@ -364,7 +364,7 @@ class OfficeOReportModel extends Model
$filed
FROM
`office_o_report` `a`
LEFT JOIN `office_office_o_order` `b` ON `a`.`id` = `b`.`f_id`
LEFT JOIN `office_o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `office_o_paylog` `c` ON `b`.`id` = `c`.`order_id`
WHERE
$report_agent_str
......
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