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
21c84a8c
authored
Nov 20, 2020
by
朱继来
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'zjl_domestic_20201110'
parents
a861541b
8a0bf5df
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
201 additions
and
19 deletions
app/Http/Controllers/ApiController.php
app/Http/Controllers/WebController.php
app/Model/UserSampleApplyModel.php
config/params.php
public/js/web/domesticSampleList.js
public/js/web/selfSampleLog.js
resources/views/detail/detail_items_info.php
resources/views/web/domesticSampleList.blade.php
resources/views/web/selfSampleList.blade.php
app/Http/Controllers/ApiController.php
View file @
21c84a8c
...
...
@@ -200,6 +200,13 @@ class ApiController extends Controller
$this
->
ExportLayui
(
$UserSampleInviteModel
->
lists
(
$request
));
}
// 获取国产替代样片领取列表
public
function
ApiDomesticSampleList
(
$request
)
{
$UserSampleApplyModel
=
new
UserSampleApplyModel
;
$this
->
ExportLayui
(
$UserSampleApplyModel
->
domesticLists
(
$request
));
}
/*
修改订单详情
*/
...
...
app/Http/Controllers/WebController.php
View file @
21c84a8c
...
...
@@ -290,7 +290,7 @@ class WebController extends Controller
// 自营样片领取列表
public
function
selfSampleList
(
$request
,
$data
,
$id
)
{
$data
[
'title'
]
=
'
自营样片领取列表
'
;
$data
[
'title'
]
=
'
邀约领取样片
'
;
return
view
(
'web'
,
$data
);
}
...
...
@@ -302,7 +302,7 @@ class WebController extends Controller
if
(
!
$user_id
)
return
redirect
(
'/web/selfSampleList'
);
$data
[
'title'
]
=
'领取和邀约记录'
;
$data
[
'paths'
]
=
[[
"title"
=>
'
自营订单'
,
"href"
=>
'#'
],
[
"title"
=>
'自营订单领取列表
'
,
"href"
=>
'/web/selfSampleList'
],
[
"title"
=>
'领取和邀约记录'
,
"href"
=>
'#'
]];
$data
[
'paths'
]
=
[[
"title"
=>
'
样片管理'
,
"href"
=>
'#'
],
[
"title"
=>
'邀约领取样片
'
,
"href"
=>
'/web/selfSampleList'
],
[
"title"
=>
'领取和邀约记录'
,
"href"
=>
'#'
]];
$data
[
'user_id'
]
=
$user_id
;
$UserMainModel
=
new
UserMainModel
;
...
...
@@ -316,6 +316,13 @@ class WebController extends Controller
return
view
(
'web'
,
$data
);
}
// 国产替代样片领取列表
public
function
domesticSampleList
(
$request
,
$data
,
$id
)
{
$data
[
'title'
]
=
'国产替代样片'
;
return
view
(
'web'
,
$data
);
}
// 团购列表
public
function
groupList
(
$request
,
$data
,
$id
)
{
...
...
app/Model/UserSampleApplyModel.php
View file @
21c84a8c
...
...
@@ -35,13 +35,13 @@ class UserSampleApplyModel extends Model
$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
:
''
;
$sub
=
UserSampleApplyModel
::
select
(
DB
::
raw
(
'max(apply_id) as apply_id'
))
->
groupBy
(
'user_id'
);
$sub
=
UserSampleApplyModel
::
whereIn
(
'type'
,
[
1
,
2
])
->
select
(
DB
::
raw
(
'max(apply_id) as apply_id'
))
->
groupBy
(
'user_id'
);
$list
=
$this
->
from
(
'lie_user_sample_apply as a'
)
->
join
(
DB
::
raw
(
"(
{
$sub
->
toSql
()
}
) as b"
),
function
(
$join
)
{
$join
->
on
(
'a.apply_id'
,
'='
,
'b.apply_id'
);
})
->
where
(
function
(
$query
)
use
(
$map
)
{
//
客服名称
})
->
mergeBindings
(
$sub
->
getQuery
())
->
where
(
function
(
$query
)
use
(
$map
)
{
//
用户账户
if
(
$map
[
'account'
])
{
$query
->
where
(
'a.account'
,
'='
,
$map
[
'account'
]);
}
...
...
@@ -51,7 +51,7 @@ class UserSampleApplyModel extends Model
$query
->
where
(
'a.goods_name'
,
'like'
,
$map
[
'goods_name'
]
.
'%'
);
}
})
->
where
(
function
(
$query
)
use
(
$map
)
{
//
客服名称
//
订单号
if
(
$map
[
'order_sn'
])
{
$query
->
where
(
'a.order_sn'
,
'='
,
$map
[
'order_sn'
]);
}
...
...
@@ -75,10 +75,11 @@ class UserSampleApplyModel extends Model
->
select
(
$field
)
->
orderBy
(
'a.create_time'
,
'desc'
)
->
orderBy
(
'a.apply_id'
,
'asc'
);
// $tmp = str_replace('?', '"'.'%s'.'"', $list->toSql());
// $tmp = vsprintf($tmp, $list->getBindings());
// echo $tmp;exit;
if
(
$export
)
{
$list
=
$list
->
get
()
->
toArray
();
$list
=
$this
->
handle
(
$list
);
if
(
empty
(
$list
))
{
...
...
@@ -88,7 +89,6 @@ class UserSampleApplyModel extends Model
return
$list
;
}
else
{
$list
=
$list
->
paginate
(
$limit
,
[
'*'
],
'page'
,
$page
)
->
toArray
();
$data
=
$this
->
handle
(
$list
[
'data'
]);
return
[
0
,
'获取成功'
,
$data
,
$list
[
'total'
]];
...
...
@@ -103,7 +103,7 @@ class UserSampleApplyModel extends Model
$UserSampleInviteModel
=
new
UserSampleInviteModel
;
$UserInfoModel
=
new
UserInfoModel
;
foreach
(
$data
as
&
$v
)
{
$v
[
'type_val'
]
=
$v
[
'type'
]
==
1
?
'样片'
:
'工具尺'
;
$v
[
'type_val'
]
=
array_get
(
Config
(
'params.sample_type'
),
$v
[
'type'
],
''
)
;
$v
[
'work_function'
]
=
$UserInfoModel
->
getWorkFunction
(
$v
[
'user_id'
]);
$v
[
'sample_invite_count'
]
=
$UserSampleInviteModel
->
getUserInviteCount
(
$v
[
'user_id'
]);
$v
[
'ruler_invite_count'
]
=
$UserSampleInviteModel
->
getUserInviteCount
(
$v
[
'user_id'
],
2
);
...
...
@@ -124,6 +124,7 @@ class UserSampleApplyModel extends Model
->
where
(
's.user_id'
,
'='
,
$user_id
)
->
where
(
's.is_expire'
,
'='
,
1
)
->
where
(
'o.status'
,
'<>'
,
'-1'
)
->
whereIn
(
'type'
,
[
1
,
2
])
->
sum
(
$field
);
}
...
...
@@ -137,6 +138,7 @@ class UserSampleApplyModel extends Model
$field
=
[
'apply_id'
,
'user_id'
,
'account'
,
'order_id'
,
'order_sn'
,
'goods_id'
,
'goods_name'
,
'apply_num'
,
'quota'
,
'is_expire'
,
'type'
,
'create_time'
];
$list
=
$this
->
where
(
'user_id'
,
$user_id
)
->
whereIn
(
'type'
,
[
1
,
2
])
->
select
(
$field
)
->
orderBy
(
'create_time'
,
'desc'
)
->
orderBy
(
'apply_id'
,
'asc'
)
...
...
@@ -155,7 +157,7 @@ class UserSampleApplyModel extends Model
$OrderModel
=
new
OrderModel
();
foreach
(
$data
as
&
$v
)
{
$v
[
'type_val'
]
=
$v
[
'type'
]
==
1
?
'样片'
:
'工具尺'
;
$v
[
'type_val'
]
=
array_get
(
Config
(
'params.sample_type'
),
$v
[
'type'
],
''
)
;
$order
=
$OrderModel
->
where
(
'order_id'
,
$v
[
'order_id'
])
->
select
(
'status'
)
->
first
();
...
...
@@ -167,5 +169,54 @@ class UserSampleApplyModel extends Model
return
$data
;
}
// 国产替代领取记录
public
function
domesticLists
(
$request
)
{
$page
=
$request
->
input
(
'page'
,
1
);
$limit
=
$request
->
input
(
'limit'
,
10
);
$field
=
[
'apply_id'
,
'user_id'
,
'account'
,
'order_id'
,
'order_sn'
,
'goods_id'
,
'goods_name'
,
'apply_num'
,
'quota'
,
'type'
,
'create_time'
];
$map
[
'account'
]
=
$request
->
input
(
'account'
,
''
);
// 用户账户
$map
[
'goods_name'
]
=
$request
->
input
(
'goods_name'
,
''
);
// 商品名称
$map
[
'order_sn'
]
=
$request
->
input
(
'order_sn'
,
''
);
// 订单号
$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
:
''
;
$list
=
$this
->
where
(
function
(
$query
)
use
(
$map
)
{
// 用户账户
if
(
$map
[
'account'
])
{
$query
->
where
(
'account'
,
'='
,
$map
[
'account'
]);
}
})
->
where
(
function
(
$query
)
use
(
$map
)
{
// 邮箱
if
(
$map
[
'goods_name'
])
{
$query
->
where
(
'goods_name'
,
'like'
,
$map
[
'goods_name'
]
.
'%'
);
}
})
->
where
(
function
(
$query
)
use
(
$map
)
{
// 订单号
if
(
$map
[
'order_sn'
])
{
$query
->
where
(
'order_sn'
,
'='
,
$map
[
'order_sn'
]);
}
})
->
where
(
function
(
$query
)
use
(
$map
)
{
// 创建时间
if
(
!
empty
(
$map
[
'begin_time'
])
&&
!
empty
(
$map
[
'end_time'
]))
{
$query
->
whereBetween
(
'create_time'
,
[
$map
[
'begin_time'
],
$map
[
'end_time'
]]);
}
else
if
(
!
empty
(
$map
[
'begin_time'
]))
{
$query
->
where
(
'create_time'
,
'>='
,
$map
[
'begin_time'
]);
}
else
if
(
!
empty
(
$map
[
'end_time'
]))
{
$query
->
where
(
'create_time'
,
'<='
,
$map
[
'end_time'
]);
}
})
->
where
(
'type'
,
3
)
->
select
(
$field
)
->
orderBy
(
'create_time'
,
'desc'
)
->
orderBy
(
'apply_id'
,
'asc'
)
->
paginate
(
$limit
,
[
'*'
],
'page'
,
$page
)
->
toArray
();
return
[
0
,
'获取成功'
,
$list
[
'data'
],
$list
[
'total'
]];
}
}
\ No newline at end of file
config/params.php
View file @
21c84a8c
...
...
@@ -118,7 +118,7 @@
],
//公司类别
'company_type'
=>
array
(
'company_type'
=>
[
0
=>
'个人'
,
1
=>
'终端采购商'
,
2
=>
'代工厂'
,
...
...
@@ -126,7 +126,12 @@
4
=>
'学校/科研机构'
,
5
=>
'贸易商'
,
6
=>
'其他'
,
)
,
]
,
'sample_type'
=>
[
// 样片类型
1
=>
'普通样片'
,
2
=>
'工具尺'
,
3
=>
'国产替代'
,
],
];
\ No newline at end of file
public/js/web/domesticSampleList.js
0 → 100644
View file @
21c84a8c
layui
.
use
([
'form'
,
'table'
,
'laydate'
],
function
(){
var
form
=
layui
.
form
;
var
table
=
layui
.
table
;
var
laydate
=
layui
.
laydate
;
laydate
.
render
({
elem
:
'#begin_time'
//指定元素
});
laydate
.
render
({
elem
:
'#end_time'
//指定元素
});
table
.
render
({
id
:
'list'
,
elem
:
'#domesticSample'
,
url
:
'/api/ApiDomesticSampleList'
//数据接口
,
method
:
'post'
,
cellMinWidth
:
80
//全局定义常规单元格的最小宽度
,
page
:
true
//开启分页
,
cols
:
[[
//表头
{
title
:
'序号'
,
type
:
'numbers'
,
fixed
:
'left'
,
width
:
80
}
,{
field
:
'user_id'
,
title
:
'用户ID'
,
width
:
100
}
,{
field
:
'account'
,
title
:
'用户账户'
,
width
:
180
}
,{
field
:
'apply_num'
,
title
:
'申请样片数'
,
width
:
120
}
,{
field
:
'order_id'
,
title
:
'订单ID'
,
width
:
100
}
,{
field
:
'order_sn'
,
title
:
'订单编号'
,
width
:
180
}
,{
field
:
'goods_id'
,
title
:
'样片ID'
,
width
:
200
}
,{
field
:
'goods_name'
,
title
:
'样片名称'
,
width
:
300
}
,{
field
:
'create_time'
,
title
:
'最近一次领取时间'
}
]]
,
limit
:
10
,
limits
:
[
10
,
20
,
50
,]
});
form
.
on
(
'submit(load)'
,
function
(
data
)
{
//执行重载
table
.
reload
(
'list'
,
{
page
:
{
curr
:
1
}
,
where
:
data
.
field
});
return
false
;
});
});
\ No newline at end of file
public/js/web/selfSampleLog.js
View file @
21c84a8c
...
...
@@ -18,9 +18,9 @@ layui.use(['table'], function(){
,{
field
:
'account'
,
title
:
'用户账户'
,
width
:
200
}
,{
field
:
'type_val'
,
title
:
'活动名称'
,
width
:
100
}
,{
field
:
'order_id'
,
title
:
'订单ID'
,
width
:
120
}
,{
field
:
'order_sn'
,
title
:
'订单编号'
,
width
:
20
0
}
,{
field
:
'order_sn'
,
title
:
'订单编号'
,
width
:
15
0
}
,{
field
:
'order_status'
,
title
:
'订单状态'
,
width
:
100
}
,{
field
:
'goods_id'
,
title
:
'商品ID'
,
width
:
12
0
}
,{
field
:
'goods_id'
,
title
:
'商品ID'
,
width
:
20
0
}
,{
field
:
'goods_name'
,
title
:
'商品名称'
,
width
:
300
}
,{
field
:
'apply_num'
,
title
:
'领取数量'
,
width
:
120
}
,{
field
:
'quota'
,
title
:
'消耗人数'
,
width
:
120
}
...
...
resources/views/detail/detail_items_info.php
View file @
21c84a8c
...
...
@@ -162,21 +162,36 @@
<?php
if
(
$order_info
[
'order_remark'
])
{
?>
<tr>
<td>
订单备注信息:
</td>
<td
colspan=
"1
8
"
>
<?=
$order_info
[
'order_remark'
]
?>
</td>
<td
colspan=
"1
9
"
>
<?=
$order_info
[
'order_remark'
]
?>
</td>
</tr>
<?php
}
?>
<?php
if
(
$order_temp_info
[
'kefu_remark'
])
{
?>
<tr>
<td>
客服备注信息:
</td>
<td
colspan=
"1
8
"
>
<?=
$order_temp_info
[
'kefu_remark'
]
?>
</td>
<td
colspan=
"1
9
"
>
<?=
$order_temp_info
[
'kefu_remark'
]
?>
</td>
</tr>
<?php
}
?>
<?php
if
(
$order_info
[
'order_goods_type'
]
==
2
&&
$order_temp_info
[
'business_type'
]
==
1
)
{
?>
<tr>
<td>
项目需求描述:
</td>
<td
colspan=
"18"
>
<?=
$order_temp_info
[
'sample_demand_desc'
]
?>
</td>
<td
colspan=
"19"
>
<?=
$order_temp_info
[
'sample_demand_desc'
]
?>
</td>
</tr>
<?php
}
?>
<?php
if
(
$order_info
[
'order_goods_type'
]
==
1
&&
$order_temp_info
[
'business_type'
]
==
1
)
{
?>
<tr>
<td>
项目名称:
</td>
<td
colspan=
"19"
>
<?=
$order_temp_info
[
'sample_project_name'
]
?>
</td>
</tr>
<tr>
<td>
项目阶段:
</td>
<td
colspan=
"19"
>
<?=
$order_temp_info
[
'sample_project_stage'
]
?>
</td>
</tr>
<tr>
<td>
申请理由:
</td>
<td
colspan=
"19"
>
<?=
$order_temp_info
[
'sample_project_reason'
]
?>
</td>
</tr>
<?php
}
?>
</tfoot>
...
...
resources/views/web/domesticSampleList.blade.php
0 → 100644
View file @
21c84a8c
<form
class=
"layui-form layui-box"
method=
"post"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
用户账户
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
name=
"account"
placeholder=
"填写用户账户"
autocomplete=
"off"
class=
"layui-input"
>
</div>
</div>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
商品名称
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
name=
"goods_name"
placeholder=
"填写商品名称"
autocomplete=
"off"
class=
"layui-input"
>
</div>
</div>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
订单编号
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
name=
"order_sn"
placeholder=
"填写订单编号"
autocomplete=
"off"
class=
"layui-input"
>
</div>
</div>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
领取时间
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
name=
"begin_time"
value=
""
autocomplete=
"off"
placeholder=
"选择开始时间"
class=
"layui-input"
id=
"begin_time"
readonly
>
</div>
<div
class=
"layui-form-mid"
>
-
</div>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
name=
"end_time"
value=
""
autocomplete=
"off"
placeholder=
"选择结束时间"
class=
"layui-input"
id=
"end_time"
readonly
>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-btn-container"
style=
"text-align: center; margin-top: 10px;"
>
<button
lay-submit
lay-filter=
"load"
class=
"layui-btn"
data-type=
"search"
>
搜索
</button>
<!-- <button type="button" class="layui-btn layui-btn-normal export">导出</button> -->
</div>
</div>
</form>
<table
id=
"domesticSample"
lay-filter=
"list"
></table>
\ No newline at end of file
resources/views/web/selfSampleList.blade.php
View file @
21c84a8c
...
...
@@ -26,7 +26,7 @@
<div
class=
"layui-input-inline"
>
<select
name=
"type"
lay-verify=
""
lay-search
>
<option
value=
""
></option>
<option
value=
"1"
>
样片
</option>
<option
value=
"1"
>
普通
样片
</option>
<option
value=
"2"
>
工具尺
</option>
</select>
</div>
...
...
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