init: import production code mss.nahaichuan.com (exclude Runtime/Uploads/backups/logs)
这个提交包含在:
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
|
||||
namespace Retail\Controller;
|
||||
|
||||
use Common\Business\PurchasePayable;
|
||||
use Think\Controller;
|
||||
|
||||
//[1.5.46]
|
||||
|
||||
/**
|
||||
* 商户采购资金付款管理
|
||||
* Class PurchasePayableController
|
||||
* @package Retail\Controller
|
||||
*/
|
||||
class PurchasePayableController extends BaseController
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$arr = array(
|
||||
'exportOperation' => '/index.php/Retail/PurchasePayable/export',
|
||||
'payment' => '/index.php/Retail/PurchasePayable/supplierInfo',
|
||||
);
|
||||
$authArr = checkFunction($arr);
|
||||
$merchant_id = session("merchant_userinfo")['id'];
|
||||
$supplier = D("Supplier")->getSelect(array('merchantid' => $merchant_id, 'status' => 1), $page = '', $limit = '', "id,supplier_name");
|
||||
$this->assign('supplier', json_encode($supplier));
|
||||
$this->assign('authArr', $authArr);
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 采购应付款列表
|
||||
*/
|
||||
public function PayableList()
|
||||
{
|
||||
$data = I("post.");
|
||||
$data['user_type'] = 1;
|
||||
$data['merchant_id'] = session('merchant_userinfo')['id'];
|
||||
$PurchasePayableClass = new PurchasePayable();
|
||||
$result = $PurchasePayableClass->payableList($data);
|
||||
$this->ajaxReturn($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 统计
|
||||
*/
|
||||
public function PayableTotal()
|
||||
{
|
||||
$data = I("post.");
|
||||
$data['user_type'] = 1;
|
||||
$data['merchant_id'] = session('merchant_userinfo')['id'];
|
||||
$PurchasePayableClass = new PurchasePayable();
|
||||
$result = $PurchasePayableClass->payableTotal($data);
|
||||
$this->ajaxReturn($result);
|
||||
}
|
||||
|
||||
|
||||
//供货商
|
||||
public function supplierInfo()
|
||||
{
|
||||
$supplier_id = I("post.supplier_id");
|
||||
$res = A("Api/Inventory")->MerSupplierInfo($supplier_id);
|
||||
$this->ajaxReturn($res);
|
||||
}
|
||||
|
||||
|
||||
//付款操作
|
||||
public function payment()
|
||||
{
|
||||
$merchant_id = session("merchant_userinfo")['id'];
|
||||
$operator_id = session("jurisdiction_user")['id'];
|
||||
$data = I("post.");
|
||||
$res = A("Api/Inventory")->MerPayment($data, $merchant_id, $operator_id);
|
||||
if ($res['status'] == 1) {
|
||||
//操作日志记录
|
||||
$source = 0;//请求来源: 0pc系统 1小助手
|
||||
$type = 3;//平台:1合伙人端 2代理商端 3商户端 4门店端
|
||||
$request_data = json_encode($_POST);//请求参数 json数据
|
||||
$desc = '采购应付款-付款';//操作行为描述
|
||||
action_log($source, $type, $request_data, $desc);
|
||||
}
|
||||
$this->ajaxReturn($res);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 采购应付款导出
|
||||
* @throws \PHPExcel_Exception
|
||||
* @throws \PHPExcel_Reader_Exception
|
||||
* @throws \PHPExcel_Writer_Exception
|
||||
*/
|
||||
public function export()
|
||||
{
|
||||
$data = I('get.');
|
||||
$data['user_type'] = 1;
|
||||
$data['merchant_id'] = session('merchant_userinfo')['id'];
|
||||
$PurchasePayableClass = new PurchasePayable();
|
||||
$PurchasePayableClass->payableListExport($data);
|
||||
}
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户