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
a7d0b0a6
authored
Oct 15, 2019
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix
parent
bf5175b2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
19 deletions
app/Model/OrderModel.php
app/Model/OrderModel.php
View file @
a7d0b0a6
...
@@ -29,8 +29,6 @@ class OrderModel extends Model
...
@@ -29,8 +29,6 @@ class OrderModel extends Model
if
(
$request
->
isMethod
(
'get'
))
{
if
(
$request
->
isMethod
(
'get'
))
{
$map
[
'order_type'
]
=
$request
->
input
(
'order_type'
,
''
);
$map
[
'order_type'
]
=
$request
->
input
(
'order_type'
,
''
);
$map
[
'order_contain'
]
=
$request
->
input
(
'order_contain'
,
''
);
$map
[
'order_contain'
]
=
$request
->
input
(
'order_contain'
,
''
);
$map
[
'order_sn'
]
=
$request
->
input
(
'order_sn'
,
''
);
$map
[
'goods_name'
]
=
$request
->
input
(
'goods_name'
,
''
);
$map
[
'time_start'
]
=
$request
->
input
(
'time_start'
,
''
);
$map
[
'time_start'
]
=
$request
->
input
(
'time_start'
,
''
);
$map
[
'time_end'
]
=
$request
->
input
(
'time_end'
,
''
);
$map
[
'time_end'
]
=
$request
->
input
(
'time_end'
,
''
);
$map
[
'order_status'
]
=
$request
->
input
(
'order_status'
,
''
);
$map
[
'order_status'
]
=
$request
->
input
(
'order_status'
,
''
);
...
@@ -82,32 +80,24 @@ class OrderModel extends Model
...
@@ -82,32 +80,24 @@ class OrderModel extends Model
->
where
(
function
(
$query
)
use
(
$map
)
{
->
where
(
function
(
$query
)
use
(
$map
)
{
// 查询类型
// 查询类型
if
(
!
empty
(
$map
[
'order_contain'
]))
{
if
(
!
empty
(
$map
[
'order_contain'
]))
{
if
(
$map
[
'order_type'
]
==
3
)
{
// 发票抬头
if
(
$map
[
'order_type'
]
==
1
)
{
// 会员账号
$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'
]))
{
if
(
preg_match
(
'/@/'
,
$map
[
'order_contain'
]))
{
$query
->
where
(
'u.email'
,
'='
,
$map
[
'order_contain'
]);
$query
->
where
(
'u.email'
,
'='
,
$map
[
'order_contain'
]);
}
else
{
}
else
{
$query
->
where
(
'u.mobile'
,
'='
,
$map
[
'order_contain'
]);
$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
)
{
->
where
(
function
(
$query
)
use
(
$map
)
{
// 订单编号
if
(
!
empty
(
$map
[
'order_sn'
]))
{
$query
->
whereIn
(
'o.order_sn'
,
explode
(
','
,
$map
[
'order_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'
]))
{
if
(
!
empty
(
$map
[
'time_start'
])
&&
!
empty
(
$map
[
'time_end'
]))
{
$query
->
whereBetween
(
'o.create_time'
,
[
$map
[
'time_start'
],
$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