67 lines
2.1 KiB
PHP
67 lines
2.1 KiB
PHP
<?php
|
|
/**
|
|
* SAAS应用系统 --- 十年开发经验汇集巨献!
|
|
* ==========================================================
|
|
* Copy right 2020-2050 成都众联思索科技有限公司,保留所有权利。
|
|
* ----------------------------------------------------------
|
|
* 官方网址: https://www.zoomtk.com
|
|
* 这不是自由软件!未经允许不得用于商业目或程序代码摘取及修改。
|
|
* 任何企业和个人未经允许对程序代码以任何形式任何目的再发布传播。
|
|
* 唯一发布渠道www.zoomtk.com;非官方渠道统一视为侵权行为。
|
|
* ==========================================================
|
|
*/
|
|
namespace addon\saas\model;
|
|
use app\model\BaseModel;
|
|
class RegionLevel extends BaseModel
|
|
{
|
|
|
|
public function addRegionLevel($data)
|
|
{
|
|
$res = model('region_level')->add($data);
|
|
return $this->success($res);
|
|
}
|
|
|
|
|
|
/**
|
|
* @param $data
|
|
* @param $condition
|
|
* @return array
|
|
*/
|
|
public function editRegionLevel($data, $condition)
|
|
{
|
|
$res = model('region_level')->update($data, $condition);
|
|
return $this->success($res);
|
|
}
|
|
|
|
public function delRegionLevel($condition)
|
|
{
|
|
$res = model('region_level')->delete($condition);
|
|
return $this->success($res);
|
|
}
|
|
|
|
|
|
public function getRegionLevelList($condition, $field = "*", $order = '')
|
|
{
|
|
$res = model('region_level')->getList($condition, $field, $order);
|
|
return $this->success($res);
|
|
}
|
|
|
|
|
|
public function getRegionLevelPage($condition, $page = 1, $page_size = PAGE_LIST_ROWS, $field = "*", $order = '')
|
|
{
|
|
$res = model('region_level')->pageList($condition, $field, $order, $page, $page_size);
|
|
return $this->success($res);
|
|
}
|
|
|
|
|
|
public function getRegionLevelInfo($condition, $field = '*')
|
|
{
|
|
$res = model('region_level')->getInfo($condition, $field);
|
|
if($res){
|
|
$res['direct_site_rate'] = $res['reward_type'] == 1 ? $res['site_rate'] : 0;
|
|
$res['reward_site_rate'] = $res['reward_type'] == 2 ? $res['site_rate'] : 0;
|
|
}
|
|
return $this->success($res);
|
|
}
|
|
}
|