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
ebba17c0
authored
May 24, 2018
by
朱继来
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'zjl_action_log_20180521'
parents
e3194631
2b782186
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
79 additions
and
31 deletions
app/Http/Controllers/OrderController.php
app/Http/Function.php
app/Http/routes.php
public/js/order.js
public/js/self_order.js
resources/views/detail/changeOrder.blade.php
resources/views/detail/content.blade.php
resources/views/orderlist/content.blade.php
resources/views/selfOrder/content.blade.php
app/Http/Controllers/OrderController.php
View file @
ebba17c0
This diff is collapsed.
Click to expand it.
app/Http/Function.php
View file @
ebba17c0
...
@@ -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 @
ebba17c0
...
@@ -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 @
ebba17c0
...
@@ -149,6 +149,29 @@
...
@@ -149,6 +149,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'
);
// 当前值
...
@@ -1049,16 +1072,20 @@
...
@@ -1049,16 +1072,20 @@
// 设置默认值false
// 设置默认值false
$
(
'input[name=check_failed]'
).
val
(
0
);
$
(
'input[name=check_failed]'
).
val
(
0
);
var
check_failed_info
=
''
;
// 检查商品单价
// 检查商品单价
$
(
'.order-change-table'
).
find
(
'tbody tr'
).
each
(
function
(){
$
(
'.order-change-table'
).
find
(
'tbody tr'
).
each
(
function
(){
var
origin_price
=
parseFloat
(
$
(
this
).
find
(
'.price'
).
data
(
'origin'
));
var
origin_price
=
parseFloat
(
$
(
this
).
find
(
'.price'
).
data
(
'origin'
));
var
price
=
parseFloat
(
$
(
this
).
find
(
'.price'
).
val
())
||
0
;
var
price
=
parseFloat
(
$
(
this
).
find
(
'.price'
).
val
())
||
0
;
var
goods_name
=
$
(
this
).
children
(
'td'
).
eq
(
0
).
children
(
'p'
).
html
();
origin_price
=
(
origin_price
*
0.8
).
toFixed
(
4
);
limit_price
=
(
origin_price
*
0.8
).
toFixed
(
4
);
// 若商品单价降价幅度小于或等于20%则赋值
// 若商品单价降价幅度小于或等于20%则赋值
if
(
price
<=
origin_price
)
{
if
(
price
<=
limit_price
)
{
check_failed_info
+=
'型号:'
+
goods_name
+
',单价:'
+
origin_price
+
' -> '
+
price
+
' | '
;
$
(
'input[name=check_failed]'
).
val
(
1
);
$
(
'input[name=check_failed]'
).
val
(
1
);
$
(
'input[name=check_failed_info]'
).
val
(
check_failed_info
);
}
}
});
});
}
}
...
...
public/js/self_order.js
View file @
ebba17c0
...
@@ -18,7 +18,6 @@
...
@@ -18,7 +18,6 @@
order_invoice_status
=
$
(
'#order_invoice_status'
).
data
(
'default'
),
order_invoice_status
=
$
(
'#order_invoice_status'
).
data
(
'default'
),
order_source_adtag
=
$
(
'input[name="order_source_adtag"]'
).
val
(),
order_source_adtag
=
$
(
'input[name="order_source_adtag"]'
).
val
(),
test_order
=
$
(
'input[name=test_order]'
),
test_order
=
$
(
'input[name=test_order]'
),
erp_order_id
=
$
(
'#erp_order_id'
).
data
(
'default'
),
listUrl
=
'/self_order'
;
listUrl
=
'/self_order'
;
listUrl
+=
'?order_type='
+
order_type
;
listUrl
+=
'?order_type='
+
order_type
;
...
@@ -63,15 +62,11 @@
...
@@ -63,15 +62,11 @@
listUrl
+=
'&order_source_adtag='
+
order_source_adtag
;
listUrl
+=
'&order_source_adtag='
+
order_source_adtag
;
}
}
if
(
erp_order_id
)
{
listUrl
+=
'&erp_order_id='
+
erp_order_id
;
}
if
(
test_order
.
is
(
':checked'
))
{
if
(
test_order
.
is
(
':checked'
))
{
listUrl
+=
'&test_order='
+
1
;
listUrl
+=
'&test_order='
+
1
;
}
}
if
(
!
order_contain
&&
!
time_start
&&
!
time_end
&&
!
order_payment_mode
&&
!
order_status
&&
!
order_invoice_status
&&
!
order_send
&&
!
order_source_pf
&&
!
order_source_adtag
&&
!
erp_order_id
&&
!
test_order
.
is
(
':checked'
))
{
if
(
!
order_contain
&&
!
time_start
&&
!
time_end
&&
!
order_payment_mode
&&
!
order_status
&&
!
order_invoice_status
&&
!
order_send
&&
!
order_source_pf
&&
!
order_source_adtag
&&
!
test_order
.
is
(
':checked'
))
{
listUrl
=
'/self_order'
;
listUrl
=
'/self_order'
;
}
}
...
@@ -90,16 +85,15 @@
...
@@ -90,16 +85,15 @@
order_payment_mode
=
$
(
'#order_payment_mode'
).
data
(
'default'
),
order_payment_mode
=
$
(
'#order_payment_mode'
).
data
(
'default'
),
order_invoice_status
=
$
(
'#order_invoice_status'
).
data
(
'default'
),
order_invoice_status
=
$
(
'#order_invoice_status'
).
data
(
'default'
),
order_source_adtag
=
$
(
'input[name="order_source_adtag"]'
).
val
(),
order_source_adtag
=
$
(
'input[name="order_source_adtag"]'
).
val
(),
test_order
=
$
(
'input[name=test_order]'
),
test_order
=
$
(
'input[name=test_order]'
);
erp_order_id
=
$
(
'#erp_order_id'
).
data
(
'default'
);
if
(
test_order
.
length
)
{
if
(
test_order
.
length
)
{
if
(
!
order_contain
&&
!
time_start
&&
!
time_end
&&
!
order_payment_mode
&&
!
order_status
&&
!
order_invoice_status
&&
!
order_send
&&
!
order_source_pf
&&
!
order_source_adtag
&&
!
erp_order_id
&&
!
test_order
.
is
(
':checked'
))
{
if
(
!
order_contain
&&
!
time_start
&&
!
time_end
&&
!
order_payment_mode
&&
!
order_status
&&
!
order_invoice_status
&&
!
order_send
&&
!
order_source_pf
&&
!
order_source_adtag
&&
!
test_order
.
is
(
':checked'
))
{
layer
.
msg
(
'请选择筛选条件,再导出!'
);
layer
.
msg
(
'请选择筛选条件,再导出!'
);
return
false
;
return
false
;
}
}
}
else
{
}
else
{
if
(
!
order_contain
&&
!
time_start
&&
!
time_end
&&
!
order_payment_mode
&&
!
order_status
&&
!
order_invoice_status
&&
!
order_send
&&
!
order_source_pf
&&
!
order_source_adtag
&&
!
erp_order_id
)
{
if
(
!
order_contain
&&
!
time_start
&&
!
time_end
&&
!
order_payment_mode
&&
!
order_status
&&
!
order_invoice_status
&&
!
order_send
&&
!
order_source_pf
&&
!
order_source_adtag
)
{
layer
.
msg
(
'请选择筛选条件,再导出!'
);
layer
.
msg
(
'请选择筛选条件,再导出!'
);
return
false
;
return
false
;
}
}
...
@@ -119,7 +113,7 @@
...
@@ -119,7 +113,7 @@
test_order
=
''
;
test_order
=
''
;
}
}
location
.
href
=
'/export?order_type='
+
order_type
+
'&order_contain='
+
order_contain
+
'&time_start='
+
time_start
+
'&time_end='
+
time_end
+
'&order_payment_mode='
+
order_payment_mode
+
'&order_status='
+
order_status
+
'&order_invoice_status='
+
order_invoice_status
+
'&order_send='
+
order_send
+
'&order_source_pf='
+
order_source_pf
+
'&order_source_adtag='
+
order_source_adtag
+
'&
erp_order_id='
+
erp_order_id
+
'&
test_order='
+
test_order
+
'&order_goods_type='
+
2
;
location
.
href
=
'/export?order_type='
+
order_type
+
'&order_contain='
+
order_contain
+
'&time_start='
+
time_start
+
'&time_end='
+
time_end
+
'&order_payment_mode='
+
order_payment_mode
+
'&order_status='
+
order_status
+
'&order_invoice_status='
+
order_invoice_status
+
'&order_send='
+
order_send
+
'&order_source_pf='
+
order_source_pf
+
'&order_source_adtag='
+
order_source_adtag
+
'&test_order='
+
test_order
+
'&order_goods_type='
+
2
;
})
})
// 选择查看测试订单
// 选择查看测试订单
...
...
resources/views/detail/changeOrder.blade.php
View file @
ebba17c0
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
<input
type=
"hidden"
name=
"cancel_reason"
value=
"{{isset($order_info['cancle_reason']) ? $order_info['cancle_reason'] : ''}}"
>
<input
type=
"hidden"
name=
"cancel_reason"
value=
"{{isset($order_info['cancle_reason']) ? $order_info['cancle_reason'] : ''}}"
>
<input
type=
"hidden"
name=
"user_mobile"
value=
"{{$user_mobile}}"
>
<input
type=
"hidden"
name=
"user_mobile"
value=
"{{$user_mobile}}"
>
<input
type=
"hidden"
name=
"check_failed"
value=
""
>
<input
type=
"hidden"
name=
"check_failed"
value=
""
>
<input
type=
"hidden"
name=
"check_failed_info"
value=
""
>
<!-- 审核 -->
<!-- 审核 -->
<p>
审核
</p>
<p>
审核
</p>
...
...
resources/views/detail/content.blade.php
View file @
ebba17c0
This diff is collapsed.
Click to expand it.
resources/views/orderlist/content.blade.php
View file @
ebba17c0
...
@@ -259,7 +259,7 @@
...
@@ -259,7 +259,7 @@
if
(
in_array
(
$v
[
'status'
],
[
-
1
,
1
,
2
]))
{
if
(
in_array
(
$v
[
'status'
],
[
-
1
,
1
,
2
]))
{
echo
'不需同步'
;
echo
'不需同步'
;
}
else
{
}
else
{
echo
$v
[
'erp_order_id'
]
!=
''
||
$v
[
'erp_order_id'
]
!=
'-'
?
'<span class="list-text-success"><b>已同步</b></span>'
:
'<span class="list-text-checking"><b>未同步</b></span>'
;
echo
$v
[
'erp_order_id'
]
!=
''
&&
$v
[
'erp_order_id'
]
!=
'-'
?
'<span class="list-text-success"><b>已同步</b></span>'
:
'<span class="list-text-checking"><b>未同步</b></span>'
;
}
}
?>
?>
</td>
</td>
...
@@ -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>
...
...
resources/views/selfOrder/content.blade.php
View file @
ebba17c0
...
@@ -104,17 +104,7 @@
...
@@ -104,17 +104,7 @@
<input
type=
"text"
name=
"order_source_adtag"
value=
"{{$condition['order_source_adtag']}}"
placeholder=
"请输入内容"
>
<input
type=
"text"
name=
"order_source_adtag"
value=
"{{$condition['order_source_adtag']}}"
placeholder=
"请输入内容"
>
</dd>
</dd>
</dl>
</dl>
<dl>
<dt>
同步状态:
</dt>
<dd>
<div
class=
"droplist"
data-default=
"{{$condition['erp_order_id']}}"
id=
"erp_order_id"
name=
"erp_order_id"
>
<ul
class=
"dropdown-menu"
>
<li
data-val=
""
class=
"active"
>
全部
</li>
<li
data-val=
"1"
>
已同步
</li>
</ul>
</div>
</dd>
</dl>
@if (in_array('self_check_test_order', $userPerms))
@if (in_array('self_check_test_order', $userPerms))
<dl>
<dl>
<dt></dt>
<dt></dt>
...
...
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