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
f3f88798
authored
Sep 29, 2019
by
朱继来
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'zjl_erp_20190923'
parents
e6a52b0e
264c3d40
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
7 deletions
app/Http/Controllers/SpecialController.php
app/Model/UserCompanyModel.php
app/Http/Controllers/SpecialController.php
View file @
f3f88798
...
...
@@ -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
;
...
...
@@ -182,20 +183,23 @@ class SpecialController extends Controller
public
function
getLastOrderId
(
$account
)
{
$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_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
();
}
$user
=
$UserMainModel
->
where
(
$where
)
->
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 @
f3f88798
<?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