You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wkcrm/application/crm/controller/Receivables.php

642 lines
26 KiB

4 years ago
<?php
// +----------------------------------------------------------------------
// | Description: 回款
// +----------------------------------------------------------------------
// | Author: Michael_xu | gengxiaoxu@5kcrm.com
// +----------------------------------------------------------------------
namespace app\crm\controller;
use app\admin\controller\ApiCommon;
use app\admin\model\Message;
use app\admin\model\User;
use app\crm\model\NumberSequence;
use app\crm\traits\AutoNumberTrait;
use think\Hook;
use think\Request;
use think\Db;
class Receivables extends ApiCommon
{
use AutoNumberTrait;
4 years ago
4 years ago
/**
* 用于判断权限
* @permission 无限制
* @allow 登录用户可访问
* @other 其他根据系统设置
4 years ago
**/
4 years ago
public function _initialize()
{
$action = [
4 years ago
'permission' => [''],
'allow' => ['check', 'revokecheck', 'system', 'count']
4 years ago
];
4 years ago
Hook::listen('check_auth', $action);
4 years ago
$request = Request::instance();
4 years ago
$a = strtolower($request->action());
4 years ago
if (!in_array($a, $action['permission'])) {
parent::_initialize();
}
4 years ago
}
4 years ago
/**
* 回款列表
4 years ago
* @return
4 years ago
* @author Michael_xu
*/
public function index()
{
$receivablesModel = model('Receivables');
$param = $this->param;
$userInfo = $this->userInfo;
4 years ago
$param['user_id'] = $userInfo['id'];
$data = $receivablesModel->getDataList($param);
4 years ago
return resultArray(['data' => $data]);
}
4 years ago
/**
* 导出
* @param
* @return
* @author guogaobo
*/
public function excelExport()
{
$param = $this->param;
$userInfo = $this->userInfo;
$param['user_id'] = $userInfo['id'];
if ($param['receivables_id']) {
$param['receivables_id'] = ['condition' => 'in', 'value' => $param['receivables_id'], 'form_type' => 'text', 'name' => ''];
}
$excelModel = new \app\admin\model\Excel();
// 导出的字段列表
$fieldModel = new \app\admin\model\Field();
$field_list = $fieldModel->getIndexFieldConfig('crm_receivables', $userInfo['id']);
// 文件名
$file_name = '5kcrm_receivables_' . date('Ymd');
$model = model('Receivables');
$temp_file = $param['temp_file'];
unset($param['temp_file']);
$page = $param['page'] ?: 1;
unset($param['page']);
unset($param['export_queue_index']);
return $excelModel->batchExportCsv($file_name, $temp_file, $field_list, $page, function ($page, $limit) use ($model, $param, $field_list) {
$param['page'] = $page;
$param['limit'] = $limit;
$data = $model->getDataList($param);
$data['list'] = $model->exportHandle($data['list'], $field_list, 'Receivables');
return $data;
});
}
4 years ago
/**
* 添加回款
*
*/
public function save()
{
$receivablesModel = model('Receivables');
$param = $this->param;
$userInfo = $this->userInfo;
$examineStepModel = new \app\admin\model\ExamineStep();
$param['create_user_id'] = $userInfo['id'];
$param['owner_user_id'] = $userInfo['id'];
$examineStatus = $param['examineStatus']; // 审批是否停用
unset($param['examineStatus']);
4 years ago
4 years ago
# 自动设置回款编号
$numberInfo = [];
if (empty($param['number'])) {
$numberInfo = $this->getAutoNumbers(2);
if (empty($numberInfo['number'])) return resultArray(['error' => '请填写回款编号!']);
$param['number'] = $numberInfo['number'];
}
if ($param['is_draft'] || (!empty($param['check_status']) && $param['check_status'] == 5)) {
//保存为草稿
$param['check_status'] = 5; //草稿(未提交)
4 years ago
$param['check_user_id'] = $param['check_user_id'] ? ',' . $param['check_user_id'] . ',' : '';
}
if (($examineStatus != false && $examineStatus != 'false') || $examineStatus == 1) {
//审核判断(是否有符合条件的审批流)
$examineFlowModel = new \app\admin\model\ExamineFlow();
if (!$examineFlowModel->checkExamine($param['owner_user_id'], 'crm_receivables')) {
return resultArray(['error' => '暂无审批人,无法创建']);
}
//添加审批相关信息
$examineFlowData = $examineFlowModel->getFlowByTypes($param['owner_user_id'], 'crm_receivables');
if (!$examineFlowData) {
return resultArray(['error' => '无可用审批流,请联系管理员']);
}
$param['flow_id'] = $examineFlowData['flow_id'];
//获取审批人信息
if ($examineFlowData['config'] == 1) {
//固定审批流
$nextStepData = $examineStepModel->nextStepUser($userInfo['id'], $examineFlowData['flow_id'], 'crm_receivables', 0, 0, 0);
$next_user_ids = arrayToString($nextStepData['next_user_ids']) ?: '';
$check_user_id = $next_user_ids ?: [];
$param['order_id'] = 1;
4 years ago
} else {
4 years ago
$check_user_id = $param['check_user_id'] ? ',' . $param['check_user_id'] . ',' : '';
4 years ago
}
4 years ago
if (!$check_user_id) {
return resultArray(['error' => '无可用审批人,请联系管理员']);
}
$param['check_user_id'] = is_array($check_user_id) ? ',' . implode(',', $check_user_id) . ',' : $check_user_id;
} else {
# 审批流停用,将状态改为审核通过
$param['check_status'] = 2;
4 years ago
}
4 years ago
4 years ago
$res = $receivablesModel->createData($param);
if ($res) {
//回款计划关联
if ($param['plan_id']) {
db('crm_receivables_plan')->where(['plan_id' => $param['plan_id']])->update(['receivables_id' => $res['receivables_id']]);
}
# 更新crm_number_sequence表中的last_date、create_time字段
if (!empty($numberInfo['data'])) (new NumberSequence())->batchUpdate($numberInfo['data']);
4 years ago
4 years ago
return resultArray(['data' => '添加成功']);
} else {
return resultArray(['error' => $receivablesModel->getError()]);
}
}
4 years ago
4 years ago
/**
* 回款详情
4 years ago
* @param
* @return
4 years ago
* @author Michael_xu
*/
public function read()
{
$receivablesModel = model('Receivables');
$userModel = new \app\admin\model\User();
$param = $this->param;
$data = $receivablesModel->getDataById($param['id']);
4 years ago
4 years ago
//判断权限
$auth_user_ids = $userModel->getUserByPer('crm', 'receivables', 'read');
4 years ago
if (!in_array($data['owner_user_id'], $auth_user_ids)) {
4 years ago
$authData['dataAuth'] = (int)0;
4 years ago
return resultArray(['data' => $authData]);
4 years ago
}
4 years ago
if (!$data) {
return resultArray(['error' => $receivablesModel->getError()]);
}
return resultArray(['data' => $data]);
}
4 years ago
4 years ago
/**
* 编辑回款
4 years ago
* @param
* @return
4 years ago
* @author Michael_xu
*/
public function update()
4 years ago
{
4 years ago
$receivablesModel = model('Receivables');
$userModel = new \app\admin\model\User();
$param = $this->param;
$userInfo = $this->userInfo;
$param['user_id'] = $userInfo['id'];
$examineStatus = $param['examineStatus']; // 审批流是否停用
unset($param['examineStatus']);
//判断权限
$dataInfo = $receivablesModel->getDataById($param['id']);
$auth_user_ids = $userModel->getUserByPer('crm', 'receivables', 'update');
4 years ago
if (!in_array($dataInfo['owner_user_id'], $auth_user_ids)) {
4 years ago
header('Content-Type:application/json; charset=utf-8');
4 years ago
exit(json_encode(['code' => 102, 'error' => '无权操作']));
4 years ago
}
4 years ago
4 years ago
# 自动设置回款编号
$numberInfo = [];
if (empty($param['number'])) {
$numberInfo = $this->getAutoNumbers(2);
if (empty($numberInfo['number'])) return resultArray(['error' => '请填写回款编号!']);
$param['number'] = $numberInfo['number'];
}
4 years ago
4 years ago
//已进行审批,不能编辑
if (!in_array($dataInfo['check_status'], ['3', '4', '5', '6'])) {
return resultArray(['error' => '当前状态为审批中或已审批通过,不可编辑']);
}
4 years ago
4 years ago
if ($param['is_draft'] || (!empty($param['check_status']) && $param['check_status'] == 5)) {
//保存为草稿
$param['check_status'] = 5; //草稿(未提交)
4 years ago
$param['check_user_id'] = $param['check_user_id'] ? ',' . $param['check_user_id'] . ',' : '';
4 years ago
} else {
if (($examineStatus != false && $examineStatus != 'false') || $examineStatus == 1) {
if ($param['is_draft']) {
//保存为草稿
$param['check_status'] = 5;
4 years ago
$param['check_user_id'] = $param['check_user_id'] ? ',' . $param['check_user_id'] . ',' : '';
4 years ago
} else {
//将回款审批状态至为待审核,提交后重新进行审批
//审核判断(是否有符合条件的审批流)
$examineFlowModel = new \app\admin\model\ExamineFlow();
$examineStepModel = new \app\admin\model\ExamineStep();
if (!$examineFlowModel->checkExamine($param['user_id'], 'crm_receivables')) {
return resultArray(['error' => '暂无审批人,无法创建']);
}
//添加审批相关信息
$examineFlowData = $examineFlowModel->getFlowByTypes($param['user_id'], 'crm_receivables');
if (!$examineFlowData) {
return resultArray(['error' => '无可用审批流,请联系管理员']);
}
$param['flow_id'] = $examineFlowData['flow_id'];
//获取审批人信息
if ($examineFlowData['config'] == 1) {
//固定审批流
$nextStepData = $examineStepModel->nextStepUser($dataInfo['owner_user_id'], $examineFlowData['flow_id'], 'crm_receivables', 0, 0, 0);
4 years ago
$next_user_ids = arrayToString($nextStepData['next_user_ids']) ?: '';
$check_user_id = $next_user_ids ?: [];
4 years ago
$param['order_id'] = 1;
} else {
4 years ago
$check_user_id = $param['check_user_id'] ? ',' . $param['check_user_id'] . ',' : '';
4 years ago
}
if (!$check_user_id) {
return resultArray(['error' => '无可用审批人,请联系管理员']);
}
4 years ago
$param['check_user_id'] = is_array($check_user_id) ? ',' . implode(',', $check_user_id) . ',' : $check_user_id;
4 years ago
$param['check_status'] = 0;
$param['flow_user_id'] = '';
}
}
}
4 years ago
4 years ago
$res = $receivablesModel->updateDataById($param, $param['id']);
if ($res) {
//将审批记录至为无效
$examineRecordModel = new \app\admin\model\ExamineRecord();
4 years ago
$examineRecordModel->setEnd(['types' => 'crm_receivables', 'types_id' => $param['id']]);
4 years ago
# 更新crm_number_sequence表中的last_date、create_time字段
if (!empty($numberInfo['data'])) (new NumberSequence())->batchUpdate($numberInfo['data']);
4 years ago
4 years ago
return resultArray(['data' => '编辑成功']);
} else {
return resultArray(['error' => $receivablesModel->getError()]);
4 years ago
}
4 years ago
}
4 years ago
4 years ago
/**
* 删除回款
4 years ago
* @param
* @return
4 years ago
* @author Michael_xu
*/
public function delete()
{
4 years ago
$actionRecordModel = new \app\admin\model\ActionRecord();
$fileModel = new \app\admin\model\File();
$recordModel = new \app\admin\model\Record();
4 years ago
$receivablesModel = model('Receivables');
$param = $this->param;
4 years ago
$userInfo = $this->userInfo;
4 years ago
if (!is_array($param['id'])) {
$receivables_id = [$param['id']];
} else {
$receivables_id = $param['id'];
}
$delIds = [];
$errorMessage = [];
4 years ago
4 years ago
//数据权限判断
$userModel = new \app\admin\model\User();
$auth_user_ids = $userModel->getUserByPer('crm', 'receivables', 'delete');
$adminTypes = adminGroupTypes($userInfo['id']);
4 years ago
foreach ($receivables_id as $k => $v) {
4 years ago
$isDel = true;
//数据详情
$data = $receivablesModel->getDataById($v);
if (!$data) {
$isDel = false;
4 years ago
$errorMessage[] = 'id为' . $v . '的回款删除失败,错误原因:' . $receivablesModel->getError();
4 years ago
continue;
}
4 years ago
if (!in_array($data['owner_user_id'], $auth_user_ids)) {
4 years ago
$isDel = false;
4 years ago
$errorMessage[] = '名称为' . $data['number'] . '的回款删除失败,错误原因:无权操作';
4 years ago
continue;
}
4 years ago
if (!in_array($data['check_status'], [4, 5]) && !in_array(1, $adminTypes)) {
4 years ago
$isDel = false;
4 years ago
$errorMessage[] = '名称为' . $data['number'] . '的回款删除失败,错误原因:请先撤销审核';
4 years ago
continue;
}
if ($isDel) {
if (db('crm_receivables_plan')->where('receivables_id', $v)->value('plan_id')) {
$isDel = false;
4 years ago
$errorMessage[] = '名称为' . $data['number'] . '的回款删除失败,错误原因:回款已关联回款计划,不能删除!';
4 years ago
continue;
4 years ago
}
4 years ago
}
if ($isDel) {
$delIds[] = $v;
4 years ago
}
4 years ago
}
if ($delIds) {
$data = $receivablesModel->delDatas($delIds);
if (!$data) {
return resultArray(['error' => $receivablesModel->getError()]);
4 years ago
}
//删除跟进记录
$recordModel->delDataByTypes(7,$delIds);
# 删除附件
$fileModel->delRFileByModule('crm_receivables', $delIds);
//删除关联操作记录
$actionRecordModel->delDataById(['types' => 'crm_receivables', 'action_id' => $delIds]);
actionLog($delIds, '', '', '');
4 years ago
}
4 years ago
4 years ago
if ($errorMessage) {
return resultArray(['error' => $errorMessage]);
} else {
return resultArray(['data' => '删除成功']);
4 years ago
}
}
4 years ago
/**
* 回款审核
4 years ago
* @param
4 years ago
* @return
4 years ago
* @author Michael_xu
*/
4 years ago
public function check()
{
$param = $this->param;
$userInfo = $this->userInfo;
$user_id = $userInfo['id'];
$receivablesModel = model('Receivables');
$examineStepModel = new \app\admin\model\ExamineStep();
$examineRecordModel = new \app\admin\model\ExamineRecord();
$examineFlowModel = new \app\admin\model\ExamineFlow();
4 years ago
4 years ago
$receivablesData = [];
$receivablesData['update_time'] = time();
$receivablesData['check_status'] = 1; //0待审核1审核通中2审核通过3审核未通过
//权限判断
if (!$examineStepModel->checkExamine($user_id, 'crm_receivables', $param['id'])) {
4 years ago
return resultArray(['error' => $examineStepModel->getError()]);
4 years ago
};
//审批主体详情
$dataInfo = $receivablesModel->getDataById($param['id']);
$flowInfo = $examineFlowModel->getDataById($dataInfo['flow_id']);
$is_end = 0; // 1审批结束
4 years ago
4 years ago
$status = $param['status'] ? 1 : 0; //1通过0驳回
$checkData = [];
$checkData['check_user_id'] = $user_id;
$checkData['types'] = 'crm_receivables';
$checkData['types_id'] = $param['id'];
$checkData['check_time'] = time();
$checkData['content'] = $param['content'];
$checkData['flow_id'] = $dataInfo['flow_id'];
4 years ago
$checkData['order_id'] = $dataInfo['order_id'] ?: 1;
4 years ago
$checkData['status'] = $status;
if ($status == 1) {
if ($flowInfo['config'] == 1) {
//固定流程
//获取下一审批信息
$nextStepData = $examineStepModel->nextStepUser($dataInfo['owner_user_id'], $dataInfo['flow_id'], 'crm_receivables', $param['id'], $dataInfo['order_id'], $user_id);
4 years ago
$next_user_ids = $nextStepData['next_user_ids'] ?: [];
$receivablesData['order_id'] = $nextStepData['order_id'] ?: '';
4 years ago
if (!$next_user_ids) {
$is_end = 1;
//审批结束
$checkData['check_status'] = !empty($status) ? 2 : 3;
$receivablesData['check_user_id'] = '';
} else {
//修改主体相关审批信息
$receivablesData['check_user_id'] = arrayToString($next_user_ids);
4 years ago
}
4 years ago
} else {
//自选流程
$is_end = $param['is_end'] ? 1 : '';
4 years ago
$check_user_id = $param['check_user_id'] ?: '';
4 years ago
if ($is_end !== 1 && empty($check_user_id)) {
4 years ago
return resultArray(['error' => '请选择下一审批人']);
4 years ago
}
$receivablesData['check_user_id'] = arrayToString($param['check_user_id']);
4 years ago
}
4 years ago
if ($is_end == 1) {
$checkData['check_status'] = !empty($status) ? 2 : 3;
$receivablesData['check_user_id'] = '';
$receivablesData['check_status'] = 2;
4 years ago
}
4 years ago
} else {
//审批驳回
$is_end = 1;
$receivablesData['check_status'] = 3;
//将审批记录至为无效
// $examineRecordModel->setEnd(['types' => 'crm_receivables','types_id' => $param['id']]);
}
//已审批人ID
4 years ago
$receivablesData['flow_user_id'] = stringToArray($dataInfo['flow_user_id']) ? arrayToString(array_merge(stringToArray($dataInfo['flow_user_id']), [$user_id])) : arrayToString([$user_id]);
4 years ago
$resReceivables = db('crm_receivables')->where(['receivables_id' => $param['id']])->update($receivablesData);
if ($resReceivables) {
if ($status) {
// 审批通过,通知下一审批人
(new Message())->send(
Message::RECEIVABLES_TO_DO,
[
'from_user' => User::where(['id' => $dataInfo['owner_user_id']])->value('realname'),
'title' => $dataInfo['number'],
'action_id' => $param['id']
],
stringToArray($receivablesData['check_user_id'])
);
} else {
// 驳回通知负责人
(new Message())->send(
Message::RECEIVABLES_REJECT,
[
'title' => $dataInfo['number'],
'action_id' => $param['id']
],
$dataInfo['owner_user_id']
);
}
4 years ago
4 years ago
//审批记录
$resRecord = $examineRecordModel->createData($checkData);
if ($is_end == 1 && !empty($status)) {
//发送站内信 通过
(new Message())->send(
4 years ago
Message::RECEIVABLES_PASS,
[
'title' => $dataInfo['number'],
'action_id' => $param['id']
],
$dataInfo['owner_user_id']
);
4 years ago
}
4 years ago
return resultArray(['data' => '审批成功']);
4 years ago
} else {
4 years ago
return resultArray(['error' => '审批失败,请重试!']);
4 years ago
}
}
4 years ago
4 years ago
/**
* 回款撤销审核
4 years ago
* @param
4 years ago
* @return
4 years ago
* @author Michael_xu
*/
4 years ago
public function revokeCheck()
{
$param = $this->param;
$userInfo = $this->userInfo;
$user_id = $userInfo['id'];
$receivablesModel = model('Receivables');
$examineStepModel = new \app\admin\model\ExamineStep();
$examineRecordModel = new \app\admin\model\ExamineRecord();
$customerModel = model('Customer');
$userModel = new \app\admin\model\User();
4 years ago
4 years ago
$receivablesData = [];
$receivablesData['update_time'] = time();
$receivablesData['check_status'] = 0; //0待审核1审核通中2审核通过3审核未通过
//审批主体详情
4 years ago
$dataInfo = $receivablesModel->getDataById($param['id']);
4 years ago
//权限判断(创建人或负责人或管理员)
if ($dataInfo['check_status'] == 2) {
4 years ago
return resultArray(['error' => '已审批结束,不能撤销']);
}
4 years ago
if ($dataInfo['check_status'] == 4) {
4 years ago
return resultArray(['error' => '无需撤销']);
}
$admin_user_ids = $userModel->getAdminId();
4 years ago
if ($dataInfo['owner_user_id'] !== $user_id && !in_array($user_id, $admin_user_ids)) {
return resultArray(['error' => '没有权限']);
4 years ago
}
4 years ago
$is_end = 0; // 1审批结束
$status = 2; //1通过0驳回, 2撤销
$checkData = [];
$checkData['check_user_id'] = $user_id;
$checkData['types'] = 'crm_receivables';
$checkData['types_id'] = $param['id'];
$checkData['check_time'] = time();
$checkData['content'] = $param['content'];
$checkData['flow_id'] = $dataInfo['flow_id'];
$checkData['order_id'] = $dataInfo['order_id'];
$checkData['status'] = $status;
$receivablesData['check_status'] = 4;
$receivablesData['check_user_id'] = '';
$receivablesData['flow_user_id'] = '';
$resReceivables = db('crm_receivables')->where(['receivables_id' => $param['id']])->update($receivablesData);
if ($resReceivables) {
//将审批记录至为无效
// $examineRecordModel->setEnd(['types' => 'crm_receivables','types_id' => $param['id']]);
//审批记录
$resRecord = $examineRecordModel->createData($checkData);
4 years ago
return resultArray(['data' => '撤销成功']);
4 years ago
} else {
4 years ago
return resultArray(['error' => '撤销失败,请重试!']);
4 years ago
}
}
4 years ago
4 years ago
/**
* 转移
*
* @return \think\response\Json
*/
public function transfer()
{
4 years ago
$param = $this->param;
$userInfo = $this->userInfo;
4 years ago
$receivablesModel = model('Receivables');
4 years ago
4 years ago
$userModel = new \app\admin\model\User();
4 years ago
$authIds = $userModel->getUserByPer();
4 years ago
if (empty($param['owner_user_id'])) return resultArray(['error' => '变更负责人不能为空']);
if (empty($param['receivables_id']) || !is_array($param['receivables_id'])) return resultArray(['error' => '请选择需要转移的回款']);
4 years ago
4 years ago
$owner_user_info = $userModel->getUserById($param['owner_user_id']);
4 years ago
4 years ago
$data = [
'owner_user_id' => $param['owner_user_id'],
4 years ago
'update_time' => time(),
4 years ago
];
4 years ago
4 years ago
$errorMessage = [];
foreach ($param['receivables_id'] as $receivables_id) {
$receivables_info = $receivablesModel->getDataById($receivables_id);
if (!$receivables_info) {
4 years ago
$errorMessage[] = 'id:为《' . $receivables_id . '》的回款转移失败,错误原因:数据不存在;';
4 years ago
continue;
}
4 years ago
4 years ago
# 转移至当前负责人的直接跳过
if ($param['owner_user_id'] == $receivables_info['owner_user_id']) continue;
4 years ago
4 years ago
if (!in_array($receivables_info['owner_user_id'], $authIds)) {
4 years ago
$errorMessage[] = $receivables_info['number'] . '"转移失败,错误原因:无权限;';
4 years ago
continue;
}
4 years ago
if (in_array($receivables_info['check_status'], ['0', '1'])) {
$errorMessage[] = $receivables_info['number'] . '转移失败,错误原因:待审或审批中,无法转移;';
4 years ago
continue;
}
4 years ago
4 years ago
$res = $receivablesModel->where(['receivables_id' => $receivables_id])->update($data);
if (!$res) {
4 years ago
$errorMessage[] = $receivables_info['number'] . '"转移失败,错误原因:数据出错;';
4 years ago
continue;
}
4 years ago
updateActionLog($userInfo['id'], 'crm_receivables', $receivables_id, '', '', '将回款转移给:' . $owner_user_info['realname']);
4 years ago
}
if (!$errorMessage) {
return resultArray(['data' => '转移成功']);
} else {
return resultArray(['error' => $errorMessage]);
}
}
4 years ago
4 years ago
/**
* 系统信息
*
* @return \think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function system()
{
if (empty($this->param['id'])) return resultArray(['error' => '参数错误!']);
4 years ago
4 years ago
$receivablesModel = new \app\crm\model\Receivables();
4 years ago
4 years ago
$data = $receivablesModel->getSystemInfo($this->param['id']);
4 years ago
4 years ago
return resultArray(['data' => $data]);
}
4 years ago
4 years ago
/**
* table标签栏数量
*
* @return \think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function count()
{
if (empty($this->param['receivables_id'])) return resultArray(['error' => '参数错误!']);
4 years ago
4 years ago
# 附件
$fileCount = Db::name('crm_receivables_file')->alias('receivables')->join('__ADMIN_FILE__ file', 'file.file_id = receivables.file_id', 'LEFT')->where('receivables_id', $this->param['receivables_id'])->count();
4 years ago
4 years ago
return resultArray(['data' => ['fileCount' => $fileCount]]);
}
}