方维O2O系统 后台业务员功能开发
?
需求如下:?
開(kāi)發(fā)一個(gè)管理員,叫做業(yè)務(wù)員有特別的權(quán)限,就是后臺(tái)可以給業(yè)務(wù)員一個(gè)賬號(hào),然后業(yè)務(wù)員每次出去拉到團(tuán)購(gòu)回來(lái),上傳商戶(hù),之后,運(yùn)營(yíng)后能在業(yè)務(wù)員自己的賬號(hào)權(quán)限內(nèi)看到自己所拉業(yè)務(wù)下面的詳細(xì)統(tǒng)計(jì),包括多少個(gè)商戶(hù),成交了多少團(tuán)購(gòu),,等,,但是看不到別的業(yè)務(wù)員的。
?
思路如下:
? ? 商戶(hù)添加的時(shí)候填寫(xiě)推薦人,然后關(guān)聯(lián)管理員數(shù)據(jù)表,只查詢(xún)登錄用戶(hù)的推薦商戶(hù)數(shù)據(jù)。
?
大體步驟如下:
①修改表,添加操作者字段;
alter table fanwe_supplier
add column operator_id varchar(55);
② 后臺(tái)添加商戶(hù)的時(shí)候,加當(dāng)前登錄管理員的ID,
? ?通過(guò)session數(shù)據(jù)或者手動(dòng)填表單的形式,將操作者寫(xiě)入商戶(hù)列表的數(shù)據(jù)表。
③統(tǒng)計(jì)報(bào)表選項(xiàng)添加, ?查看left.html 得知是數(shù)據(jù)庫(kù)出來(lái)的:
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 '%報(bào)表%';
| id | name | nav_id | is_delete | is_effect | sort |
| 68 | 報(bào)表與結(jié)算 | 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 | 報(bào)表與結(jié)算 | 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 '%報(bào)表%' limit 3;
| id | action | name | is_effect | is_delete | group_id | module_id |
| 604 | index | 報(bào)表列表 | 1 | 0 | 68 | 112 |
select * from fanwe_role_module where name like '%報(bào)表%' limit 3;
| id | module | name | is_effect | is_delete |
| 112 | Statistic | 報(bào)表 | 1 | 0 |
?
insert into fanwe_role_node values(null,'tongji','業(yè)務(wù)員列表',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 方維二次開(kāi)發(fā) 閱讀(...) 評(píng)論(...) 編輯 收藏轉(zhuǎn)載于:https://www.cnblogs.com/wangtongphp/p/4127626.html
總結(jié)
以上是生活随笔為你收集整理的方维O2O系统 后台业务员功能开发的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: visdom简易教程
- 下一篇: windows 2008 server