审核附件
This commit is contained in:
@@ -5,6 +5,7 @@ use app\common\controller\BaseController;
|
||||
use app\common\model\Corp;
|
||||
use app\common\model\InvItem;
|
||||
use app\common\model\InvRequisitionApprove;
|
||||
use app\common\model\InvRequisitionApproveAttachment;
|
||||
use app\common\model\InvRequisitionAttachment;
|
||||
use app\common\model\InvRequisitionItem;
|
||||
use app\common\service\OssService;
|
||||
@@ -117,8 +118,17 @@ class InvRequisitionController extends BaseController
|
||||
*/
|
||||
protected function showFormat($data)
|
||||
{
|
||||
$oss = new OssService();
|
||||
if (isset($data['id'])){
|
||||
$data['approve'] = InvRequisitionApprove::where('requisition_id', $data['id'])->get()->toArray();
|
||||
foreach ($data['approve'] as $key => $item){
|
||||
$attachment = InvRequisitionApproveAttachment::where('approve_id', $item['id'])->get();
|
||||
foreach ($attachment as $k => $v){
|
||||
$attachment[$k] = $v->toArray();
|
||||
$attachment[$k]['file_path_pull'] = $oss->generatePrivateUrl($v['file_path']);
|
||||
}
|
||||
$data['approve'][$key]['attachment'] = $attachment;
|
||||
}
|
||||
$approve_id = !empty($data['approve'])?array_pop($data['approve'])['id']:null;
|
||||
$data['approve_id'] = $approve_id;
|
||||
}
|
||||
@@ -129,7 +139,6 @@ class InvRequisitionController extends BaseController
|
||||
if (isset($data['id'])){
|
||||
$data['item'] = InvRequisitionItem::where('requisition_id', $data['id'])->get();
|
||||
$data['attachment'] = InvRequisitionAttachment::where('requisition_id', $data['id'])->get();
|
||||
$oss = new OssService();
|
||||
foreach ($data['attachment'] as $key => $value) {
|
||||
$data['attachment'][$key]['file_path_pull'] = $oss->generatePrivateUrl($value['file_path']);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user