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
3e72dfc5
authored
Oct 23, 2021
by
朱继来
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'zjl_new_order_20210926' into development
parents
05dd1274
dae9a55b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
app/Model/UserSampleApplyModel.php
app/Model/UserSampleApplyModel.php
View file @
3e72dfc5
...
...
@@ -5,6 +5,7 @@ use Illuminate\Database\Eloquent\Model;
use
Request
;
use
Excel
;
use
DB
;
use
App\Model\OrderModel
;
class
UserSampleApplyModel
extends
Model
{
...
...
@@ -119,11 +120,11 @@ class UserSampleApplyModel extends Model
// 获取指定字段的总数
public
function
getSampleApplySum
(
$user_id
,
$field
=
'apply_num'
)
{
return
$this
->
from
(
'lie_user_sample_apply as s'
)
->
join
(
'lie_order as o'
,
's.order_id'
,
'='
,
'o.order_id'
)
->
where
(
's.user_id'
,
'='
,
$user_id
)
->
where
(
'
s.is_expire'
,
'='
,
1
)
->
where
(
'
o.status'
,
'<>'
,
'-1'
)
$order
=
OrderModel
::
where
(
'user_id'
,
$user_id
)
->
where
(
'status'
,
'<>'
,
-
1
)
->
lists
(
'order_id'
)
->
toArray
();
return
$this
->
whereIn
(
'order_id'
,
$order
)
->
where
(
'
user_id'
,
'='
,
$user_id
)
->
where
(
'
is_expire'
,
'='
,
1
)
->
whereIn
(
'type'
,
[
1
,
2
])
->
sum
(
$field
);
}
...
...
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