Commit a6f86a07 authored by zhuwei's avatar zhuwei

1

parent b2fd82ed
...@@ -66,16 +66,26 @@ class CostParameter extends Basic ...@@ -66,16 +66,26 @@ class CostParameter extends Basic
return $this->response("200", "success", []); return $this->response("200", "success", []);
foreach ($list as $k => $v) { foreach ($list as $k => $v) {
$transfer_charge = $this->getTransferCharge(730); $f_params['c.store_id'] = $v['id'];
$list[$k]['transfer_charge'] = $transfer_charge;//手续费 $f_params['c.setting_date'] = $params['setting_date'];
$store_data_res = $this->m_store->getStoreCostParameter($field,$f_params);
$social_security_fee = $this->getLastSocialSecurityFee(730); if(!$store_data_res){
$list[$k]['social_security_fee'] = $social_security_fee;//当月社保报销 $transfer_charge = $this->getTransferCharge(730);
$list[$k]['transfer_charge'] = $transfer_charge;//手续费
$list[$k]['attendance_num'] = 0;//当月考勤 $social_security_fee = $this->getLastSocialSecurityFee(730);
$list[$k]['official_receipts'] = 0;//当月合计总实收 $list[$k]['social_security_fee'] = $social_security_fee;//当月社保报销
$list[$k]['last_official_receipts'] = 0;//当月守护者实收 $list[$k]['attendance_num'] = 0;//当月考勤
$list[$k]['deduct'] = 0;//盈利不足2万扣除 $list[$k]['official_receipts'] = 0;//当月合计总实收
$list[$k]['last_official_receipts'] = 0;//当月守护者实收
$list[$k]['deduct'] = 0;//盈利不足2万扣除
}else{
$list[$k]['transfer_charge'] = $store_data_res['transfer_charge'];//手续费
$list[$k]['social_security_fee'] = $store_data_res['social_security_fee'];//当月社保报销
$list[$k]['attendance_num'] = $store_data_res['attendance_num'];//当月考勤
$list[$k]['official_receipts'] = $store_data_res['official_receipts'];//当月合计总实收
$list[$k]['last_official_receipts'] = $store_data_res['last_official_receipts'];//当月守护者实收
$list[$k]['deduct'] = $store_data_res['deduct'];//盈利不足2万扣除
}
} }
$count = $this->m_store->getStoreCostParameterListTotal($field, $conditions); $count = $this->m_store->getStoreCostParameterListTotal($field, $conditions);
...@@ -268,9 +278,9 @@ class CostParameter extends Basic ...@@ -268,9 +278,9 @@ class CostParameter extends Basic
{ {
$params = $this->params; $params = $this->params;
$params = array( // $params = array(
"setting_date" => '2019-07-01', // "setting_date" => '2019-07-01',
); // );
$checkResult = $this->validate($params, "CostParameterValidate.getCompanyCostParameterList"); $checkResult = $this->validate($params, "CostParameterValidate.getCompanyCostParameterList");
if (true !== $checkResult) { if (true !== $checkResult) {
...@@ -282,7 +292,7 @@ class CostParameter extends Basic ...@@ -282,7 +292,7 @@ class CostParameter extends Basic
$f_params['type'] = $v; $f_params['type'] = $v;
$f_params['setting_date'] = $params['setting_date']; $f_params['setting_date'] = $params['setting_date'];
$f_field = 'type,fixed_fee,apply_for_fee,discounts'; $f_field = 'type,fixed_fee,apply_for_fee,discounts';
$list_ = $this->m_company_data->selectCompanyData($f_field, $f_params); $list_ = $this->m_company_data->findByOne($f_field, $f_params);
if(!$company_data) if(!$company_data)
$list_['type'] = $v;//费用类型 0上海总部成本 1杭州总部成本 2深圳总部成本 3广州总部成本 4北京总部成本 5同联发展基金 6总经理基薪 $list_['type'] = $v;//费用类型 0上海总部成本 1杭州总部成本 2深圳总部成本 3广州总部成本 4北京总部成本 5同联发展基金 6总经理基薪
$list_['fixed_fee'] = 0;//本月固定成本 $list_['fixed_fee'] = 0;//本月固定成本
......
...@@ -405,6 +405,20 @@ class AStore extends BaseModel ...@@ -405,6 +405,20 @@ class AStore extends BaseModel
return $result; return $result;
} }
public function getStoreCostParameter($field,$params)
{
$params["a.status"] = 0;
$result = Db::table($this->table)
->field($field)
->alias('a')
->join('f_office b', 'a.office_id = b.id', 'left')
->join('f_store_data c', 'a.id = c.store_id', 'left')
->join('a_agents d', 'a.id = d.store_id and (level = 20 or level = 40) ', 'left')
->where($params)
->find();
return $result;
}
/** /**
* @param $field * @param $field
* @param $params * @param $params
......
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