diff --git a/Application/Admin/Controller/QueryController.class.php b/Application/Admin/Controller/QueryController.class.php index 63e4428a5..83d911277 100644 --- a/Application/Admin/Controller/QueryController.class.php +++ b/Application/Admin/Controller/QueryController.class.php @@ -801,11 +801,25 @@ class QueryController extends ThinkController $data['msg'] = '请上传汇款证明'; return $data; } + $downloadId = M('document_download')->where(array('file_id' => $transferProof))->getField('id'); + if (empty($downloadId)) { + $fileData = M('File')->field('size,ext')->find($transferProof); + $downloadSave['content'] = '推广员提现订单汇款证明'; + $downloadSave['file_id'] = $transferProof; + $downloadSave['size'] = $fileData['size']; + $downloadRes = M('document_download')->add($downloadSave); + if (!$downloadRes) { + $data['status'] = 0; + $data['msg'] = '保存失败'; + return $data; + } + $downloadId = $downloadRes; + } $map['id'] = $ids; $map['status'] = 1; $save['audit_time'] = time(); $save['status'] = $status; - $save['transfer_proof'] = $transferProof; + $save['transfer_proof'] = $downloadId; $res = $withdraw->where($map)->save($save); if ($res === false) { $data['status'] = 0; diff --git a/Application/Base/Service/PromoteService.class.php b/Application/Base/Service/PromoteService.class.php index a5874251a..59ae9d8d6 100644 --- a/Application/Base/Service/PromoteService.class.php +++ b/Application/Base/Service/PromoteService.class.php @@ -184,10 +184,10 @@ class PromoteService { $shiftIds = json_decode($task['shift_ids'], true) ?? []; if (count($shiftIds) > 0) { $firstMap['id'] = ['in', $shiftIds]; - $secondMap['id'] = ['in', $shiftIds]; + $secondMap['parent_id'] = ['in', $shiftIds]; } - $status = M('promote', 'tab_')->where($firstMap)->save(['parent_id' => $toPromote['id']]); + $status = M('promote', 'tab_')->where($firstMap)->save(['parent_id' => $toPromote['id'], 'parent_name' => $toPromote['account']]); if (!$status) { $model->rollback(); return ['status' => false, 'msg' => '系统异常,修改推广员上级失败']; diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index 6987c0714..eccd40bbe 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -1712,6 +1712,10 @@ class DownloadController extends BaseController { break; case "提现明细": $this->withdrawDtlExcelInfo($id,$map); + break; + case "汇款证明": + $this->remitCerDownLoad($id,$map); + break; default: break; } @@ -2201,6 +2205,13 @@ class DownloadController extends BaseController { } + public function remitCerDownLoad($id,$map) { + $proof_id = $map['id']; + $file = new FileController(); + $file->download($proof_id); + $this->backSuccessExport($id); + } + public function withdrawDtlExcelInfo($id,$map) { $xlsName = "提现记录"; $xlsCell = array( @@ -2625,6 +2636,39 @@ class DownloadController extends BaseController { } } + /* + * 汇款证明 + * */ + public function Remittancecer() { + $id = $_REQUEST["id"]; + $model = M("withdraw","tab_"); + $res = $model->where(['id'=>$id])->field('transfer_proof,status')->find(); + $transfer_proof = intval($res["transfer_proof"]); + $map = ['id'=>$transfer_proof]; + $addtime = time(); + $conditions = json_encode($map,TRUE); + $data = [ + 'logid' => 'remitrecord_'.time(), + 'admin_id' => PID, + 'type' => '/Home/Finance/withdrawRecord', + 'dataname' => '汇款证明', + 'status' => 0, + 'addtime' => $addtime, + 'begintime' => 0, + 'content' => '', + 'conditions' =>$conditions, + ]; + $log = M('downloadlog','tab_')->add($data); + if (!$log) { + $this->error('添加下载失败'); + } + $this->success('添加下载成功',U('listsIndex')); + + + } + + + public function encryptDecrypt($key, $string, $decrypt){ diff --git a/Application/Home/View/default/Finance/withdrawRecord.html b/Application/Home/View/default/Finance/withdrawRecord.html index 120f3428e..819bfe48a 100644 --- a/Application/Home/View/default/Finance/withdrawRecord.html +++ b/Application/Home/View/default/Finance/withdrawRecord.html @@ -172,7 +172,7 @@ 提现明细 - 汇款证明 + 汇款证明 结算单 diff --git a/Application/Media/View/default/Article/article/detail.html b/Application/Media/View/default/Article/article/detail.html index 0fe1b6835..16dd4eb5a 100644 --- a/Application/Media/View/default/Article/article/detail.html +++ b/Application/Media/View/default/Article/article/detail.html @@ -44,14 +44,14 @@
@@ -72,9 +72,9 @@