Commit 5b30726d authored by zw's avatar zw

新增提交

parent 156e4556
...@@ -343,55 +343,60 @@ class DailyPaperService ...@@ -343,55 +343,60 @@ class DailyPaperService
$oDailyLog = new ODailyLog(); $oDailyLog = new ODailyLog();
return $oDailyLog->getDailyLogList($field, $params, 1, 15); return $oDailyLog->getDailyLogList($field, $params, 1, 15);
/**
* `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '财务日报审核日志',
* `daily_id` int(10) unsigned DEFAULT NULL COMMENT '财务日报id',
* `operation_id` int(10) unsigned DEFAULT NULL COMMENT '审核人',
* `operation_name` varchar(60) DEFAULT NULL COMMENT '审核人名字',
* `remark` varchar(255) DEFAULT NULL COMMENT '备注',
* `alipay` decimal(10,2) DEFAULT NULL COMMENT '支付宝转账',
* `tenpay` decimal(10,2) DEFAULT NULL COMMENT '微信转账',
* `realty_pay` decimal(10,2) unsigned DEFAULT NULL COMMENT '地产转账',
* `family_pay` decimal(10,2) unsigned DEFAULT NULL COMMENT '世家公账',
* `private_bank` decimal(10,2) unsigned DEFAULT NULL COMMENT '3000账号',
* `cash` decimal(10,2) unsigned DEFAULT NULL COMMENT '现金',
* `pos` decimal(10,2) unsigned DEFAULT NULL COMMENT 'pos机',
* `other_bank` decimal(10,2) DEFAULT NULL COMMENT '其他',
* `is_del` tinyint(1) unsigned DEFAULT '0' COMMENT '0正常1删除',
* `status` tinyint(1) unsigned DEFAULT '0' COMMENT '审核状态0已提交 1未审核 2已审核',
* `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
* `update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
* PRIMARY KEY (`id`)
* ) ENGINE=InnoDB DEFAULT CHARSET=utf8
*/
} }
public function dailyBin() /**
* @param $agent_id
* @param $agent_name
* @param $daily_date
* @param $alipay
* @param $tenpay
* @param $realty_pay
* @param $family_pay
* @param $private_bank
* @param $cash
* @param $pos
* @param $other_bank
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function addDaily($agent_id, $agent_name, $daily_date, $alipay, $tenpay, $realty_pay,
$family_pay, $private_bank, $cash, $pos, $other_bank)
{ {
/** $agent_info_arr["agent_id"] = $agent_id;
* CREATE TABLE `o_daily` ( $agent_info_field = "id,name,store_id,district_id,level";
* `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '财务日报',
* `agent_id` int(10) unsigned DEFAULT NULL COMMENT '提交人id', $agent_info = $this->aAgentsModel->getAgentById($agent_info_field, $agent_info_arr);
* `agent_name` varchar(60) DEFAULT NULL COMMENT '提交人姓名', if (count($agent_info) <= 0) {
* `store_id` int(10) DEFAULT NULL COMMENT '提交人门店id', return ["code" => 101, "msg" => "经纪人信息错误"];
* `district_id` int(10) unsigned DEFAULT NULL COMMENT '提交人部门id', }
* `daily_date` date DEFAULT NULL COMMENT '财务日报日期', $params = $this->dailyBin($agent_id, $agent_name, $daily_date, $alipay, $tenpay, $realty_pay,
* `alipay` decimal(10,2) DEFAULT NULL COMMENT '支付宝转账', $family_pay, $private_bank, $cash, $pos, $other_bank, $agent_info[0]["store_id"], $agent_info[0]["district_id"]);
* `tenpay` decimal(10,2) DEFAULT NULL COMMENT '微信转账', return $this->oDailyModel->addDaily($params);
* `realty_pay` decimal(10,2) unsigned DEFAULT NULL COMMENT '地产转账', }
* `family_pay` decimal(10,2) unsigned DEFAULT NULL COMMENT '世家公账',
* `private_bank` decimal(10,2) unsigned DEFAULT NULL COMMENT '3000账号', public function dailyBin($agent_id, $agent_name, $daily_date, $alipay, $tenpay, $realty_pay,
* `cash` decimal(10,2) unsigned DEFAULT NULL COMMENT '现金', $family_pay, $private_bank,$cash, $pos, $other_bank,$store_id,$district_id)
* `pos` decimal(10,2) unsigned DEFAULT NULL COMMENT 'pos机', {
* `other_bank` decimal(10,2) DEFAULT NULL COMMENT '其他', $arr["agent_id"] = $agent_id;
* `is_del` tinyint(1) unsigned DEFAULT '0' COMMENT '0正常1删除', $arr["agent_name"] = $agent_name;
* `status` tinyint(1) unsigned DEFAULT '0' COMMENT '审核状态0已提交 1未审核 2已审核', $arr["store_id"] = $store_id;
* `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP, $arr["district_id"] = $district_id;
* `update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, $arr["daily_date"] = $daily_date;
* PRIMARY KEY (`id`) $arr["alipay"] = $alipay;
* ) ENGINE=InnoDB DEFAULT CHARSET=utf8 $arr["tenpay"] = $tenpay;
*/ $arr["realty_pay"] = $realty_pay;
$arr["family_pay"] = $family_pay;
$arr["private_bank"] = $private_bank;
$arr["cash"] = $cash;
$arr["pos"] = $pos;
$arr["other_bank"] = $other_bank;
$arr["create_time"] = date("Y-m-d H:i:s",time());
$arr["update_time"] = date("Y-m-d H:i:s",time());
return $arr;
} }
/** /**
...@@ -413,4 +418,6 @@ class DailyPaperService ...@@ -413,4 +418,6 @@ class DailyPaperService
return $this->oDailyModel->getDailyList($field_info_field, $daily_info_params, 1, 1); return $this->oDailyModel->getDailyList($field_info_field, $daily_info_params, 1, 1);
} }
} }
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
namespace app\index\controller; namespace app\index\controller;
use app\api_broker\extend\Basic; use app\index\extend\Basic;
use app\api_broker\service\DailyPaperService; use app\api_broker\service\DailyPaperService;
use think\Request; use think\Request;
...@@ -16,6 +16,7 @@ use think\Request; ...@@ -16,6 +16,7 @@ use think\Request;
class DailyPaper extends Basic class DailyPaper extends Basic
{ {
private $service_; private $service_;
public function __construct(Request $request = null) public function __construct(Request $request = null)
{ {
parent::__construct($request); parent::__construct($request);
...@@ -29,29 +30,72 @@ class DailyPaper extends Basic ...@@ -29,29 +30,72 @@ class DailyPaper extends Basic
* @throws \think\db\exception\ModelNotFoundException * @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException * @throws \think\exception\DbException
*/ */
public function dailyDetail(){ public function dailyDetail()
{
$params = $this->params; $params = $this->params;
/* $params = array( /* $params = array(
"store_id" => 730,//门店id "store_id" => 730,//门店id
"is_store" => 0,//身份是否是店长,财务显示不一样 0店长 1财务 "is_store" => 0,//身份是否是店长,财务显示不一样 0店长 1财务
"daily_data" => "2018-12-01" "daily_data" => "2018-12-01"
); );
$this->agentId = 5775;*/ $this->agentId = 5775;*/
if(!isset($params["store_id"]) || !isset($params["is_store"]) || !isset($params["daily_data"])){ if (!isset($params["store_id"]) || !isset($params["is_store"]) || !isset($params["daily_data"])) {
return $this->response("101","请求参数错误"); return $this->response("101", "请求参数错误");
} }
$store_id = $params["store_id"]; $store_id = $params["store_id"];
$is_store = $params["is_store"]; $is_store = $params["is_store"];
$daily_data = $params["daily_data"]; $daily_data = $params["daily_data"];
$result = $this->service_->getDaily($this->agentId,$store_id,$is_store,$daily_data); $result = $this->service_->getDaily($this->agentId, $store_id, $is_store, $daily_data);
if($result["code"] == 101){ if ($result["code"] == 101) {
return $this->response("101",$result["msg"]); return $this->response("101", $result["msg"]);
}else{ } else {
return $this->response("200","success",$result["data"]); return $this->response("200", "success", $result["data"]);
} }
}
public function addDaily()
{
$params = $this->params;
/* $params = array(
"agent_id" => 5775,
"agent_name" => "222",
"daily_date" => "2018-12-02",
"alipay" => "12",
"tenpay" => "2323",
"realty_pay" => "232",
"family_pay" => "444",
"private_bank" => "55",
"cash" => "666",
"pos" => "777",
"other_bank" => "888"
);*/
if (empty($params["agent_id"]) || empty($params["agent_name"]) || empty($params["daily_date"]) ||
!isset($params["alipay"]) || !isset($params["tenpay"]) || !isset($params["realty_pay"]) ||
!isset($params["family_pay"]) || !isset($params["private_bank"]) || !isset($params["cash"]) ||
!isset($params["pos"]) || !isset($params["other_bank"])
) {
return $this->response("101", "请求参数错误");
}
$agent_id = $params["agent_id"];
$agent_name = $params["agent_name"];
$daily_date = $params["daily_date"];
$alipay = $params["alipay"];
$tenpay = $params["tenpay"];
$realty_pay = $params["realty_pay"];
$private_bank = $params["private_bank"];
$family_pay = $params["family_pay"];
$cash = $params["cash"];
$pos = $params["agent_id"];
$other_bank = $params["other_bank"];
$is_ok = $this->service_->addDaily($agent_id, $agent_name, $daily_date, $alipay, $tenpay, $realty_pay,
$family_pay,$private_bank ,$cash, $pos, $other_bank);
if($is_ok > 0){
return $this->response("200","success",[]);
}else{
return $this->response("101", "保存数据异常");
}
} }
} }
\ No newline at end of file
...@@ -48,4 +48,16 @@ class ODaily extends BaseModel{ ...@@ -48,4 +48,16 @@ class ODaily extends BaseModel{
->limit($page_size) ->limit($page_size)
->select(); ->select();
} }
public function addDaily($params){
Db::startTrans();
try {
$this->db_->insertAll($params);
Db::commit();
return 1;
} catch (\Exception $e) {
Db::rollback();
return 0;
}
}
} }
\ No newline at end of file
...@@ -392,7 +392,8 @@ Route::group('index', [ ...@@ -392,7 +392,8 @@ Route::group('index', [
'getBlackListInfo' => [ 'index/broker/getBlackListInfo', [ 'method' => 'GET|POST' ] ],//黑名单详情 'getBlackListInfo' => [ 'index/broker/getBlackListInfo', [ 'method' => 'GET|POST' ] ],//黑名单详情
'delAgentsBlackListImg' => [ 'index/broker/delAgentsBlackListImg', [ 'method' => 'GET|POST' ] ],//黑名单删除图片 'delAgentsBlackListImg' => [ 'index/broker/delAgentsBlackListImg', [ 'method' => 'GET|POST' ] ],//黑名单删除图片
'dailyDetail' => ['index/DailyPaper/dailyDetail', ['method' => 'get|post']], 'dailyDetail' => ['index/DailyPaper/dailyDetail', ['method' => 'get|post']],
'addDaily' => ['index/DailyPaper/addDaily', ['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