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
a95946d4
authored
Nov 08, 2019
by
朱继来
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'master' of
http://119.23.72.7/zhujilai/Order
into zjl_form_duplicate_submit_20191031
parents
088d588f
ea2a2ef7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
22 deletions
app/Http/Controllers/CronController.php
app/Http/Controllers/OrderController.php
app/Model/OrderModel.php
app/Http/Controllers/CronController.php
View file @
a95946d4
...
...
@@ -250,19 +250,19 @@ class CronController extends Controller
/**
* 推送新用户活动短信
*
* 条件:前
一
天注册,未下单的用户或下单未支付一笔订单的用户
* 条件:前
15
天注册,未下单的用户或下单未支付一笔订单的用户
*
* 推送时间:每天上午10点 (0 10 * * * /usr/bin/curl http://order.ichunt.net/act/sendactmsg)
*/
public
function
sendActMsg
()
{
$start_time
=
strtotime
(
date
(
'Y-m-d'
,
strtotime
(
'-1
day'
)));
// 前一
天0点
$start_time
=
strtotime
(
date
(
'Y-m-d'
,
strtotime
(
'-1
5 day'
)));
// 前15
天0点
$last_time
=
strtotime
(
date
(
'Y-m-d'
))
-
1
;
// 前一天23:59:59
$UserMainModel
=
new
UserMainModel
;
$OrderModel
=
new
OrderModel
;
// 获取前
一天新
注册用户
// 获取前
15天
注册用户
$user
=
$UserMainModel
->
where
(
'is_type'
,
0
)
->
where
(
'is_test'
,
0
)
->
whereBetween
(
'create_time'
,
[
$start_time
,
$last_time
])
...
...
app/Http/Controllers/OrderController.php
View file @
a95946d4
...
...
@@ -430,17 +430,30 @@ Class OrderController extends Controller
if
(
strpos
(
$info
[
'role'
],
','
)
!==
false
)
{
// 多角色情况下
$res
=
$perm
->
checkUserRoles
(
$request
,
$info
[
'role'
]);
if
(
$res
)
{
$info
[
'role'
]
=
$res
[
'role_id'
];
$res
[
'sale_id'
]
&&
$map
[
'sale_id'
]
=
$res
[
'sale_id'
];
$info
[
'role'
]
=
$res
[
'role_id'
];
// 若无指定客服,则返回客服组里的所有订单
if
(
!
$map
[
'order_send'
])
{
$map
[
'sale_id'
]
=
$res
[
'sale_id'
];
}
else
if
(
!
in_array
(
$map
[
'order_send'
],
$res
[
'sale_id'
]))
{
// 若指定客服不存在与客服组,则不能筛选
$map
[
'sale_id'
]
=
-
1
;
}
else
{
$map
[
'sale_id'
]
=
$map
[
'order_send'
];
}
}
else
{
if
(
in_array
(
$info
[
'role'
],
Config
(
'perm_args.kefu_order'
)))
{
// 交易员、联营客服(线销一组、二组、三组客服)、自营客服、自营内部采购
$map
[
'sale_id'
]
=
$request
->
user
->
userId
;
// 筛选自己的订单
}
else
if
(
in_array
(
$info
[
'role'
],
Config
(
'perm_args.manager_order'
)))
{
// 线销一组、二组、三组主管(查看自己及其下组员的订单)
$map
[
'sale_id'
]
=
$perm
->
getGroupSalesId
(
$request
,
$info
[
'role'
]);
}
else
if
(
in_array
(
$info
[
'role'
],
Config
(
'perm_args.kefu_order'
)))
{
// 交易员、联营客服(线销一组、二组、三组客服)、自营客服、自营内部采购
$map
[
'sale_id'
]
=
$request
->
user
->
userId
;
// 筛选自己的订单
}
else
if
(
in_array
(
$info
[
'role'
],
Config
(
'perm_args.manager_order'
)))
{
// 线销一组、二组、三组主管(查看自己及其下组员的订单)
$sale_ids
=
$perm
->
getGroupSalesId
(
$request
,
$info
[
'role'
]);
// 若无指定客服,则返回客服组里的所有订单
if
(
!
$map
[
'order_send'
])
{
$map
[
'sale_id'
]
=
$sale_ids
;
}
else
if
(
!
in_array
(
$map
[
'order_send'
],
$sale_ids
))
{
// 若指定客服不存在与客服组,则不能筛选
$map
[
'sale_id'
]
=
-
1
;
}
else
{
$map
[
'sale_id'
]
=
$map
[
'order_send'
];
}
}
}
// 自营客服权限
if
(
$tid
==
2
&&
$info
[
'role'
]
==
6
)
{
...
...
app/Model/OrderModel.php
View file @
a95946d4
...
...
@@ -29,6 +29,9 @@ class OrderModel extends Model
if
(
$request
->
isMethod
(
'get'
))
{
$map
[
'order_type'
]
=
$request
->
input
(
'order_type'
,
''
);
$map
[
'order_contain'
]
=
$request
->
input
(
'order_contain'
,
''
);
$map
[
'order_sn'
]
=
$request
->
input
(
'order_sn'
,
''
);
$map
[
'erp_sn'
]
=
$request
->
input
(
'erp_sn'
,
''
);
$map
[
'goods_name'
]
=
$request
->
input
(
'goods_name'
,
''
);
$map
[
'time_start'
]
=
$request
->
input
(
'time_start'
,
''
);
$map
[
'time_end'
]
=
$request
->
input
(
'time_end'
,
''
);
$map
[
'order_status'
]
=
$request
->
input
(
'order_status'
,
''
);
...
...
@@ -80,24 +83,38 @@ class OrderModel extends Model
->
where
(
function
(
$query
)
use
(
$map
)
{
// 查询类型
if
(
!
empty
(
$map
[
'order_contain'
]))
{
if
(
$map
[
'order_type'
]
==
1
)
{
// 会员账号
if
(
$map
[
'order_type'
]
==
3
)
{
// 发票抬头
$query
->
where
(
'i.tax_title'
,
'='
,
$map
[
'order_contain'
]);
}
else
if
(
$map
[
'order_type'
]
==
4
)
{
// 会员ID
$query
->
where
(
'o.user_id'
,
'='
,
$map
[
'order_contain'
]);
}
else
{
// 会员账号
if
(
preg_match
(
'/@/'
,
$map
[
'order_contain'
]))
{
$query
->
where
(
'u.email'
,
'='
,
$map
[
'order_contain'
]);
}
else
{
$query
->
where
(
'u.mobile'
,
'='
,
$map
[
'order_contain'
]);
}
}
else
if
(
$map
[
'order_type'
]
==
2
)
{
// 型号名称
$query
->
where
(
'it.goods_name'
,
'='
,
$map
[
'order_contain'
]);
}
else
if
(
$map
[
'order_type'
]
==
3
)
{
// 发票抬头
$query
->
where
(
'i.tax_title'
,
'='
,
$map
[
'order_contain'
]);
}
else
if
(
$map
[
'order_type'
]
==
4
)
{
$query
->
where
(
'o.user_id'
,
'='
,
$map
[
'order_contain'
]);
}
else
{
// 订单编号
$query
->
where
(
'o.order_sn'
,
'='
,
$map
[
'order_contain'
]);
}
}
}
})
->
where
(
function
(
$query
)
use
(
$map
)
{
// 订单编号
if
(
!
empty
(
$map
[
'order_sn'
]))
{
$query
->
where
(
'o.order_sn'
,
'='
,
$map
[
'order_sn'
]);
}
})
->
where
(
function
(
$query
)
use
(
$map
)
{
// ERP订单编号
if
(
!
empty
(
$map
[
'erp_sn'
]))
{
$query
->
where
(
'oe.erp_sn'
,
'='
,
$map
[
'erp_sn'
]);
}
})
->
where
(
function
(
$query
)
use
(
$map
)
{
// 型号
if
(
!
empty
(
$map
[
'goods_name'
]))
{
$query
->
where
(
'it.goods_name'
,
'='
,
$map
[
'goods_name'
]);
}
})
->
where
(
function
(
$query
)
use
(
$map
)
{
// 创建时间
if
(
!
empty
(
$map
[
'time_start'
])
&&
!
empty
(
$map
[
'time_end'
]))
{
$query
->
whereBetween
(
'o.create_time'
,
[
$map
[
'time_start'
],
$map
[
'time_end'
]]);
...
...
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