<?php
namespace Application\Service\DB\Admin;

use Interop\Container\ContainerInterface;

class Appletsrolemenurelation extends \Application\Service\DB\AbstractDb
{
    public function __construct($dbAdapter, ContainerInterface $container)
    {
        $this->tableName = 'yikeen_admin_applets_rolemenurelation';
        parent::__construct($dbAdapter, $container);
    }

    /**
     *保存小程序平台功能默认分配
     *
     */
    public function addappletsMenu($item_id){
        //查询小程序功能列表
        $adminAppletsmenuDatas = $this->LocalService()->adminAppletsmenu->fetchCol('id','is_del=0 and status = 0');
        if(!empty($adminAppletsmenuDatas)){
            foreach($adminAppletsmenuDatas as $key=>$val){
                $menuData['item_id'] = $item_id;
                $menuData['menu_id'] = $val;
                $menuData['status'] = 0;
                $this->LocalService()->adminAppletsrolemenurelation->insert($menuData);//新增
            }

        }
    }
}