1
0

first commit

This commit is contained in:
2020-08-06 14:58:51 +08:00
commit 17096657dc
780 changed files with 92857 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
<?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 '删除失败';
}
}
}