方维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 '%報表%';
| id | name | nav_id | is_delete | is_effect | sort |
| 68 | 報表與結算 | 8 | 0 | 1 | 14 |
?
select * from fanwe_role_group where nav_id=8;
| id | name | nav_id | is_delete | is_effect | sort |
| 16 | 支付接口 | 8 | 0 | 1 | 14 |
| 17 | 配送方式 | 8 | 0 | 1 | 15 |
| 23 | 訂單管理 | 8 | 0 | 1 | 13 |
| 24 | 充值訂單 | 8 | 0 | 1 | 13 |
| 68 | 報表與結算 | 8 | 0 | 1 | 14 |
查看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;
| id | action | name | is_effect | is_delete | group_id | module_id |
| 604 | index | 報表列表 | 1 | 0 | 68 | 112 |
select * from fanwe_role_module where name like '%報表%' limit 3;
| id | module | name | is_effect | is_delete |
| 112 | Statistic | 報表 | 1 | 0 |
?
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_idWHERE a.is_delete = 0 and a.type = 0 and a.pay_status = 2 and c.operator_id is nullgroup by c.idlimit 33";?
posted on 2014-11-28 07:44 方維二次開發 閱讀(...) 評論(...) 編輯 收藏轉載于:https://www.cnblogs.com/wangtongphp/p/4127626.html
總結
以上是生活随笔為你收集整理的方维O2O系统 后台业务员功能开发的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: visdom简易教程
- 下一篇: double 格式化