Files
spacestation/common/models/app/licheb/App_licheb_users_model.php

65 lines
1.7 KiB
PHP

<?php
defined('BASEPATH') or exit('No direct script access allowed');
class App_licheb_users_model extends HD_Model
{
private $table_name = 'lc_app_licheb_users';
const GROUP_MANAGER = 1; // 车管家
const GROUP_BIZ = 2; // 店长
const GROUP_INVESTOR = 3; // 投资人
const GROUP_CUSTOMER_MANAGER = 4; // 客户成功经理
private $group_arr = [
self::GROUP_MANAGER => '车管家',
self::GROUP_BIZ => '店长',
self::GROUP_INVESTOR => '投资人',
self::GROUP_CUSTOMER_MANAGER => '客户成功经理'
];
public function __construct()
{
parent::__construct($this->table_name, 'default');
}
/**
* 根据id获取数据
* @param array() $ids
*/
public function get_map_by_ids($ids, $fileds = '')
{
$rows = [];
$ids = array_filter($ids);
if ($ids) {
$cf_ids = implode(',', $ids);
$where = [
"id in ($cf_ids)" => null
];
$rows = $this->map('id', '', $where, '', '', '', $fileds);
}
return $rows;
}
public function get_group()
{
return $this->group_arr;
}
/**
* 给店长发短信
* @param $bizId
* @param $content
* @return true
*/
public function sendSmsToManager($bizId, $content)
{
$where = array('biz_id' => $bizId, 'status' => 1, 'group_id' => 2);
$res_u = $this->select($where);
if ($res_u) {
foreach ($res_u as $v) {
ems_sms($v['mobile'], $content);
}
}
return true;
}
}