Commit 3cbf2b8d authored by hujun's avatar hujun

办公室名

parent c76c05c7
......@@ -104,7 +104,8 @@ class ApplyForCost extends Basic
$list[$k]['image_array'] = $image_array;
$list[$k]['check_image_array'] = $check_image_array;
$list[$k]['check_list'] = $m_check->findByAll('a.remark,a.create_time,b.name as agent_name',['apply_for_id'=>$v['id']]);
$list[$k]['image_base_url'] = ROOT_PATH . 'public/static/chat_image/';
$list[$k]['image_base_url'] = 'static/chat_image/';
$list[$k]['return_type'] = $this->params['type'];
}
return $this->response(200, '', $list);
}
......
......@@ -12,8 +12,11 @@ namespace app\index\controller;
use app\index\extend\Basic;
use app\index\service\CostService;
use app\index\untils\ExportExcelUntil;
use app\model\AStore;
use app\model\FApplyForFee;
use app\model\FApplyForFeeCheck;
use app\model\FImg;
use app\model\FStoreCost;
class Cost extends Basic
{
......@@ -242,5 +245,64 @@ class Cost extends Basic
return $this->response($code, $result['msg']);
}
/**
* 费用报销详情
*
* @return \think\Response
*/
public function getDetailCost()
{
$code = 101;
if (empty($this->params['id'])) {
return $this->response($code, '参数错误!');
}
$fee_model = new FApplyForFee();
$m_store = new AStore();
$m_store_cost = new FStoreCost();
$m_check = new FApplyForFeeCheck();
$m_img = new FImg();
$field = 'id,count_time,source,type,create_time,agent_id,total_fee,fee_item,purpose,status,site_id,status,bank,';
$field .= 'card_no,card_name,store_id';
$where['id'] = $this->params['id'];
$data = $fee_model->findByOne($field, $where);
$office_id = $m_store->getFieldOneValue('office_id', ['id'=>$data['store_id']]);
if ($office_id) {
$store_field = 'a.id,a.store_name';
$office_store = $m_store->getStoreCostAll($store_field, ['a.office_id'=>$office_id, 'a.status'=>0]);
$list = [];
$cost_ext_field = 'a.id,b.store_attendance_num,b.assume_fee';
$cost_ext_where['setting_date'] = $data['count_time'];
foreach($office_store as $k=>$v) {
$cost_ext_where['store_id'] = $v['id'];
$store_cost_data = $m_store_cost->getCostExt($cost_ext_field, $cost_ext_where);
if (empty($store_cost_data)) {
$list[$k] = [
'id' => 0,
'store_name' => $v['store_name'],
'store_attendance_num' => 0,
'assume_fee' => 0
];
} else {
$list[$k] = [
'id' => $store_cost_data['id'],
'store_name' => $v['store_name'],
'store_attendance_num' => $store_cost_data['store_attendance_num'],
'assume_fee' => $store_cost_data['assume_fee']
];
}
}
$check_field = 'b.name,a.create_time,a.remark';
$data['check_log'] = $m_check->findByAll($check_field, ['apply_for_id'=> $data['id']]);
$data['images_data'] = $m_img->findByAll('id,img_name,img_type', ['img_id'=>$data['id']]);
$data['store_cost_data'] = $list;
$data['image_base_url'] = 'static/chat_image/';
}
return $this->response(200, '', $data);
}
}
\ No newline at end of file
......@@ -1078,13 +1078,13 @@ class HouseService
/**
* @param $house_id
* @param $video_name
* @param $video_imgage
* @param $video_image
* @param $upload_id
* @param $upload_name
* @param $upload_phone
* @return mixed
*/
public function addVideo($house_id, $video_name, $video_imgage, $upload_id, $upload_name, $upload_phone)
public function addVideo($house_id, $video_name, $video_image, $upload_id, $upload_name, $upload_phone)
{
$result['status'] = 'fail';
......@@ -1108,7 +1108,7 @@ class HouseService
}
$data['video_name'] = $video_name;
$data['video_image'] = $video_imgage;
$data['video_image'] = $video_image;
$data['upload_id'] = $upload_id;
$data['upload_name'] = $upload_name;
$data['upload_phone'] = $upload_phone;
......
......@@ -421,4 +421,21 @@ class AStore extends BaseModel
->find();
return $result;
}
/**
* @param $field
* @param $params
* @return array|false|\PDOStatement|string|\think\Model
*/
public function getStoreCostAll($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')
->where($params)
->select();
return $result;
}
}
\ No newline at end of file
<?php
namespace app\model;
use think\Db;
use think\Model;
class FStoreCost extends BaseModel
{
protected $table = 'f_store_cost';
private $db_;
public function __construct($data = [])
{
parent::__construct($data);
$this->db_ = Db::name($this->table);
}
/**
* 新增数据
* @param $data
* @return mixed
*/
public function saveOffice($data) {
$time = date("Y-m-d H:i:s", time());
$data["is_del"] = 0;
$data['create_time'] = $time;
$data['update_time'] = $time;
return $this->db_->insert($data);
}
/**
* 查询单条数据
*/
public function findByOne($field,$params) {
$result = $this->db_
->field($field)
->where($params)
->find();
return $result;
}
/**
* @param $field
* @param $where
* @return false|\PDOStatement|string|\think\Collection
*/
public function getCostExt($field, $where)
{
$where['status'] = 0;
return $this->field($field)
->alias('a')
->join('f_store_cost_ext b', 'a.id=b.cost_id', 'left')
->where($where)
->select();
}
}
......@@ -537,6 +537,7 @@ Route::group('index', [
'checkCostThree/:check_status' => ['index/Cost/checkCost', ['method' => 'POST'], ['check_status' => 2]], //费用报销审核一审
'checkCostFour/:check_status' => ['index/Cost/checkCost', ['method' => 'POST'], ['check_status' => 3]], //费用报销审核二审
'checkCostFive/:check_status' => ['index/Cost/checkCost', ['method' => 'POST'], ['check_status' => 4]], //费用报销审核三审
'getDetailCost' => ['index/Cost/getDetailCost', ['method' => 'GET']], //费用报销详情
'delStoreFeeImage' => ['index/StoreFee/delStoreFeeImage', ['method' => 'POST']],//删除图片
'getCostDetailList' => ['index/CostDetail/getCostDetailList', ['method' => 'POST|GET']],
'getCostDetailListExcel' => ['index/CostDetail/getCostDetailListExcel', ['method' => 'POST|GET']],
......
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