1
0
Files
helper/application/common/service/MemberList.php
2020-08-06 14:58:51 +08:00

61 lines
1.6 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
// +------------------------------------------------+
// |http://www.cjango.com |
// +------------------------------------------------+
// | 修复BUG不是一朝一夕的事情等我喝醉了再说吧 |
// +------------------------------------------------+
// | Author: 小陈叔叔 <Jason.Chen> |
// +------------------------------------------------+
namespace app\common\service;
use app\common\model\MemberList as MemberListModel;
use app\common\validate\MemberList as MemberListValidate;
class MemberList extends _Init
{
/**
* 添加信息
* @param [type] $data 文章数据
*/
public static function create($data, $uid)
{
$validate = new MemberListValidate();
if (!$validate->scene('add')->check($data)) {
return $validate->getError();
}
$info = MemberListModel::create($data);
if ($info) {
return true;
} else {
return '创建报单失败';
}
}
public static function edit($data)
{
$validate = new MemberListValidate();
if (!$validate->scene('add')->check($data)) {
return $validate->getError();
}
$info = MemberListModel::update($data);
if ($info) {
return true;
} else {
return '编辑失败';
}
}
public static function del($id)
{
$info = MemberListModel::get($id);
if (!$info) {
return '此人不存在';
} elseif ($info->save(['status' => '-1'])) {
return true;
} else {
return '删除失败';
}
}
}