Commit 32a46a60 authored by zhuwei's avatar zhuwei

1

parent 99058dda
......@@ -440,15 +440,18 @@ class CostDetail extends Basic
/* $params = array(
);*/
$checkResult = $this->validate($params, "CostDetailValidate.getMyCostDetailList");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
$conditions = [];
//计入月份
if (!empty($params["setting_date"])) {
$conditions["b.setting_date"] = $params["setting_date"];
}
$conditions["b.setting_date"] = $params["setting_date"];
//门店id
if (!empty($params['store_id'])) {
$conditions["b.store_id"] = $params["store_id"];
}
$conditions["b.store_id"] = $params["store_id"];
$field = 'a.id,a.cost_id,b.setting_date,a.create_time,b.operator_name,
a.type,a.fee_item,a.purpose,c.store_id,a.assume_fee';
......@@ -463,11 +466,7 @@ class CostDetail extends Basic
$list[$k]['store_name'] = $this->getStoreName($v['store_id']);
}
$count = $this->storeCostExt->getStoreCostExtTotal($field, $conditions);
$result["list"] = $list;
$result["total"] = $count;
return $this->response("200", "success", $result);
}
......
......@@ -188,8 +188,7 @@ class CostParameter extends Basic
$f_params['store_id'] = $params['store_id'];
$f_params['setting_date'] = $params['setting_date'];
$store_data_res = $this->m_store_data->findByOne('id',$params);
$store_data_res = $this->m_store_data->findByOne('id',$f_params);
if ($store_data_res) {//修改
$this->updateStoreData($store_data_res['id'],$params);
} else {//新增
......@@ -264,7 +263,6 @@ class CostParameter extends Basic
if((isset($params['deduct'])) && ($params['deduct'] > 0))
$data['deduct'] = $params['deduct'];
$res = $this->m_store_data->updateStoreData($data);
return $res;
}
......
......@@ -7,22 +7,28 @@ class CostDetailValidate extends Validate {
protected $rule = [
'id' => 'require|number|gt:0',
'type' => 'require|number|in:0,1,2',
'store_id' => 'require|number|gt:0',
'type' => 'require|number|in:0,1,2',
'setting_date' => 'require',
];
protected $message = [
'id.require' => 'id为必填字段',
'id.number' => 'id只能为数字',
'id.gt' => 'id必须大于0',
'store_id.require' => 'store_id为必填字段',
'store_id.number' => 'store_id只能为数字',
'store_id.gt' => 'store_id必须大于0',
'type.require' => 'type为必填字段',
'type.number' => 'type只能为数字',
'type.in' => 'type范围错误',
'setting_date.require' => '时间为必填字段',
'type.require' => 'type为必填字段',
'type.number' => 'type只能为数字',
'type.in' => 'type范围错误',
];
protected $scene = [
'getCostInfo' => [ 'id', 'type'],
'getCostInfo' => [ 'id', 'type' ],
'getMyCostDetailList' => [ 'store_id', 'setting_date' ],
];
}
\ No newline at end of file
......@@ -541,6 +541,9 @@ Route::group('index', [
'delStoreFeeImage' => ['index/StoreFee/delStoreFeeImage', ['method' => 'POST']],//删除图片
'getCostDetailList' => ['index/CostDetail/getCostDetailList', ['method' => 'POST|GET']],
'getCostDetailListExcel' => ['index/CostDetail/getCostDetailListExcel', ['method' => 'POST|GET']],
'getMyCostDetailList' => ['index/CostDetail/getMyCostDetailList', ['method' => 'POST|GET']],
'getCostInfo' => ['index/CostDetail/getCostInfo', ['method' => 'POST|GET']],
'addApplyFor' => ['index/StoreFee/addApplyFor', ['method' => 'POST']],//新增报销申请
'editApplyFor' => ['index/StoreFee/addApplyFor', ['method' => 'POST']],//修改报销申请
......
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