Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
朱继来
/
后台订单管理
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9b9e843d
authored
May 21, 2018
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
添加操作记录
parent
b6df2819
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
154 additions
and
38 deletions
app/Http/Controllers/OrderController.php
app/Http/Function.php
app/Http/routes.php
public/js/order.js
resources/views/detail/content.blade.php
resources/views/orderlist/content.blade.php
app/Http/Controllers/OrderController.php
View file @
9b9e843d
This diff is collapsed.
Click to expand it.
app/Http/Function.php
View file @
9b9e843d
...
@@ -146,3 +146,40 @@
...
@@ -146,3 +146,40 @@
return
$token
;
return
$token
;
}
}
/**
* 获取客户端IP地址
* @param integer $type 返回类型 0 返回IP地址 1 返回IPV4地址数字
* @param boolean $adv 是否进行高级模式获取(有可能被伪装)
* @return mixed
*/
function
get_client_ip
(
$type
=
0
,
$adv
=
false
)
{
$type
=
$type
?
1
:
0
;
static
$ip
=
null
;
if
(
null
!==
$ip
)
{
return
$ip
[
$type
];
}
if
(
$adv
)
{
if
(
isset
(
$_SERVER
[
'HTTP_X_FORWARDED_FOR'
]))
{
$arr
=
explode
(
','
,
$_SERVER
[
'HTTP_X_FORWARDED_FOR'
]);
$pos
=
array_search
(
'unknown'
,
$arr
);
if
(
false
!==
$pos
)
{
unset
(
$arr
[
$pos
]);
}
$ip
=
trim
(
$arr
[
0
]);
}
elseif
(
isset
(
$_SERVER
[
'HTTP_CLIENT_IP'
]))
{
$ip
=
$_SERVER
[
'HTTP_CLIENT_IP'
];
}
elseif
(
isset
(
$_SERVER
[
'REMOTE_ADDR'
]))
{
$ip
=
$_SERVER
[
'REMOTE_ADDR'
];
}
}
elseif
(
isset
(
$_SERVER
[
'REMOTE_ADDR'
]))
{
$ip
=
$_SERVER
[
'REMOTE_ADDR'
];
}
// IP地址合法验证
$long
=
sprintf
(
"%u"
,
ip2long
(
$ip
));
$ip
=
$long
?
array
(
$ip
,
$long
)
:
array
(
'0.0.0.0'
,
0
);
return
$ip
[
$type
];
}
app/Http/routes.php
View file @
9b9e843d
...
@@ -72,6 +72,8 @@ Route::group(['middleware' => 'web'], function () {
...
@@ -72,6 +72,8 @@ Route::group(['middleware' => 'web'], function () {
Route
::
match
([
'get'
,
'post'
],
'/express_set'
,
'OrderController@expressSet'
);
Route
::
match
([
'get'
,
'post'
],
'/express_set'
,
'OrderController@expressSet'
);
Route
::
post
(
'/ajaxDownloadContract'
,
'OrderController@ajaxDownloadContract'
);
});
});
// 不需要登陆态
// 不需要登陆态
...
...
public/js/order.js
View file @
9b9e843d
...
@@ -145,6 +145,29 @@
...
@@ -145,6 +145,29 @@
}
}
})
})
// 下载合同
$
(
'.download-contract'
).
click
(
function
(){
var
order_id
=
$
(
this
).
data
(
'id'
);
$
.
ajax
({
url
:
'/ajaxDownloadContract'
,
type
:
'post'
,
data
:
{
order_id
:
order_id
},
dataType
:
'json'
,
success
:
function
(
resp
)
{
if
(
resp
.
errcode
!=
0
)
{
layer
.
msg
(
resp
.
msg
);
return
false
;
}
location
.
href
=
resp
.
data
;
},
error
:
function
(
err
)
{
console
.
log
(
err
)
}
})
})
// 切换类型时,清空输入框内容
// 切换类型时,清空输入框内容
$
(
'.dropdown-menu>li'
).
click
(
function
(){
$
(
'.dropdown-menu>li'
).
click
(
function
(){
var
val
=
$
(
this
).
data
(
'val'
);
// 当前值
var
val
=
$
(
this
).
data
(
'val'
);
// 当前值
...
...
resources/views/detail/content.blade.php
View file @
9b9e843d
...
@@ -558,7 +558,7 @@
...
@@ -558,7 +558,7 @@
@endif
@endif
<!-- 二期处理 -->
<!-- 二期处理 -->
<
!-- <
p>操作记录</p>
<p>
操作记录
</p>
<div
class=
"tabs-box"
>
<div
class=
"tabs-box"
>
<table
class=
"table table-bordered table-hover log"
>
<table
class=
"table table-bordered table-hover log"
>
<thead>
<thead>
...
@@ -569,21 +569,20 @@
...
@@ -569,21 +569,20 @@
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
<php>$logs = json_decode($detail['operate_log'], true)</php>
@if (!empty($actionLog))
<empty name="logs">
@foreach ($actionLog as $v)
<tr><td colspan="20">没有操作记录</td></tr>
<tr>
<else/>
<td>
{{date('Y-m-d H:i:s', $v->create_time)}}
</td>
<foreach name="logs" item="v">
<td>
{{App\Http\Controllers\getOperatorName($v->operator_id, $v->operator_type)}}
</td>
<tr>
<td>
{{$v->event}}
</td>
<td><p class="time">{$v.time|date="Y-m-d H:i:s", ###}</p></td>
</tr>
<td><p class="uname">{$v.user}</p></td>
@endforeach
<td><p class="log">{$v.extra}</p></td>
@else
</tr>
<tr><td
colspan=
"3"
>
无操作记录
</td></tr>
</foreach>
@endif
</empty>
</tbody>
</tbody>
</table>
</table>
</div>
-->
</div>
</div>
</div>
<script>
<script>
...
...
resources/views/orderlist/content.blade.php
View file @
9b9e843d
...
@@ -278,14 +278,11 @@
...
@@ -278,14 +278,11 @@
@endif
@endif
<?php
<?php
$apiUrl
=
Config
(
'website.api_domain'
);
$k1
=
time
();
$k2
=
md5
(
md5
(
$k1
)
.
'fh6y5t4rr351d2c3bryi'
);
$downLoadUrl
=
$apiUrl
.
'contract/pdfinfo?id='
.
$v
[
'order_id'
]
.
'&k1='
.
$k1
.
'&k2='
.
$k2
;
?>
?>
@if (in_array('download_contract', $userPerms))
@if (in_array('download_contract', $userPerms))
<a
class=
"btn btn-info
"
href=
"{{$downLoadUrl}}
"
>
下载合同
</a>
<a
class=
"btn btn-info
download-contract"
data-id=
"{{$v['order_id']}}"
href=
"javascript:;
"
>
下载合同
</a>
@endif
@endif
</div>
</div>
</td>
</td>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment