123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- <?php
- /**
- * Niushop商城系统 - 团队十年电商经验汇集巨献!
- * =========================================================
- * Copy right 2019-2029 山西牛酷信息科技有限公司, 保留所有权利。
- * ----------------------------------------------
- * 官方网址: https://www.niushop.com.cn
- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用。
- * 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
- * =========================================================
- */
- namespace app\model\express;
- use app\model\system\Config as ConfigModel;
- use app\model\BaseModel;
- /**
- * 配送配置
- */
- class Config extends BaseModel
- {
-
- /*********************************************************************** 物流配送 start ***********************************************************************/
- /**
- * 物流配送配置
- * @param $site_id
- * @return \multitype
- */
- public function getExpressConfig($site_id){
- $config = new ConfigModel();
- $res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', 'shop'], ['config_key', '=', 'EXPRESS_CONFIG']]);
- return $res;
- }
- /**
- * 设置物流配送配置
- * @param $data
- * @return \multitype
- */
- public function setExpressConfig($data, $is_use, $site_id)
- {
- if ($site_id === '') {
- return $this->error('', 'REQUEST_SITE_ID');
- }
- $config = new ConfigModel();
- $res = $config->setConfig($data, '物流配送设置', $is_use, [['site_id', '=', $site_id], ['app_module', '=', 'shop'], ['config_key', '=', 'EXPRESS_CONFIG']]);
- return $res;
- }
- /*********************************************************************** 物流配送 end ***********************************************************************/
- /*********************************************************************** 门店自提 start ***********************************************************************/
- /**
- * 门店自提配置
- * @param $site_id
- * @return \multitype
- */
- public function getStoreConfig($site_id){
- $config = new ConfigModel();
- $res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', 'shop'], ['config_key', '=', 'EXPRESS_STORE_CONFIG']]);
- return $res;
- }
- /**
- * 设置门店自提配置
- * @param $data
- * @return \multitype
- */
- public function setStoreConfig($data, $is_use, $site_id)
- {
- if ($site_id === '') {
- return $this->error('', 'REQUEST_SITE_ID');
- }
- $config = new ConfigModel();
- $res = $config->setConfig($data, '门店自提配置设置', $is_use, [['site_id', '=', $site_id], ['app_module', '=', 'shop'], ['config_key', '=', 'EXPRESS_STORE_CONFIG']]);
- return $res;
- }
- /*********************************************************************** 门店自提 end ***********************************************************************/
- /*********************************************************************** 外卖配送 start ***********************************************************************/
- /**
- * 外卖配送配置
- * @param $site_id
- * @return \multitype
- */
- public function getLocalDeliveryConfig($site_id){
- $config = new ConfigModel();
- $res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', 'shop'], ['config_key', '=', 'EXPRESS_LOCAL_DELIVERY_CONFIG']]);
- return $res;
- }
- /**
- * 设置外卖配送配置
- * @param $data
- * @return \multitype
- */
- public function setLocalDeliveryConfig($data, $is_use, $site_id)
- {
- if ($site_id === '') {
- return $this->error('', '缺少必须参数站点id');
- }
- $config = new ConfigModel();
- $res = $config->setConfig($data, '外卖配送配置设置', $is_use, [['site_id', '=', $site_id], ['app_module', '=', 'shop'], ['config_key', '=', 'EXPRESS_LOCAL_DELIVERY_CONFIG']]);
- return $res;
- }
- /*********************************************************************** 外卖配送 end ***********************************************************************/
- }
|