方维O2O系统 后台业务员功能开发

本文介绍方维O2O系统的业务员功能开发过程,包括为业务员设置特殊权限,使其能上传商户并查看个人业绩统计,如商户数量及成交团购数等,同时确保各业务员间数据隔离。

 

需求如下: 

  开发一个管理员,叫做业务员有特别的权限,就是后台可以给业务员一个账号,然后业务员每次出去拉到团购回来,上传商户,之后,运营后能在业务员自己的账号权限内看到自己所拉业务下面的详细统计,包括多少个商户,成交了多少团购,,等,,但是看不到别的业务员的。

 

思路如下:

    商户添加的时候填写推荐人,然后关联管理员数据表,只查询登录用户的推荐商户数据。

 

大体步骤如下:

①修改表,添加操作者字段;

alter table fanwe_supplier
add column operator_id varchar(55);

② 后台添加商户的时候,加当前登录管理员的ID,

   通过session数据或者手动填表单的形式,将操作者写入商户列表的数据表。

③统计报表选项添加,  查看left.html 得知是数据库出来的:

show tables like '%group%';

 

Tables_in_hdm1430549_db (%group%)
fanwe_filter_group
fanwe_images_group
fanwe_images_group_link
fanwe_link_group
fanwe_point_group
fanwe_point_group_link
fanwe_role_group
fanwe_supplier_tag_group_preset
fanwe_tag_group
fanwe_tag_group_link
fanwe_topic_group
fanwe_topic_group_cate
fanwe_user_group
fanwe_user_topic_group

select * from fanwe_role_group where name like '%报表%';

idnamenav_idis_deleteis_effectsort
68报表与结算80114

 

select * from fanwe_role_group where nav_id=8;

idnamenav_idis_deleteis_effectsort
16支付接口80114
17配送方式80115
23订单管理80113
24充值订单80113
68报表与结算80114

查看action文件:

$nav_group = M("RoleGroup")->where("nav_id=".$nav_id." and is_effect = 1 and is_delete = 0")->order("sort asc")->findAll();        

        foreach($nav_group as $k=>$v)

        {

            $sql = "select role_node.`action` as a,role_module.`module` as m,role_node.id as nid,role_node.name as name from ".conf("DB_PREFIX")."role_node as role_node left join ".

                   conf("DB_PREFIX")."role_module as role_module on role_module.id = role_node.module_id ".

                   "where role_node.is_effect = 1 and role_node.is_delete = 0 and role_module.is_effect = 1 and role_module.is_delete = 0 and role_node.group_id = ".$v['id']." order by role_node.id asc";

            

            $nav_group[$k]['nodes'] = M()->query($sql);

        }

select * from fanwe_role_node where name like '%报表%' limit 3;

idactionnameis_effectis_deletegroup_idmodule_id
604index报表列表1068112

select * from fanwe_role_module where name like '%报表%' limit 3;

idmodulenameis_effectis_delete
112Statistic报表10

 

insert into fanwe_role_node values(null,'tongji','业务员列表',1,0,68,112);

 

新建tpl与action;

action:

        $sql = "SELECT c.id, c.name,count(*) as num, sum(a.pay_amount) as money  FROM `fanwe_deal_order` as a 
                          left join fanwe_deal as b on a.deal_ids = b.id  
                          left join fanwe_supplier as c on c.id =  b.supplier_id
                          WHERE a.is_delete = 0 
                            and a.type = 0 
                            and a.pay_status = 2 
                            and c.operator_id is null
                          group by c.id
                          limit 33";

 

posted on 2014-11-28 07:44 方维二次开发 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/wangtongphp/p/4127626.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值