SupplierAttachmentController.php
2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
namespace App\Http\Controllers;
use App\Http\Services\RoleService;
use App\Http\Services\SupplierContactService;
use App\Http\Services\SupplierService;
use App\Http\Services\SupplierStatisticsService;
use App\Http\Services\ViewCheckService;
use App\Model\IntracodeModel;
use App\Model\SupplierAttachmentsModel;
use App\Model\SupplierChannelModel;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class SupplierAttachmentController extends Controller
{
public function info(Request $request, $id = '')
{
{
if ($request->path() == '/') {
$path = 'web/index';
} else {
$path = $request->path();
}
$this->data = [
'menus' => $request->menus,
'header' => $request->user->header,
'username' => $request->user->email,
'user_email' => $request->user->email,
'uri' => '/' . $path,
'id' => $id,
];
return $this->$id($request);
}
}
public function __call($name, $arr)
{
$data['errinfo'] = '访问路径错误';
return view('errors.error', $data);
}
//供应商详情
public function AddSupplierAttachment($request)
{
$this->data['title'] = '添加附件';
return $this->view('添加附件');
}
//供应商详情
public function UpdateSupplierAttachment($request)
{
$attachmentId = $request->get('attachment_id');
if (!empty($attachmentId)) {
$model = new SupplierAttachmentsModel();
$attachment = $model->where('attachment_id', $attachmentId)->first()->toArray();
$attachment['validity_period'] = $attachment['validity_start'] ? date('Y-m-d',
$attachment['validity_start']) . '~' . date('Y-m-d', $attachment['validity_start']) : '';
$this->data['attachment'] = $attachment;
}
$this->data['title'] = '修改附件';
$this->data['view'] = 'AddSupplierAttachment';
return $this->view('修改附件');
}
}