Commit 06f78268 authored by hujun's avatar hujun

调整

parent aa8f9d25
......@@ -2424,8 +2424,8 @@ class Finance extends Basic
$m_agent_house = new GHousesToAgents();
$m_agent = new AAgents();
foreach ($list as $k=>$v) {
$source_id = $m_pay_adjustment->getFieldValue('id', ['paylog_id'=> $v['id']]);
$list[$k]['source_id'] = empty($source_id) ? 0 : $source_id;
$source_id = $m_pay_adjustment->getFieldColumn('id', ['paylog_id'=> $v['id']]);
$list[$k]['source_id'] = empty($source_id) ? 0 : implode(',', $source_id);
$bargain_id = $this->m_bargain->selectBargainByOrderNo('id', ['order_id', $v['order_id']]);
$list[$k]['bargain_id'] = $bargain_id[0]['id'];
......@@ -2780,6 +2780,8 @@ class Finance extends Basic
}
/**
* 编辑收款详情
*
* @return \think\Response
*/
public function getCollectionEdit() {
......@@ -2814,7 +2816,66 @@ class Finance extends Basic
return $this->response($code, $msg, []);
}
/**
/**
* 收款
*
* @return \think\Response
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function collectingBill() {
$params = $this->params;
if (!isset($params["agent_id"]) || !isset($params["agent_id"]) || !isset($params["report_id"]) ||
!isset($params["order_id"]) || !isset($params["order_no"]) | !isset($params["collecting_bill"]) ||
!isset($params["house_number"]) || !isset($params["industry_type"]) ) {
return $this->response("101", "请求参数错误");
}
/* $params = array(
"agent_id" => 1,//收款经纪人id
"agent_name" => 1,//收款经纪人id
"report_id" => 111,//报备id
"order_id" => 2, //关联order表id
"order_no" => "123123123", //订单no
// `type` '付款类型 10意向金 20定金 30保管金 40押金 50 租金 60 进场费 70转让费 80其他',
//`pay_type` '支付方式 10支付宝 20 微信 30pos机器 40转账 50现金',
// `money` '入账金额',
"collecting_bill" => [ { "type" : 10, "pay_type" : 10, "money" : 1100 }, { "type" :10, "pay_type" : 10, "money": 1200 } ],
"house_number" => "3301号",
"industry_type" => "asdasdasd",
"remark" => "没什么备注",
"transfer_img" => "12312312312",
"is_dividend" => 1, //是否分红 1否 0是
"last_transfer_time" => "2018-10-18", //最后转定时间
"pay_id" => 1,
);*/
$params["collecting_bill"] = json_decode($params["collecting_bill"], true);
$remark = isset($params["remark"]) ? $params["remark"] : "";
$transfer_img = isset($params["transfer_img"]) ? json_decode($params["transfer_img"] ,true): "";
$income_time = isset($params["income_time"]) ? $params["income_time"] : "";
$pay_id = isset($params["pay_id"]) ? $params["pay_id"] : 0;
$source = $params["source"] ? $params["source"] : 0;
if($pay_id > 0){
$source = 2;
}
$service_ = new OrderLogService();
$is_ok = $service_->addCollectingBill($params["agent_id"], $params["agent_name"], $params["report_id"],
$params["order_id"], $params["order_no"], $params["collecting_bill"], $params["house_number"], $params["industry_type"],
$remark, $transfer_img, $source,$income_time,$params["is_dividend"],$params["last_transfer_time"],$pay_id);
if ($is_ok > 0) {
return $this->response("200", "request success", [ "bill_id" => $is_ok ]);
}elseif($is_ok == -1){
return $this->response("101", "付款类型或支付方式错误");
}
return $this->response("101", "request faild");
}
/**
* 获取收款入账
*
* @return \think\Response
......@@ -2828,7 +2889,9 @@ class Finance extends Basic
* @return \think\Response
*/
public function adjustment() {
return view("adjustment");
if (!$this->request->isAjax()) {
return view("adjustment");
}
}
public function dailyList() {
......
......@@ -78,6 +78,16 @@ class OPayLogAdjustment extends Model{
->value($field);
}
/**
* @param $field
* @param $params
* @return int|mixed
*/
public function getFieldColumn($field,$params) {
return $this->db_->where($params)
->column($field);
}
public function addAdjustment($params){
Db::startTrans();
try {
......
......@@ -275,6 +275,7 @@ Route::group('index', [
'receiptImgList' => ['index/Finance/receiptImgList', ['method' => 'post|get']],//收款列表-收款图片列表
'getCollectionDetail' => ['index/Finance/getCollectionDetail', ['method' => 'post|get']],//收款详情
'getCollectionEdit' => ['index/Finance/getCollectionEdit', ['method' => 'post']],//收款修改保存
'collectingBill' => ['index/Finance/collectingBill', ['method' => 'post']],//收款
'performanceInfo' => ['index/PerformanceInfo/performanceInfo', ['method' => 'post|get']],//业绩明细
'getPerformanceInfoExcel' => ['index/PerformanceInfo/getPerformanceInfoExcel', ['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