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
fab6ddfa
authored
Nov 18, 2021
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
售后添加账期查询
parent
960936b8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
18 deletions
app/Model/OrderServiceModel.php
resources/views/web/orderServiceList.blade.php
app/Model/OrderServiceModel.php
View file @
fab6ddfa
...
...
@@ -30,58 +30,75 @@ class OrderServiceModel extends Model
$page
=
$request
->
input
(
'page'
,
1
);
$limit
=
$request
->
input
(
'limit'
,
10
);
$map
[
'service_sn'
]
=
$request
->
input
(
'service_sn'
,
''
);
// 售后单号
$map
[
'order_sn'
]
=
$request
->
input
(
'order_sn'
,
''
);
// 订单号
$map
[
'apply_id'
]
=
$request
->
input
(
'apply_id'
,
''
);
// 申请人
$map
[
'service_status'
]
=
$request
->
input
(
'service_status'
,
''
);
// 售后状态
$map
[
'refund_status'
]
=
$request
->
input
(
'refund_status'
,
''
);
// 退款状态
$map
[
'return_status'
]
=
$request
->
input
(
'return_status'
,
''
);
// 退货状态
$map
[
'begin_time'
]
=
$request
->
input
(
'begin_time'
,
''
)
?
strtotime
(
$request
->
input
(
'begin_time'
))
:
''
;
$map
[
'end_time'
]
=
$request
->
input
(
'end_time'
,
''
)
?
strtotime
(
$request
->
input
(
'end_time'
))
+
86399
:
''
;
$map
[
'service_sn'
]
=
$request
->
input
(
'service_sn'
,
''
);
// 售后单号
$map
[
'order_sn'
]
=
$request
->
input
(
'order_sn'
,
''
);
// 订单号
$map
[
'apply_id'
]
=
$request
->
input
(
'apply_id'
,
''
);
// 申请人
$map
[
'service_status'
]
=
$request
->
input
(
'service_status'
,
''
);
// 售后状态
$map
[
'refund_status'
]
=
$request
->
input
(
'refund_status'
,
''
);
// 退款状态
$map
[
'return_status'
]
=
$request
->
input
(
'return_status'
,
''
);
// 退货状态
$map
[
'begin_time'
]
=
$request
->
input
(
'begin_time'
,
''
)
?
strtotime
(
$request
->
input
(
'begin_time'
))
:
''
;
$map
[
'end_time'
]
=
$request
->
input
(
'end_time'
,
''
)
?
strtotime
(
$request
->
input
(
'end_time'
))
+
86399
:
''
;
$map
[
'is_account_order'
]
=
$request
->
input
(
'is_account_order'
,
''
);
// 账期订单
$perm
=
new
PermController
;
$role
=
$perm
->
getUserRole
(
$request
);
// 用户角色
$list
=
$this
->
where
(
function
(
$query
)
use
(
$map
,
$request
,
$role
,
$perm
)
{
$field
=
[
's.id'
,
's.service_sn'
,
's.order_id'
,
's.order_sn'
,
's.user_id'
,
's.service_type'
,
's.service_status'
,
's.refund_status'
,
's.return_status'
,
's.apply_id'
,
's.apply_name'
,
's.auditor_id'
,
's.auditor_name'
,
's.create_time'
,
's.auditor_time'
];
$list
=
$this
->
from
(
'lie_order_service as s'
);
if
(
$map
[
'is_account_order'
]
!==
''
)
{
$list
=
$list
->
join
(
'lie_order as o'
,
's.order_id'
,
'='
,
'o.order_id'
)
->
where
(
function
(
$query
)
use
(
$map
)
{
if
(
$map
[
'is_account_order'
]
==
1
)
{
$query
->
where
(
'o.order_pay_type'
,
3
);
}
else
{
$query
->
where
(
'o.order_pay_type'
,
'<>'
,
3
);
}
});
}
$list
=
$list
->
where
(
function
(
$query
)
use
(
$map
,
$request
,
$role
,
$perm
)
{
// 售后单号
if
(
$map
[
'service_sn'
])
{
$query
->
where
(
'service_sn'
,
'='
,
$map
[
'service_sn'
]);
$query
->
where
(
's
.s
ervice_sn'
,
'='
,
$map
[
'service_sn'
]);
}
// 订单号
if
(
$map
[
'order_sn'
])
{
$query
->
where
(
'order_sn'
,
'='
,
$map
[
'order_sn'
]);
$query
->
where
(
'
s.
order_sn'
,
'='
,
$map
[
'order_sn'
]);
}
// 申请人
if
(
$map
[
'apply_id'
])
{
$query
->
where
(
'apply_id'
,
'='
,
$map
[
'apply_id'
]);
$query
->
where
(
'
s.
apply_id'
,
'='
,
$map
[
'apply_id'
]);
}
// 售后状态
if
(
$map
[
'service_status'
])
{
$query
->
where
(
'service_status'
,
'='
,
$map
[
'service_status'
]);
$query
->
where
(
's
.s
ervice_status'
,
'='
,
$map
[
'service_status'
]);
}
// 退款状态
if
(
$map
[
'refund_status'
])
{
$query
->
where
(
'refund_status'
,
'='
,
$map
[
'refund_status'
]);
$query
->
where
(
'
s.
refund_status'
,
'='
,
$map
[
'refund_status'
]);
}
// 退货状态
if
(
$map
[
'return_status'
])
{
$query
->
where
(
'return_status'
,
'='
,
$map
[
'return_status'
]);
$query
->
where
(
'
s.
return_status'
,
'='
,
$map
[
'return_status'
]);
}
// 创建时间
if
(
!
empty
(
$map
[
'begin_time'
])
&&
!
empty
(
$map
[
'end_time'
]))
{
$query
->
whereBetween
(
'create_time'
,
[
$map
[
'begin_time'
],
$map
[
'end_time'
]]);
$query
->
whereBetween
(
'
s.
create_time'
,
[
$map
[
'begin_time'
],
$map
[
'end_time'
]]);
}
else
if
(
!
empty
(
$map
[
'begin_time'
]))
{
$query
->
where
(
'create_time'
,
'>='
,
$map
[
'begin_time'
]);
$query
->
where
(
'
s.
create_time'
,
'>='
,
$map
[
'begin_time'
]);
}
else
if
(
!
empty
(
$map
[
'end_time'
]))
{
$query
->
where
(
'create_time'
,
'<='
,
$map
[
'end_time'
]);
$query
->
where
(
'
s.
create_time'
,
'<='
,
$map
[
'end_time'
]);
}
switch
(
$role
)
{
...
...
@@ -95,6 +112,7 @@ class OrderServiceModel extends Model
break
;
}
})
->
select
(
$field
)
->
orderBy
(
'id'
,
'desc'
);
// $tmp = str_replace('?', '"'.'%s'.'"', $list->toSql());
// $tmp = vsprintf($tmp, $list->getBindings());
...
...
resources/views/web/orderServiceList.blade.php
View file @
fab6ddfa
...
...
@@ -92,6 +92,17 @@
<input
type=
"text"
name=
"end_time"
value=
""
autocomplete=
"off"
placeholder=
"选择结束时间"
class=
"layui-input"
id=
"end_time"
readonly
>
</div>
</div>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
账期订单
</label>
<div
class=
"layui-input-inline"
>
<select
name=
"is_account_order"
lay-verify=
""
lay-search
>
<option
value=
""
></option>
<option
value=
"1"
>
是
</option>
<option
value=
"-1"
>
否
</option>
</select>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
...
...
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