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
264c3d40
authored
Sep 29, 2019
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调整离职人员订单分配
parent
75b5192a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
11 deletions
app/Http/Controllers/SpecialController.php
app/Model/UserCompanyModel.php
app/Http/Controllers/SpecialController.php
View file @
264c3d40
...
...
@@ -6,6 +6,7 @@ use Illuminate\Http\Request;
use
App\Http\Controllers\Controller
;
use
App\Model\OrderModel
;
use
App\Model\UserMainModel
;
use
App\Model\UserCompanyModel
;
use
App\Model\OrderActionLogModel
;
use
App\Model\PayLogModel
;
use
DB
;
...
...
@@ -140,7 +141,7 @@ class SpecialController extends Controller
array_shift
(
$excel
);
// 删除第一行
$OrderModel
=
new
OrderModel
();
$OrderModel
=
new
OrderModel
();
// 记录到日志
$monolog
=
Log
::
getMonolog
();
...
...
@@ -181,21 +182,24 @@ class SpecialController extends Controller
// 获取客户最近的订单
public
function
getLastOrderId
(
$account
)
{
$UserMainModel
=
new
UserMainModel
();
$OrderModel
=
new
OrderModel
();
$UserMainModel
=
new
UserMainModel
();
$UserCompanyModel
=
new
UserCompanyModel
();
$OrderModel
=
new
OrderModel
();
if
(
strpos
(
$account
,
'@'
)
===
false
)
{
$where
[
'mobile'
]
=
$account
;
}
else
{
if
(
strpos
(
$account
,
'@'
)
!==
false
)
{
// 邮箱
$where
[
'email'
]
=
strtolower
(
$account
);
}
$user
=
$UserMainModel
->
where
(
$where
)
->
select
(
'user_id'
)
->
first
();
$user_info
=
$UserMainModel
->
where
(
$where
)
->
select
(
'user_id'
)
->
first
();
}
else
if
(
preg_match
(
'/\d{11}/'
,
$account
))
{
// 手机号码
$where
[
'mobile'
]
=
$account
;
$user_info
=
$UserMainModel
->
where
(
$where
)
->
select
(
'user_id'
)
->
first
();
}
else
{
// 公司名称
$user_info
=
$UserCompanyModel
->
where
(
'com_name'
,
$account
)
->
select
(
'user_id'
)
->
first
();
}
if
(
!
$user
)
return
false
;
if
(
!
$user
_info
)
return
false
;
// 查找最近的订单
$order
=
$OrderModel
->
where
(
'user_id'
,
$user
[
'user_id'
])
->
where
(
'is_type'
,
0
)
->
select
(
'order_id'
)
->
orderBy
(
'order_id'
,
'desc'
)
->
first
();
$order
=
$OrderModel
->
where
(
'user_id'
,
$user
_info
[
'user_id'
])
->
where
(
'is_type'
,
0
)
->
select
(
'order_id'
)
->
orderBy
(
'order_id'
,
'desc'
)
->
first
();
if
(
!
$order
)
return
false
;
...
...
app/Model/UserCompanyModel.php
0 → 100644
View file @
264c3d40
<?php
namespace
App\Model
;
use
Illuminate\Database\Eloquent\Model
;
use
Request
;
use
Excel
;
use
DB
;
class
UserCompanyModel
extends
Model
{
protected
$connection
=
'order'
;
protected
$table
=
'lie_user_company'
;
protected
$primaryKey
=
'com_id'
;
public
$timestamps
=
false
;
}
\ No newline at end of file
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