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
98075aaa
authored
Jul 16, 2019
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
合并平台和ERP订单
parent
c4544dfa
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
47 additions
and
41 deletions
app/Http/Controllers/OrderController.php
app/Http/Controllers/PermController.php
app/Http/Middleware/CheckLogin.php
app/Model/OrderModel.php
config/website.php
resources/views/no_access.blade.php
resources/views/orderlist/content.blade.php
app/Http/Controllers/OrderController.php
View file @
98075aaa
...
@@ -193,6 +193,8 @@ function getOrderSource($order_id, $order_type=1)
...
@@ -193,6 +193,8 @@ function getOrderSource($order_id, $order_type=1)
}
}
return
$source
;
return
$source
;
}
else
if
(
$order_type
==
2
)
{
return
'ERP'
;
}
else
if
(
$order_type
==
3
)
{
}
else
if
(
$order_type
==
3
)
{
return
'京东'
;
return
'京东'
;
}
else
if
(
$order_type
==
4
)
{
}
else
if
(
$order_type
==
4
)
{
...
@@ -365,7 +367,7 @@ Class OrderController extends Controller
...
@@ -365,7 +367,7 @@ Class OrderController extends Controller
public
function
orderList
(
Request
$request
)
public
function
orderList
(
Request
$request
)
{
{
$info
=
$this
->
getOrderInfo
(
$request
,
1
);
$info
=
$this
->
getOrderInfo
(
$request
,
1
);
$info
[
'title'
]
=
'
平台订单
'
;
$info
[
'title'
]
=
'
订单列表
'
;
// 若为京东自营、自营客服角色,则跳转到自营列表
// 若为京东自营、自营客服角色,则跳转到自营列表
if
(
in_array
(
$info
[
'role'
],
[
6
,
7
,
11
,
12
]))
{
if
(
in_array
(
$info
[
'role'
],
[
6
,
7
,
11
,
12
]))
{
...
@@ -416,8 +418,8 @@ Class OrderController extends Controller
...
@@ -416,8 +418,8 @@ Class OrderController extends Controller
$map
[
'check_jd_order'
]
=
1
;
// 只允许查看京东自营订单
$map
[
'check_jd_order'
]
=
1
;
// 只允许查看京东自营订单
}
}
// 非
竞
调账号显示真实数据
// 非
尽
调账号显示真实数据
if
(
$info
[
'
username'
]
!=
'vpadmin@ichunt.com'
)
{
if
(
$info
[
'
role'
]
!=
13
)
{
$map
[
'is_fake'
]
=
0
;
$map
[
'is_fake'
]
=
0
;
}
else
{
}
else
{
$map
[
'vp_time_set'
]
=
strtotime
(
Config
(
'website.vp_time_set'
));
// 竞调账号根据时间展示订单
$map
[
'vp_time_set'
]
=
strtotime
(
Config
(
'website.vp_time_set'
));
// 竞调账号根据时间展示订单
...
@@ -427,7 +429,7 @@ Class OrderController extends Controller
...
@@ -427,7 +429,7 @@ Class OrderController extends Controller
$size
=
10
;
$size
=
10
;
if
(
$tid
==
1
)
{
if
(
$tid
==
1
)
{
$map
[
'order_type_filter'
]
=
[
1
];
$map
[
'order_type_filter'
]
=
in_array
(
$info
[
'role'
],
[
1
,
13
])
?
[
1
,
2
,
3
]
:
[
1
];
// 管理员和尽调账号可以查看平台、ERP、京东订单
}
else
if
(
$tid
==
2
)
{
}
else
if
(
$tid
==
2
)
{
$size
=
20
;
$size
=
20
;
$map
[
'order_type_filter'
]
=
[
1
,
3
,
4
];
// 1.网站 3.京东 4.象牙宝
$map
[
'order_type_filter'
]
=
[
1
,
3
,
4
];
// 1.网站 3.京东 4.象牙宝
...
...
app/Http/Controllers/PermController.php
View file @
98075aaa
...
@@ -8,10 +8,26 @@
...
@@ -8,10 +8,26 @@
class
PermController
extends
Controller
class
PermController
extends
Controller
{
{
protected
$roles
=
[
'管理员'
=>
1
,
'经理'
=>
2
,
'交易员'
=>
3
,
'客服'
=>
4
,
'测试'
=>
5
,
'京东自营'
=>
6
,
'自营客服'
=>
7
,
'运营助理'
=>
8
,
'财务'
=>
9
,
'自营客服主管'
=>
10
,
'自营客服主管助理'
=>
11
,
'自营内部采购'
=>
12
,
'尽调'
=>
13
,
];
// 检查用户是否具有系统访问权限
// 检查用户是否具有系统访问权限
public
function
checkAccess
(
$request
)
public
function
checkAccess
(
$request
)
{
{
$user_id
=
$request
->
user
->
userId
;
$user_id
=
$request
->
user
->
userId
;
$role
=
$this
->
getUserRole
(
$request
);
$role
=
$this
->
getUserRole
(
$request
);
if
(
$role
==
1
)
return
true
;
// 超级管理员或系统管理员直接进入
if
(
$role
==
1
)
return
true
;
// 超级管理员或系统管理员直接进入
...
@@ -70,33 +86,7 @@
...
@@ -70,33 +86,7 @@
foreach
(
$role
as
$v
)
{
foreach
(
$role
as
$v
)
{
$department
=
DB
::
table
(
't_role_perm'
)
->
where
([
'roleId'
=>
$v
,
'bid'
=>
$bid
])
->
first
();
$department
=
DB
::
table
(
't_role_perm'
)
->
where
([
'roleId'
=>
$v
,
'bid'
=>
$bid
])
->
first
();
if
(
$department
->
name
==
'管理员'
)
{
return
in_array
(
$department
->
name
,
array_keys
(
$this
->
roles
))
?
array_get
(
$this
->
roles
,
$department
->
name
)
:
0
;
return
1
;
}
else
if
(
$department
->
name
==
'经理'
)
{
return
2
;
}
else
if
(
$department
->
name
==
'交易员'
)
{
return
3
;
}
else
if
(
$department
->
name
==
'客服'
)
{
return
4
;
}
else
if
(
$department
->
name
==
'测试'
)
{
return
5
;
}
else
if
(
$department
->
name
==
'京东自营'
)
{
return
6
;
}
else
if
(
$department
->
name
==
'自营客服'
)
{
return
7
;
}
else
if
(
$department
->
name
==
'运营助理'
)
{
return
8
;
}
else
if
(
$department
->
name
==
'财务'
)
{
return
9
;
}
else
if
(
$department
->
name
==
'自营客服主管'
)
{
return
10
;
}
else
if
(
$department
->
name
==
'自营客服主管助理'
)
{
return
11
;
}
else
if
(
$department
->
name
==
'自营内部采购'
)
{
return
12
;
}
else
{
return
0
;
}
}
}
}
}
}
}
...
...
app/Http/Middleware/CheckLogin.php
View file @
98075aaa
...
@@ -68,6 +68,7 @@ class CheckLogin
...
@@ -68,6 +68,7 @@ class CheckLogin
$perm
=
new
PermController
;
$perm
=
new
PermController
;
$access
=
$perm
->
checkAccess
(
$request
);
$access
=
$perm
->
checkAccess
(
$request
);
$business
=
$perm
->
getBusinessInfo
();
$business
=
$perm
->
getBusinessInfo
();
if
(
!
$access
)
{
if
(
!
$access
)
{
...
...
app/Model/OrderModel.php
View file @
98075aaa
...
@@ -51,13 +51,19 @@ class OrderModel extends Model
...
@@ -51,13 +51,19 @@ class OrderModel extends Model
}
}
/* 临时添加 所有人只能查看线上订单 */
/* 临时添加 所有人只能查看线上订单 */
$map
[
'online_order'
]
=
1
;
//
$map['online_order'] = 1;
// 非竞调账号,则查看真实数据
// 非竞调账号,则查看真实数据
if
(
$info
[
'
username'
]
!=
'vpadmin@ichunt.com'
)
{
if
(
$info
[
'
role'
]
!=
13
)
{
$map
[
'is_fake'
]
=
0
;
$map
[
'is_fake'
]
=
0
;
}
}
if
(
$map
[
'order_goods_type'
]
==
1
)
{
$map
[
'order_type_filter'
]
=
in_array
(
$info
[
'role'
],
[
1
,
13
])
?
[
1
,
2
,
3
]
:
[
1
];
// 管理员和尽调账号可以查看平台、ERP、京东订单
}
else
{
$map
[
'order_type_filter'
]
=
[
1
,
3
,
4
];
// 1.网站 3.京东 4.象牙宝
}
$list
=
$this
->
from
(
'lie_order_items as it'
)
$list
=
$this
->
from
(
'lie_order_items as it'
)
->
leftJoin
(
'lie_order as o'
,
'it.order_id'
,
'='
,
'o.order_id'
)
->
leftJoin
(
'lie_order as o'
,
'it.order_id'
,
'='
,
'o.order_id'
)
->
leftJoin
(
'lie_pay_log as p'
,
'it.order_id'
,
'='
,
'p.order_id'
)
->
leftJoin
(
'lie_pay_log as p'
,
'it.order_id'
,
'='
,
'p.order_id'
)
...
@@ -149,6 +155,9 @@ class OrderModel extends Model
...
@@ -149,6 +155,9 @@ class OrderModel extends Model
case
'4'
:
case
'4'
:
$string
.=
"o.order_type = 3 OR "
;
$string
.=
"o.order_type = 3 OR "
;
break
;
break
;
case
'5'
:
$string
.=
"o.order_type = 2 OR "
;
break
;
}
}
}
}
...
@@ -175,11 +184,9 @@ class OrderModel extends Model
...
@@ -175,11 +184,9 @@ class OrderModel extends Model
}
}
})
})
->
where
(
function
(
$query
)
use
(
$map
)
{
->
where
(
function
(
$query
)
use
(
$map
)
{
if
(
$map
[
'order_goods_type'
]
==
2
)
{
// 自营获取线上、京东、象牙宝订单
if
(
$map
[
'order_type_filter'
])
{
// 自营获取线上、京东、象牙宝订单
$query
->
whereIn
(
'o.order_type'
,
[
1
,
3
,
4
]);
$query
->
whereIn
(
'o.order_type'
,
$map
[
'order_type_filter'
]);
}
else
if
(
isset
(
$map
[
'online_order'
]))
{
// 线上订单
}
$query
->
where
(
'o.order_type'
,
'='
,
$map
[
'online_order'
]);
}
})
})
->
where
(
function
(
$query
)
use
(
$map
)
{
->
where
(
function
(
$query
)
use
(
$map
)
{
// 同步状态
// 同步状态
...
@@ -442,6 +449,8 @@ class OrderModel extends Model
...
@@ -442,6 +449,8 @@ class OrderModel extends Model
}
}
return
$source
;
return
$source
;
}
else
if
(
$order_type
==
2
)
{
return
'ERP'
;
}
else
if
(
$order_type
==
3
)
{
}
else
if
(
$order_type
==
3
)
{
return
'京东'
;
return
'京东'
;
}
else
if
(
$order_type
==
4
)
{
}
else
if
(
$order_type
==
4
)
{
...
...
config/website.php
View file @
98075aaa
...
@@ -16,6 +16,8 @@ return [
...
@@ -16,6 +16,8 @@ return [
'order_url'
=>
'http://order.liexin.net'
,
'order_url'
=>
'http://order.liexin.net'
,
// API项目
// API项目
'api_domain'
=>
'http://api.liexin.com/'
,
'api_domain'
=>
'http://api.liexin.com/'
,
// 权限系统
'perm_url'
=>
'http://perm.liexin.net'
,
// 获取用户权限接口
// 获取用户权限接口
'perm_api'
=>
'http://perm.liexin.net/api/perms/'
,
'perm_api'
=>
'http://perm.liexin.net/api/perms/'
,
// 获取用户许可权限接口
// 获取用户许可权限接口
...
...
resources/views/no_access.blade.php
View file @
98075aaa
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
<h2
class=
"font-bold"
>
禁止访问
</h2>
<h2
class=
"font-bold"
>
禁止访问
</h2>
<div
class=
"error-desc"
>
<div
class=
"error-desc"
>
暂时没有系统访问权限,请到权限系统申请该系统访问权限......
<br/>
暂时没有系统访问权限,请到权限系统申请该系统访问权限......
<br/>
<a
href=
"
http://perm.ichunt.net
/business/{{$bid}}/request"
style=
"font-size: 18px;"
><i
class=
"fa fa-mail-reply"
></i>
申请
</a>
<a
href=
"
{{ Config('website.perm_url') }}
/business/{{$bid}}/request"
style=
"font-size: 18px;"
><i
class=
"fa fa-mail-reply"
></i>
申请
</a>
</div>
</div>
</div>
</div>
</body>
</body>
...
...
resources/views/orderlist/content.blade.php
View file @
98075aaa
...
@@ -129,6 +129,8 @@
...
@@ -129,6 +129,8 @@
<option
value=
"1"
>
PC端
</option>
<option
value=
"1"
>
PC端
</option>
<option
value=
"2"
>
移动端
</option>
<option
value=
"2"
>
移动端
</option>
<option
value=
"3"
>
后台
</option>
<option
value=
"3"
>
后台
</option>
<option
value=
"4"
>
京东
</option>
<option
value=
"5"
>
ERP
</option>
<option
value=
"6"
>
小程序
</option>
<option
value=
"6"
>
小程序
</option>
</select>
</select>
</dd>
</dd>
...
@@ -278,7 +280,7 @@
...
@@ -278,7 +280,7 @@
<td
class=
"show-list"
>
<?php
print_r
(
App\Http\Controllers\getSalesName
(
$v
[
'sale_id'
]));
?>
</td>
<td
class=
"show-list"
>
<?php
print_r
(
App\Http\Controllers\getSalesName
(
$v
[
'sale_id'
]));
?>
</td>
@if ($username != 'vpadmin@ichunt.com')
@if ($username != 'vpadmin@ichunt.com')
<td
class=
"show-list"
>
<?php
echo
App\Http\Controllers\getOrderSource
(
$v
[
'order_id'
]);
?>
</td>
<td
class=
"show-list"
>
<?php
echo
App\Http\Controllers\getOrderSource
(
$v
[
'order_id'
]
,
$v
[
'order_type'
]
);
?>
</td>
<td
class=
"show-list"
>
<td
class=
"show-list"
>
<?php
<?php
...
...
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