123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?php
- namespace addon\mall;
- use addon\mall\app\service\admin\mall\delivery\CompanyService;
- use addon\mall\app\service\admin\mall\goods\GoodsServiceService;
- use addon\mall\app\service\admin\mall\goods\LabelService;
- use addon\mall\app\service\admin\mall\web\FloorService;
- use app\dict\web\WebInitDataDict;
- use app\service\admin\diy\AdvService;
- use app\service\admin\site\SiteService;
- use app\service\admin\web\NavService;
- class Addon
- {
-
- public function install()
- {
- $init_data = WebInitDataDict::getWebInitData();
- $navService = new NavService();
- $advService = new AdvService();
- $floorService = new FloorService();
- $labelService = new LabelService();
- $goodsServiceService = new GoodsServiceService();
- $companyService = new CompanyService();
-
- foreach ($init_data['nav'] as $v) {
- $navService->add($v);
- }
-
- foreach ($init_data['adv'] as $v) {
- $advService->add($v);
- }
-
- foreach ($init_data['floor'] as $v) {
- $floorService->add($v);
- }
-
- foreach ($init_data['goods_label'] as $v) {
- $labelService->add($v);
- }
-
- foreach ($init_data['goods_service'] as $v) {
- $goodsServiceService->add($v);
- }
-
- foreach ($init_data['company'] as $v) {
- $companyService->add($v);
- }
-
- (new SiteService())->edit(0, $init_data['site']);
- return true;
- }
-
- public function uninstall()
- {
- return true;
- }
-
- public function upgrade()
- {
- return true;
- }
- }
|