Commit db5af258 by 朱继来

调整样片

parent 637dd9a4
...@@ -301,8 +301,8 @@ class WebController extends Controller ...@@ -301,8 +301,8 @@ class WebController extends Controller
if (!$user_id) return redirect('/web/selfSampleList'); if (!$user_id) return redirect('/web/selfSampleList');
$data['title'] = '自营样片领取和邀约记录'; $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; $data['user_id'] = $user_id;
$UserMainModel = new UserMainModel; $UserMainModel = new UserMainModel;
......
...@@ -105,7 +105,8 @@ class UserSampleApplyModel extends Model ...@@ -105,7 +105,8 @@ class UserSampleApplyModel extends Model
foreach ($data as &$v) { foreach ($data as &$v) {
$v['type_val'] = $v['type'] == 1 ? '样片' : '工具尺'; $v['type_val'] = $v['type'] == 1 ? '样片' : '工具尺';
$v['work_function'] = $UserInfoModel->getWorkFunction($v['user_id']); $v['work_function'] = $UserInfoModel->getWorkFunction($v['user_id']);
$v['invite_count'] = $UserSampleInviteModel->getUserInviteCount($v['user_id']); $v['sample_invite_count'] = $UserSampleInviteModel->getUserInviteCount($v['user_id']);
$v['ruler_invite_count'] = $UserSampleInviteModel->getUserInviteCount($v['user_id'], 2);
$v['apply_num_total'] = $this->getSampleApplySum($v['user_id']); // 获取指定用户申请的样片总数 $v['apply_num_total'] = $this->getSampleApplySum($v['user_id']); // 获取指定用户申请的样片总数
$v['quota_total'] = $this->getSampleApplySum($v['user_id'], 'quota'); // 获取指定用户申请的样片消耗总人数 $v['quota_total'] = $this->getSampleApplySum($v['user_id'], 'quota'); // 获取指定用户申请的样片消耗总人数
// $v['quota_total'] = $this->getUsedCount($v['user_id']); // // $v['quota_total'] = $this->getUsedCount($v['user_id']); //
......
...@@ -55,9 +55,13 @@ class UserSampleInviteModel extends Model ...@@ -55,9 +55,13 @@ class UserSampleInviteModel extends Model
} }
// 获取指定用户邀约人数 // 获取指定用户邀约人数
public function getUserInviteCount($user_id) public function getUserInviteCount($user_id, $type=1)
{ {
return $this->where('user_id', $user_id)->where('is_expire', 1)->count(); $map = [];
$map['user_id'] = $user_id;
$map['type'] = $type;
return $this->where($map)->where('is_expire', 1)->count();
} }
// 获取用户邀约列表 // 获取用户邀约列表
......
...@@ -23,8 +23,9 @@ layui.use(['form', 'table', 'laydate'], function(){ ...@@ -23,8 +23,9 @@ layui.use(['form', 'table', 'laydate'], function(){
,{field: 'user_id', title: '用户ID', width: 100} ,{field: 'user_id', title: '用户ID', width: 100}
,{field: 'account', title: '用户账户', width: 150} ,{field: 'account', title: '用户账户', width: 150}
,{field: 'type_val', title: '活动名称', width: 100} ,{field: 'type_val', title: '活动名称', width: 100}
,{field: 'work_function', title: '用户职务', width: 150} ,{field: 'work_function', title: '用户职务', width: 120}
,{field: 'invite_count', title: '邀请人数', width: 100} ,{field: 'sample_invite_count', title: '样片邀请人数', width: 130}
,{field: 'ruler_invite_count', title: '工具尺邀请人数', width: 130}
,{field: 'apply_num_total', title: '已申请样片数', width: 120} ,{field: 'apply_num_total', title: '已申请样片数', width: 120}
,{field: 'apply_count', title: '剩余有效人数', width: 120} ,{field: 'apply_count', title: '剩余有效人数', width: 120}
,{field: 'quota_total', title: '总消耗人数', width: 120} ,{field: 'quota_total', title: '总消耗人数', width: 120}
......
...@@ -20,10 +20,10 @@ layui.use(['table'], function(){ ...@@ -20,10 +20,10 @@ layui.use(['table'], function(){
,{field: 'order_id', title: '订单ID', width: 120} ,{field: 'order_id', title: '订单ID', width: 120}
,{field: 'order_sn', title: '订单编号', width: 200} ,{field: 'order_sn', title: '订单编号', width: 200}
,{field: 'order_status', title: '订单状态', width: 100} ,{field: 'order_status', title: '订单状态', width: 100}
,{field: 'goods_id', title: '样片ID', width: 120} ,{field: 'goods_id', title: '商品ID', width: 120}
,{field: 'goods_name', title: '样片名称', width: 300} ,{field: 'goods_name', title: '商品名称', width: 300}
,{field: 'apply_num', title: '领取数量', width: 120} ,{field: 'apply_num', title: '领取数量', width: 120}
,{field: 'quota', title: '样片消耗人数', width: 120} ,{field: 'quota', title: '消耗人数', width: 120}
,{field: 'is_expire', title: '是否过期', templet: '#is_expire', width: 120} ,{field: 'is_expire', title: '是否过期', templet: '#is_expire', width: 120}
,{field: 'create_time', title: '领取时间', width: 215} ,{field: 'create_time', title: '领取时间', width: 215}
]] ]]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment