jh-admin/addon/store/event/AddStore.php

58 lines
1.8 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/**
* SaaSMall商城系统 - 团队十年电商经验汇集巨献!
* =========================================================
* Copy right 2019-2029 成都SAAS云科技有限公司, 保留所有权利。
* ----------------------------------------------
* 官方网址: https://www.gobuysaas.com
* =========================================================
*/
namespace addon\store\event;
use app\model\store\Store;
/**
*添加门店
*/
class AddStore
{
public function handle($data)
{
if (isset($data['site_id'])) {
$is_store = addon_is_exit('store');
$store_data = array(
"store_name" => '默认店铺',
"telphone" => '13800138000',
"store_image" => '',
"store_type" => 'directsale',
"status" => 1,
"province_id" => 510000,
"city_id" => 510100,
"district_id" => 510105,
"community_id" => 0,
"address" => '',
"full_address" => '',
"longitude" => '104.064278',
"latitude" => '30.65649',
'is_pickup' => 0,
"open_date" => '上午9:00-12:00下午2:00-6:00',
"site_id" => $data['site_id'],
'start_time' => 0,
'end_time' => 0,
'time_type' => 0,
'time_week' => '',
'stock_type' => 'all',
'time_interval' => 30,
'delivery_time' => '',
'advance_day' => 0,
'is_default' => 1,
'most_day' => 7
);
$storeModel = new Store();
return $storeModel->addStore($store_data, [], $is_store);
}
return success();
}
}