Commit 290366ea authored by zw's avatar zw

财务日报

parent c3e87c3d
......@@ -31,12 +31,12 @@ class DailyPaper extends Basic
*/
public function dailyDetail(){
$params = $this->params;
/* $params = array(
"store_id" => 73,//门店id
$params = array(
"store_id" => 730,//门店id
"is_store" => 0,//身份是否是店长,财务显示不一样 0店长 1财务
"daily_data" => "2018-12-01"
);
$this->agentId = 74;*/
$this->agentId = 5775;
if(!isset($params["store_id"]) || !isset($params["is_store"]) || !isset($params["daily_data"])){
return $this->response("101","请求参数错误");
}
......
......@@ -222,8 +222,9 @@ class DailyPaperService
);
//调整出账
$field_adjustment = "b.id,c.house_id,a.agent_id,a.income_time,b.type,a.receipt_number,a.create_time";
$params_adjustment["a.agent_id"] = array("in", ($ids));
$params_adjustment["a.is_del"] = 0;
$params_adjustment["a.agent_id"] = array("in", ($ids));
$params_adjustment["a.is_del"] = 0;
$params_adjustment["b.create_time"] = array("between", array($daily_data, $daily_data . " 23:59:59"));
$info["adjustment"] = $this->getHouseAndAgentInfo(
$payLogModel->selectAdjustmentList($field_adjustment, $params_adjustment)
);
......@@ -255,6 +256,9 @@ class DailyPaperService
$house_arr = $this->houseInfo($house_id_str);
foreach ($data as $k => $v) {
$data[$k]["agent_name"] = "";
$data[$k]["store_name"] = "";
$data[$k]["house_address"] = "";
foreach ($agent_arr as $value) {
if ($v["agent_id"] == $value["id"]) {
$data[$k]["agent_name"] = $value["name"];
......
<?php
namespace app\index\controller;
use app\api_broker\extend\Basic;
use app\api_broker\service\DailyPaperService;
use think\Request;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/12/17
* Time : 11:09 AM
* Intro:
*/
class DailyPaper extends Basic
{
private $service_;
public function __construct(Request $request = null)
{
parent::__construct($request);
$this->service_ = new DailyPaperService();
}
/**
* 财务日报
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function dailyDetail(){
$params = $this->params;
/* $params = array(
"store_id" => 730,//门店id
"is_store" => 0,//身份是否是店长,财务显示不一样 0店长 1财务
"daily_data" => "2018-12-01"
);
$this->agentId = 5775;*/
if(!isset($params["store_id"]) || !isset($params["is_store"]) || !isset($params["daily_data"])){
return $this->response("101","请求参数错误");
}
$store_id = $params["store_id"];
$is_store = $params["is_store"];
$daily_data = $params["daily_data"];
$result = $this->service_->getDaily($this->agentId,$store_id,$is_store,$daily_data);
if($result["code"] == 101){
return $this->response("101",$result["msg"]);
}else{
return $this->response("200","success",$result["data"]);
}
}
}
\ No newline at end of file
......@@ -37,6 +37,9 @@ class ODaily extends BaseModel{
if(isset($params["agent_id"])){
$where_["agent_id"] = $params["agent_id"];
}
if(isset($params["daily_date"])){
$where_["daily_date"] = $params["daily_date"];
}
$where_["is_del"] = 0;
return $this->db_
->field($field)
......
......@@ -392,7 +392,7 @@ Route::group('index', [
'getBlackListInfo' => [ 'index/broker/getBlackListInfo', [ 'method' => 'GET|POST' ] ],//黑名单详情
'delAgentsBlackListImg' => [ 'index/broker/delAgentsBlackListImg', [ 'method' => 'GET|POST' ] ],//黑名单删除图片
'dailyDetail' => ['index/DailyPaper/dailyDetail', ['method' => 'get|post']],
]);
......@@ -738,7 +738,7 @@ Route::group('broker', [
'getBeForNum' => ['api_broker/PayLog/getBeForNum', ['method' => 'get|post']],
'adjustment' => ['api_broker/PayLog/adjustment', ['method' => 'get|post']],
'dailyDetail' => ['api_broker/DailyPaper/dailyDetail', ['method' => 'get|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