Commit 1978b198 authored by zw's avatar zw

新增财务提交

parent 321e53ef
......@@ -22,11 +22,13 @@ class DailyPaperService
{
private $oDailyModel;
private $aAgentsModel;
private $oDailyLogModel;
public function __construct()
{
$this->oDailyModel = new ODaily();
$this->aAgentsModel = new AAgents();
$this->oDailyLogModel = new ODailyLog();
}
/**
......@@ -341,8 +343,7 @@ class DailyPaperService
$params["daily_id"] = $daily_id;
$params["is_del"] = 0;
$oDailyLog = new ODailyLog();
return $oDailyLog->getDailyLogList($field, $params, 1, 15);
return $this->oDailyLogModel->getDailyLogList($field, $params, 1, 15);
}
......@@ -430,16 +431,36 @@ class DailyPaperService
}
$params = $this->dailyLogBin($daily_id, $agent_id, $agent_name, $daily_date, $alipay, $tenpay, $realty_pay,
$family_pay, $private_bank, $cash, $pos, $other_bank, $agent_info[0]["store_id"], $agent_info[0]["district_id"], $remark);
return $this->oDailyModel->addDaily($params);
return $this->oDailyLogModel->addDailyCheck($params);
}
/**
* @param $daily_id
* @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
* @param $store_id
* @param $district_id
* @param $remark
* @return mixed
*/
public function dailyLogBin($daily_id,$agent_id, $agent_name, $daily_date, $alipay, $tenpay, $realty_pay,
$family_pay, $private_bank,$cash, $pos, $other_bank,$store_id,$district_id,$remark)
{
$arr["daily_id"] = $daily_id;
$arr["operation_id"] = $agent_id;
$arr["operation_name"] = $agent_name;
$arr["store_id"] = $store_id;
$arr["district_id"] = $district_id;
$arr["remark"] = $remark;
$arr["daily_date"] = $daily_date;
$arr["alipay"] = $alipay;
$arr["tenpay"] = $tenpay;
......
......@@ -105,29 +105,15 @@ class DailyPaper extends Basic
}
}
public function commitCheck(){
$params = $this->params;
/**
* CREATE TABLE `o_daily_log` (
`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 '' COMMENT '审核人名字',
`remark` varchar(255) DEFAULT '' COMMENT '备注',
`alipay` decimal(10,2) DEFAULT '0.00' COMMENT '支付宝转账',
`tenpay` decimal(10,2) DEFAULT '0.00' COMMENT '微信转账',
`realty_pay` decimal(10,2) unsigned DEFAULT '0.00' COMMENT '地产转账',
`family_pay` decimal(10,2) unsigned DEFAULT '0.00' COMMENT '世家公账',
`private_bank` decimal(10,2) unsigned DEFAULT '0.00' COMMENT '3000账号',
`cash` decimal(10,2) unsigned DEFAULT '0.00' COMMENT '现金',
`pos` decimal(10,2) unsigned DEFAULT '0.00' COMMENT 'pos机',
`other_bank` decimal(10,2) DEFAULT '0.00' 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`)
* 财务审核新增
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function commitCheck(){
$params = $this->params;
/* $params = array(
"daily_id" => 1,
"agent_id" => 5775,//经纪人id
......
......@@ -49,6 +49,10 @@ class ODaily extends BaseModel{
->select();
}
/**
* @param $params
* @return int
*/
public function addDaily($params){
Db::startTrans();
try {
......
......@@ -48,4 +48,19 @@ class ODailyLog extends Model
->limit($page_size)
->select();
}
/**
* @param $params
* @return int
*/
public function addDailyCheck($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
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