Commit 77966bfa authored by hujun's avatar hujun

考勤总计

parent a284d203
......@@ -321,10 +321,10 @@ class Cost extends Basic
}
if ($data['office_id']) {
$ext_where['a.type'] = 1;
$ext_where['b.type'] = 1;
$ext_where['c.office_id'] = $data['office_id'];
$ext_where['b.setting_date'] = $data['count_time'];
$data['office_attendance_num'] = $m_store_cost_ext->getFeeOfficeCostSum('a.office_attendance_num', $ext_where);
$ext_where['a.setting_date'] = $data['count_time'];
$data['office_attendance_num'] = $m_store_cost->getFeeOfficeCostSum('b.office_attendance_num', $ext_where);
}
break;
case 2 :
......
......@@ -91,4 +91,18 @@ class FStoreCost extends BaseModel
->where($where)
->select();
}
/**
* @param $field
* @param $where
* @return false|\PDOStatement|string|\think\Collection
*/
public function getFeeOfficeCostSum($field, $where)
{
return $this->alias('a')
->join('f_store_cost_ext b', 'a.id = b.cost_id', 'left')
->join('f_apply_for_fee c', 'b.apply_for_id = b.id', 'left')
->where($where)
->sum($field);
}
}
......@@ -111,20 +111,6 @@ class FStoreCostExt extends BaseModel
->select();
}
/**
* @param $field
* @param $where
* @return false|\PDOStatement|string|\think\Collection
*/
public function getFeeOfficeCostSum($field, $where)
{
return $this->alias('a')
->join('f_store_cost b', 'a.cost_id = b.id', 'left')
->join('f_apply_for_fee c', 'a.apply_for_id = b.id', 'left')
->where($where)
->sum($field);
}
/**
* 我的门店成本
* @param $field
......
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