diff --git a/application/admin/controller/article/WechatNews.php b/application/admin/controller/article/WechatNews.php
new file mode 100644
index 00000000..dea0f5f8
--- /dev/null
+++ b/application/admin/controller/article/WechatNews.php
@@ -0,0 +1,186 @@
+request);
+ if($cid)
+ $where['cid'] = $cid;
+ else
+ $where['cid'] = '';
+ $this->assign('where',$where);
+ $where['merchant'] = 0;//区分是管理员添加的图文显示 0 还是 商户添加的图文显示 1
+ $this->assign('cid',$cid);
+ $this->assign(ArticleModel::getAll($where));
+ return $this->fetch();
+ }
+
+ /**
+ * 展示页面 添加和删除
+ * @return mixed
+ */
+ public function create(){
+ $id = input('id');
+ $cid = input('cid');
+ $news = array();
+ $news['id'] = '';
+ $news['image_input'] = '';
+ $news['title'] = '';
+ $news['author'] = '';
+ $news['content'] = '';
+ $news['synopsis'] = '';
+ $news['url'] = '';
+ $news['cid'] = array();
+ if($id){
+ $news = \app\admin\model\wechat\WechatNews::where('n.id',$id)->alias('n')->field('n.*,c.content')->join('__WECHAT_NEWS_CONTENT__ c','c.nid=n.id')->find();
+ if(!$news) return $this->failedNotice('数据不存在!');
+ $news['cid'] = explode(',',$news['cid']);
+// dump($news);
+ }
+ $all = array();
+ $select = 0;
+ if(!$cid)
+ $cid = '';
+ else {
+ if($id){
+ $all = ArticleCategoryModel::where('id',$cid)->where('hidden','neq',0)->column('id,title');
+ $select = 1;
+ }else{
+ $all = ArticleCategoryModel::where('id',$cid)->column('id,title');
+ $select = 1;
+ }
+
+ }
+ if(empty($all)){
+ $all = ArticleCategoryModel::getField('id,title');//新闻分类
+ $select = 0;
+ }
+ $this->assign('all',$all);
+ $this->assign('news',$news);
+ $this->assign('cid',$cid);
+ $this->assign('select',$select);
+ return $this->fetch();
+ }
+
+ /**
+ * 上传图文图片
+ * @return \think\response\Json
+ */
+ public function upload_image(){
+ $res = Upload::Image($_POST['file'],'wechat/image/'.date('Ymd'));
+ //产品图片上传记录
+ $fileInfo = $res->fileInfo->getinfo();
+ SystemAttachment::attachmentAdd($res->fileInfo->getSaveName(),$fileInfo['size'],$fileInfo['type'],$res->dir,'',5);
+ if(!$res->status) return Json::fail($res->error);
+ return Json::successful('上传成功!',['url'=>$res->filePath]);
+ }
+
+ /**
+ * 添加和修改图文
+ * @param Request $request
+ * @return \think\response\Json
+ */
+ public function add_new(Request $request){
+ $post = $request->post();
+ $data = Util::postMore([
+ ['id',0],
+ ['cid',[]],
+ 'title',
+ 'author',
+ 'image_input',
+ 'content',
+ 'synopsis',
+ 'share_title',
+ 'share_synopsis',
+ ['visit',0],
+ ['sort',0],
+ 'url',
+ ['status',1],],$request);
+ $data['cid'] = implode(',',$data['cid']);
+ $content = $data['content'];
+ unset($data['content']);
+ if($data['id']){
+ $id = $data['id'];
+ unset($data['id']);
+ ArticleModel::beginTrans();
+ $res1 = ArticleModel::edit($data,$id,'id');
+ $res2 = ArticleModel::setContent($id,$content);
+ if($res1 && $res2)
+ $res = true;
+ else
+ $res =false;
+// dump($res);
+// exit();
+ ArticleModel::checkTrans($res);
+ if($res)
+ return Json::successful('修改图文成功!',$id);
+ else
+ return Json::fail('修改图文失败!',$id);
+ }else{
+ $data['add_time'] = time();
+ $data['admin_id'] = $this->adminId;
+ ArticleModel::beginTrans();
+ $res1 = ArticleModel::set($data);
+ $res2 = false;
+ if($res1)
+ $res2 = ArticleModel::setContent($res1->id,$content);
+ if($res1 && $res2)
+ $res = true;
+ else
+ $res =false;
+ ArticleModel::checkTrans($res);
+ if($res)
+ return Json::successful('添加图文成功!',$res1->id);
+ else
+ return Json::successful('添加图文失败!',$res1->id);
+ }
+ }
+
+ /**
+ * 删除图文
+ * @param $id
+ * @return \think\response\Json
+ */
+ public function delete($id)
+ {
+ $res = ArticleModel::del($id);
+ if(!$res)
+ return Json::fail('删除失败,请稍候再试!');
+ else
+ return Json::successful('删除成功!');
+ }
+
+ public function merchantIndex(){
+ $where = Util::getMore([
+ ['title','']
+ ],$this->request);
+ $this->assign('where',$where);
+ $where['cid'] = input('cid');
+ $where['merchant'] = 1;//区分是管理员添加的图文显示 0 还是 商户添加的图文显示 1
+ $this->assign(ArticleModel::getAll($where));
+ return $this->fetch();
+ }
+}
\ No newline at end of file
diff --git a/application/admin/controller/user/UserLevel.php b/application/admin/controller/user/UserLevel.php
new file mode 100644
index 00000000..27fd7608
--- /dev/null
+++ b/application/admin/controller/user/UserLevel.php
@@ -0,0 +1,335 @@
+fetch();
+ }
+
+ /*
+ * 创建form表单
+ * */
+ public function create($id=0)
+ {
+ if($id) $vipinfo=SystemUserLevel::get($id);
+ $field[]= Form::input('name','等级名称',isset($vipinfo) ? $vipinfo->name : '')->col(Form::col(24));
+ $field[]= Form::radio('is_forever','是否为永久',isset($vipinfo) ? $vipinfo->is_forever : 0)->options([['label'=>'永久','value'=>1],['label'=>'非永久','value'=>0]])->col(24);
+ $field[]= Form::number('money','等级价格',isset($vipinfo) ? $vipinfo->money : 0)->min(0)->col(24);
+ $field[]= Form::radio('is_pay','是否需要购买',isset($vipinfo) ? $vipinfo->is_pay : 0)->options([['label'=>'需要','value'=>1],['label'=>'免费','value'=>0]])->col(24);
+ $field[]= Form::number('valid_date','有效时间(天)',isset($vipinfo) ? $vipinfo->valid_date : 0)->min(0)->col(8);
+ $field[]= Form::number('grade','等级',isset($vipinfo) ? $vipinfo->grade : 0)->min(0)->col(8);
+ $field[]= Form::number('discount','享受折扣',isset($vipinfo) ? $vipinfo->discount : 0)->min(0)->col(8);
+ $field[]= Form::frameImageOne('icon','图标',Url::build('admin/widget.images/index',array('fodder'=>'icon')),isset($vipinfo) ? $vipinfo->icon : '')->icon('image')->width('100%')->height('500px');
+ $field[]= Form::frameImageOne('image','会员背景',Url::build('admin/widget.images/index',array('fodder'=>'image')),isset($vipinfo) ? $vipinfo->image : '')->icon('image')->width('100%')->height('500px');
+ $field[]= Form::radio('is_show','是否显示',isset($vipinfo) ? $vipinfo->is_show : 0)->options([['label'=>'显示','value'=>1],['label'=>'隐藏','value'=>0]])->col(8);
+ $field[]= Form::textarea('explain','等级说明',isset($vipinfo) ? $vipinfo->explain : '');
+ $form = Form::make_post_form('添加等级设置',$field,Url::build('save',['id'=>$id]),2);
+ $this->assign(compact('form'));
+ return $this->fetch('public/form-builder');
+ }
+
+ /*
+ * 会员等级添加或者修改
+ * @param $id 修改的等级id
+ * @return json
+ * */
+ public function save($id=0)
+ {
+ $data=UtilService::postMore([
+ ['name',''],
+ ['is_forever',0],
+ ['money',0],
+ ['is_pay',0],
+ ['valid_date',0],
+ ['grade',0],
+ ['discount',0],
+ ['icon',''],
+ ['image',''],
+ ['is_show',''],
+ ['explain',''],
+ ]);
+ if(!$data['name']) return JsonService::fail('请输入等级名称');
+ if(!$data['grade']) return JsonService::fail('请输入等级');
+ if(!$data['explain']) return JsonService::fail('请输入等级说明');
+ if($data['is_forever']==0 && !$data['valid_date']) return JsonService::fail('请输入有效时间(天)');
+ if($data['is_pay'] && !$data['money']) return JsonService::fail('请输入购买金额');
+ if(!$data['icon']) return JsonService::fail('请上传等级图标');
+ if(!$data['image']) return JsonService::fail('请上传等级背景图标');
+ SystemUserLevel::beginTrans();
+ try{
+ //修改
+ if($id){
+ if(SystemUserLevel::edit($data,$id)){
+ SystemUserLevel::commitTrans();
+ return JsonService::successful('修改成功');
+ }else{
+ SystemUserLevel::rollbackTrans();
+ return JsonService::fail('添加失败');
+ }
+ }else{
+ //新增
+ $data['add_time']=time();
+ if(SystemUserLevel::set($data)){
+ SystemUserLevel::commitTrans();
+ return JsonService::successful('添加成功');
+ }else{
+ SystemUserLevel::rollbackTrans();
+ return JsonService::fail('添加失败');
+ }
+ }
+ }catch (\Exception $e){
+ SystemUserLevel::rollbackTrans();
+ return JsonService::fail($e->getMessage());
+ }
+ }
+ /*
+ * 获取系统设置的vip列表
+ * @param int page
+ * @param int limit
+ * */
+ public function get_system_vip_list()
+ {
+ $where=UtilService::getMore([
+ ['page',0],
+ ['limit',10],
+ ['title',''],
+ ['is_show',''],
+ ]);
+ return JsonService::successlayui(SystemUserLevel::getSytemList($where));
+ }
+
+ /*
+ * 删除会员等级
+ * @param int $id
+ * */
+ public function delete($id=0)
+ {
+ if(SystemUserLevel::edit(['is_del'=>1],$id))
+ return JsonService::successful('删除成功');
+ else
+ return JsonService::fail('删除失败');
+ }
+
+ /**
+ * 设置单个产品上架|下架
+ *
+ * @return json
+ */
+ public function set_show($is_show='',$id=''){
+ ($is_show=='' || $id=='') && Json::fail('缺少参数');
+ $res=SystemUserLevel::where(['id'=>$id])->update(['is_show'=>(int)$is_show]);
+ if($res){
+ return JsonService::successful($is_show==1 ? '显示成功':'隐藏成功');
+ }else{
+ return JsonService::fail($is_show==1 ? '显示失败':'隐藏失败');
+ }
+ }
+
+ /**
+ * 快速编辑
+ *
+ * @return json
+ */
+ public function set_value($field='',$id='',$value=''){
+ $field=='' || $id=='' || $value=='' && Json::fail('缺少参数');
+ if(SystemUserLevel::where(['id'=>$id])->update([$field=>$value]))
+ return JsonService::successful('保存成功');
+ else
+ return JsonService::fail('保存失败');
+ }
+
+
+ /*
+ * 等级任务列表
+ * @param int $vip_id 等级id
+ * @return json
+ * */
+ public function tash($level_id=0)
+ {
+ $this->assign('level_id',$level_id);
+ return $this->fetch();
+ }
+
+ /**
+ * 快速编辑
+ *
+ * @return json
+ */
+ public function set_tash_value($field='',$id='',$value=''){
+ $field=='' || $id=='' || $value=='' && Json::fail('缺少参数');
+ if(SystemUserTask::where(['id'=>$id])->update([$field=>$value]))
+ return JsonService::successful('保存成功');
+ else
+ return JsonService::fail('保存失败');
+ }
+
+ /**
+ * 设置单个产品上架|下架
+ *
+ * @return json
+ */
+ public function set_tash_show($is_show='',$id=''){
+ ($is_show=='' || $id=='') && Json::fail('缺少参数');
+ $res=SystemUserTask::where(['id'=>$id])->update(['is_show'=>(int)$is_show]);
+ if($res){
+ return JsonService::successful($is_show==1 ? '显示成功':'隐藏成功');
+ }else{
+ return JsonService::fail($is_show==1 ? '显示失败':'隐藏失败');
+ }
+ }
+
+ /**
+ * 设置单个产品上架|下架
+ *
+ * @return json
+ */
+ public function set_tash_must($is_must='',$id=''){
+ ($is_must=='' || $id=='') && Json::fail('缺少参数');
+ $res=SystemUserTask::where(['id'=>$id])->update(['is_must'=>(int)$is_must]);
+ if($res){
+ return JsonService::successful('设置成功');
+ }else{
+ return JsonService::fail('设置失败');
+ }
+ }
+
+ /*
+ * 生成任务表单
+ * @param int $id 任务id
+ * @param int $vip_id 会员id
+ * @return html
+ * */
+ public function create_tash($id=0,$level_id=0)
+ {
+ if($id) $tash=SystemUserTask::get($id);
+ $field[]= Form::select('task_type','任务类型',isset($tash) ? $tash->task_type : '')->setOptions(function(){
+ $list = SystemUserTask::getTaskTypeAll();
+ $menus=[];
+ foreach ($list as $menu){
+ $menus[] = ['value'=>$menu['type'],'label'=>$menu['name'].'----单位['.$menu['unit'].']'];
+ }
+ return $menus;
+ })->filterable(1);
+ $field[]= Form::number('number','限定数量',isset($tash) ? $tash->number : 0)->min(0)->col(24);
+ $field[]= Form::number('sort','排序',isset($tash) ? $tash->sort : 0)->min(0)->col(24);
+ $field[]= Form::radio('is_show','是否显示',isset($tash) ? $tash->is_show : 1)->options([['label'=>'显示','value'=>1],['label'=>'隐藏','value'=>0]])->col(24);
+ $field[]= Form::radio('is_must','是否务必达成',isset($tash) ? $tash->is_must : 1)->options([['label'=>'务必达成','value'=>1],['label'=>'完成其一','value'=>0]])->col(24);
+ $field[]= Form::textarea('illustrate','任务说明',isset($tash) ? $tash->illustrate : '');
+ $form = Form::make_post_form('添加任务',$field,Url::build('save_tash',['id'=>$id,'level_id'=>$level_id]),2);
+ $this->assign(compact('form'));
+ return $this->fetch('public/form-builder');
+ }
+
+
+ /*
+ * 保存或者修改任务
+ * @param int $id 任务id
+ * @param int $vip_id 会员id
+ * */
+ public function save_tash($id=0,$level_id=0)
+ {
+ if(!$level_id) return JsonService::fail('缺少参数');
+ $data=UtilService::postMore([
+ ['task_type',''],
+ ['number',0],
+ ['is_show',0],
+ ['sort',0],
+ ['is_must',0],
+ ['illustrate',''],
+ ]);
+ if(!$data['task_type']) return JsonService::fail('请选择任务类型');
+ if($data['number'] < 0) return JsonService::fail('请输入限定数量');
+ $tash=SystemUserTask::getTaskType($data['task_type']);
+ if($tash['max_number']!=0 && $data['number'] > $tash['max_number']) return JsonService::fail('您设置的限定数量超出最大限制,最大限制为:'.$tash['max_number']);
+ $data['name']=SystemUserTask::setTaskName($data['task_type'],$data['number']);
+ try{
+ if($id){
+ SystemUserTask::edit($data,$id);
+ return JsonService::successful('修改成功');
+ }else{
+ $data['level_id']=$level_id;
+ $data['add_time']=time();
+ $data['real_name']=$tash['real_name'];
+ if(SystemUserTask::set($data))
+ return JsonService::successful('添加成功');
+ else
+ return JsonService::fail('添加失败');
+ }
+ }catch (\Exception $e){
+ return JsonService::fail($e->getMessage());
+ }
+ }
+
+ /*
+ * 异步获取等级任务列表
+ * @param int $vip_id 会员id
+ * @param int $page 分页
+ * @param int $limit 显示条数
+ * @return json
+ * */
+ public function get_tash_list($level_id=0)
+ {
+ list($page,$limit)=UtilService::getMore([
+ ['page',1],
+ ['limit',10],
+ ],$this->request,true);
+ return JsonService::successlayui(SystemUserTask::getTashList($level_id,(int)$page,(int)$limit));
+ }
+
+ /*
+ * 删除任务
+ * @param int 任务id
+ * */
+ public function delete_tash($id=0)
+ {
+ if(!$id) return JsonService::fail('缺少差参数');
+ if(SystemUserTask::del($id))
+ return JsonService::successful('删除成功');
+ else
+ return JsonService::fail('删除失败');
+ }
+
+ /*
+ * 会员等级展示
+ *
+ * */
+ public function user_level_list()
+ {
+ $this->assign('level',SystemUserLevel::where('is_del',0)->where('is_show',1)->order('grade asc')->field(['id','name'])->select());
+ return $this->fetch();
+ }
+
+ public function get_user_vip_list()
+ {
+ $where=UtilService::getMore([
+ ['page',1],
+ ['limit',10],
+ ['nickname',''],
+ ['level_id',''],
+ ]);
+ return JsonService::successlayui(UserLevelModel::getUserVipList($where));
+ }
+
+}
\ No newline at end of file
diff --git a/application/admin/model/system/SystemAttachmentType.php b/application/admin/model/system/SystemAttachmentType.php
new file mode 100644
index 00000000..76fe7ccd
--- /dev/null
+++ b/application/admin/model/system/SystemAttachmentType.php
@@ -0,0 +1,51 @@
+where($where)->order('att_id desc');
+ return $model->page($model,$where,'',30);
+ }
+ /**
+ * 获取单条信息
+ * */
+ public static function getinfo($att_id){
+ $model = new self;
+ $where['att_id'] = $att_id;
+ return $model->where($where)->select()->toArray()[0];
+ }
+
+}
\ No newline at end of file
diff --git a/application/admin/model/system/SystemUserLevel.php b/application/admin/model/system/SystemUserLevel.php
new file mode 100644
index 00000000..0f5526f8
--- /dev/null
+++ b/application/admin/model/system/SystemUserLevel.php
@@ -0,0 +1,53 @@
+
+ * @day: 2017/11/13
+ */
+
+namespace app\admin\model\system;
+
+use traits\ModelTrait;
+use basic\ModelBasic;
+
+/**
+ * 设置会员vip model
+ * Class SystemVip
+ * @package app\admin\model\system
+ */
+class SystemUserLevel extends ModelBasic
+{
+ use ModelTrait;
+
+ public static function setAddTimeAttr()
+ {
+ return time();
+ }
+ public static function getAddTimeAttr($value)
+ {
+ return date('Y-m-d H:i:s',$value);
+ }
+ /*
+ * 获取查询条件
+ * */
+ public static function setWhere($where,$alert='',$model=null)
+ {
+ $model=$model===null ? new self() : $model;
+ if($alert) $model=$model->alias($alert);
+ $alert=$alert ? $alert.'.': '';
+ if(isset($where['is_show']) && $where['is_show']!=='') $model=$model->where("{$alert}is_show",$where['is_show']);
+ if(isset($where['title']) && $where['title']) $model=$model->where("{$alert}name",'LIKE',"%$where[title]%");
+ return $model;
+ }
+ /*
+ * 查找系统设置的会员等级列表
+ * */
+ public static function getSytemList($where)
+ {
+ $data=self::setWhere($where)->order('grade asc')->page((int)$where['page'],(int)$where['limit'])->select();
+ $data=count($data) ? $data->toArray() : [];
+ $count=self::setWhere($where)->count();
+ return compact('data','count');
+ }
+
+}
\ No newline at end of file
diff --git a/application/admin/model/system/SystemUserTask.php b/application/admin/model/system/SystemUserTask.php
new file mode 100644
index 00000000..958ba1b5
--- /dev/null
+++ b/application/admin/model/system/SystemUserTask.php
@@ -0,0 +1,136 @@
+
+ * @day: 2017/11/13
+ */
+
+namespace app\admin\model\system;
+
+use app\admin\model\order\StoreOrder;
+use app\admin\model\user\User;
+use app\admin\model\user\UserBill;
+use app\admin\model\user\UserLevel;
+use app\admin\model\user\UserTaskFinish;
+use traits\ModelTrait;
+use basic\ModelBasic;
+
+/**
+ * 设置等级任务 model
+ * Class SystemVipTask
+ * @package app\admin\model\system
+ */
+class SystemUserTask extends ModelBasic
+{
+ use ModelTrait;
+
+ /*
+ * 任务类型
+ * type 记录在数据库中用来区分任务
+ * name 任务名 (任务名中的{$num}会自动替换成设置的数字 + 单位)
+ * max_number 最大设定数值 0为不限定
+ * min_number 最小设定数值
+ * unit 单位
+ * */
+ protected static $TaskType=[
+ [
+ 'type'=>'SatisfactionIntegral',
+ 'name'=>'满足积分{$num}',
+ 'real_name'=>'积分数',
+ 'max_number'=>0,
+ 'min_number'=>0,
+ 'unit'=>'分'
+ ],
+ [
+ 'type'=>'ConsumptionAmount',
+ 'name'=>'消费满{$num}',
+ 'real_name'=>'消费金额',
+ 'max_number'=>0,
+ 'min_number'=>0,
+ 'unit'=>'元'
+ ],
+ [
+ 'type'=>'ConsumptionFrequency',
+ 'name'=>'消费{$num}',
+ 'real_name'=>'消费次数',
+ 'max_number'=>0,
+ 'min_number'=>0,
+ 'unit'=>'次'
+ ],
+ [
+ 'type'=>'CumulativeAttendance',
+ 'name'=>'累计签到{$num}',
+ 'real_name'=>'累计签到',
+ 'max_number'=>365,
+ 'min_number'=>1,
+ 'unit'=>'天'
+ ],
+ [
+ 'type'=>'SharingTimes',
+ 'name'=>'分享给朋友{$num}',
+ 'real_name'=>'分享给朋友',
+ 'max_number'=>1000,
+ 'min_number'=>1,
+ 'unit'=>'次'
+ ],
+ [
+ 'type'=>'InviteGoodFriends',
+ 'name'=>'邀请好友{$num}成为下线',
+ 'real_name'=>'邀请好友成为下线',
+ 'max_number'=>1000,
+ 'min_number'=>1,
+ 'unit'=>'人'
+ ],
+ [
+ 'type'=>'InviteGoodFriendsLevel',
+ 'name'=>'邀请好友{$num}成为会员',
+ 'real_name'=>'邀请好友成为会员',
+ 'max_number'=>1000,
+ 'min_number'=>1,
+ 'unit'=>'人'
+ ],
+ ];
+
+ public function profile()
+ {
+ return $this->hasOne('SystemUserLevel','level_id','id')->field('name');
+ }
+
+ public static function getTaskTypeAll()
+ {
+ return self::$TaskType;
+ }
+
+ /*
+ * 获取某个任务
+ * */
+ public static function getTaskType($type)
+ {
+ foreach (self::$TaskType as $item){
+ if($item['type']==$type) return $item;
+ }
+ }
+
+ /*
+ * 设置任务名
+ * */
+ public static function setTaskName($type,$num)
+ {
+ $systemType=self::getTaskType($type);
+ return str_replace('{$num}',$num.$systemType['unit'],$systemType['name']);
+ }
+ /*
+ * 获取等级会员任务列表
+ * */
+ public static function getTashList($level_id,$page,$limit)
+ {
+ $data=self::where('level_id',$level_id)->order('sort desc,add_time desc')->page($page,$limit)->select();
+ $data=count($data) ? $data->toArray() : [];
+ foreach ($data as &$item){
+ $item['level_name']=SystemUserLevel::where('id',$item['level_id'])->value('name');
+ }
+ $count=self::where('level_id',$level_id)->count();
+ return compact('data','count');
+ }
+
+}
\ No newline at end of file
diff --git a/application/admin/model/user/UserLevel.php b/application/admin/model/user/UserLevel.php
new file mode 100644
index 00000000..ce0a01c1
--- /dev/null
+++ b/application/admin/model/user/UserLevel.php
@@ -0,0 +1,54 @@
+
+ * @day: 2017/11/11
+ */
+namespace app\admin\model\user;
+use app\admin\model\system\SystemUserLevel;
+use traits\ModelTrait;
+use basic\ModelBasic;
+/**
+ * 用户管理 model
+ * Class User
+ * @package app\admin\model\user
+ */
+class UserLevel extends ModelBasic
+{
+ use ModelTrait;
+
+ public static function setWhere($where,$alias='',$userAlias='u.',$model=null)
+ {
+ $model=is_null($model) ? new self() : $model;
+ if($alias){
+ $model=$model->alias($alias);
+ $alias.='.';
+ }
+ if(isset($where['nickname']) && $where['nickname']!='') $model=$model->where("{$userAlias}nickanme",$where['nickname']);
+ if(isset($where['level_id']) && $where['level_id']!='') $model=$model->where("{$alias}level_id",$where['level_id']);
+ return $model->where(["{$alias}status"=>1,"{$alias}is_del"=>0]);
+ }
+ /*
+ * 查询用户vip列表
+ * @param array $where
+ * */
+ public static function getUserVipList($where)
+ {
+ $data=self::setWhere($where,'a')->group('a.uid')->order('grade desc')
+ ->field(['a.*','u.nickname','u.avatar'])
+ ->join('__USER__ u','a.uid=u.uid')->page((int)$where['page'],(int)$where['limit'])->select();
+ $data=count($data) ? $data->toArray() : [];
+ foreach ($data as &$item){
+ $info=SystemUserLevel::where('id',$item['level_id'])->find();
+ if($info){
+ $item['name']=$info['name'];
+ $item['icon']=$info['icon'];
+ }
+ $item['is_forever']= $item['is_forever'] ? '永久会员':'限时会员';
+ $item['valid_time']=$item['is_forever'] ? '永久':date('Y-m-d H:i:s',$item['valid_time']);
+ }
+ $count=self::setWhere($where,'a')->group('a.level_id')->order('grade desc')->join('__USER__ u','a.uid=u.uid')->count();
+ return compact('data','count');
+ }
+
+}
\ No newline at end of file
diff --git a/application/admin/model/user/UserTaskFinish.php b/application/admin/model/user/UserTaskFinish.php
new file mode 100644
index 00000000..909b30ed
--- /dev/null
+++ b/application/admin/model/user/UserTaskFinish.php
@@ -0,0 +1,29 @@
+$uid,'task_id'=>$task_id])) return true;
+ return self::set(compact('uid','task_id','add_time'));
+ }
+}
\ No newline at end of file
diff --git a/application/admin/view/finance/finance/bill1.php b/application/admin/view/finance/finance/bill1.php
new file mode 100644
index 00000000..87f0e253
--- /dev/null
+++ b/application/admin/view/finance/finance/bill1.php
@@ -0,0 +1,58 @@
+{extend name="public/bootstraptable"}
+{block name="head"}
+
+{/block}
+{block name="content"}
+
+{/block}
+{block name="script"}
+
+
+{/block}
diff --git a/application/admin/view/public/layui.php b/application/admin/view/public/layui.php
new file mode 100644
index 00000000..45cf1b4b
--- /dev/null
+++ b/application/admin/view/public/layui.php
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+ {block name="head"}{/block}
+
+
+
+{block name="content"}{/block}
+{block name="script"}{/block}
+
+
+
+
diff --git a/application/admin/view/system/system_notice/index.php b/application/admin/view/system/system_notice/index.php
new file mode 100644
index 00000000..c54ca12c
--- /dev/null
+++ b/application/admin/view/system/system_notice/index.php
@@ -0,0 +1,93 @@
+{extend name="public/container"}
+{block name="content"}
+
+
+
+
+
+
+
+
+
+
+
+ | 编号 |
+ 标题 |
+ 关键字 |
+ 模板 |
+ 发送管理员 |
+ 状态 |
+ 操作 |
+
+
+
+ {volist name="list" id="vo"}
+
+ |
+ {$vo.id}
+ |
+
+ {$vo.title}
+ |
+
+ {$vo.type}
+ |
+
+ {$vo.template}
+ |
+
+ {$vo.push_admin_name}
+ |
+
+
+ |
+
+
+
+ |
+
+ {/volist}
+
+
+
+
+
+
+
+{/block}
+{block name="script"}
+
+{/block}
diff --git a/application/admin/view/system/system_notice/message.php b/application/admin/view/system/system_notice/message.php
new file mode 100644
index 00000000..49524e73
--- /dev/null
+++ b/application/admin/view/system/system_notice/message.php
@@ -0,0 +1,225 @@
+{extend name="public/container"}
+{block name="head_top"}
+
+{/block}
+{block name="content"}
+
+{/block}
diff --git a/application/admin/view/ump/store_seckill/attr.php b/application/admin/view/ump/store_seckill/attr.php
new file mode 100644
index 00000000..39d1dd83
--- /dev/null
+++ b/application/admin/view/ump/store_seckill/attr.php
@@ -0,0 +1,371 @@
+
+
+
+ {include file="public/head"}
+ {$title|default=''}
+
+
+
+
+
+
diff --git a/application/admin/view/user/user/group.php b/application/admin/view/user/user/group.php
new file mode 100644
index 00000000..16153b20
--- /dev/null
+++ b/application/admin/view/user/user/group.php
@@ -0,0 +1,76 @@
+{extend name="public/container"}
+{block name="content"}
+
+
+
+
+
+
+
+
+
+
+
+ | 编号 |
+ 身份昵称 |
+ 权限 |
+ 状态 |
+ 操作 |
+
+
+
+ {volist name="list" id="vo"}
+
+ |
+ {$vo.id}
+ |
+
+ {$vo.role_name}
+ |
+
+ {$vo.rules}
+ |
+
+
+ |
+
+
+
+ |
+
+ {/volist}
+
+
+
+ {include file="public/inner_page"}
+
+
+
+
+{/block}
+{block name="script"}
+
+{/block}
diff --git a/application/admin/view/user/user/rank.php b/application/admin/view/user/user/rank.php
new file mode 100644
index 00000000..16153b20
--- /dev/null
+++ b/application/admin/view/user/user/rank.php
@@ -0,0 +1,76 @@
+{extend name="public/container"}
+{block name="content"}
+
+
+
+
+
+
+
+
+
+
+
+ | 编号 |
+ 身份昵称 |
+ 权限 |
+ 状态 |
+ 操作 |
+
+
+
+ {volist name="list" id="vo"}
+
+ |
+ {$vo.id}
+ |
+
+ {$vo.role_name}
+ |
+
+ {$vo.rules}
+ |
+
+
+ |
+
+
+
+ |
+
+ {/volist}
+
+
+
+ {include file="public/inner_page"}
+
+
+
+
+{/block}
+{block name="script"}
+
+{/block}
diff --git a/application/admin/view/user/user_level/index.php b/application/admin/view/user/user_level/index.php
new file mode 100644
index 00000000..e2179559
--- /dev/null
+++ b/application/admin/view/user/user_level/index.php
@@ -0,0 +1,203 @@
+{extend name="public/container"}
+{block name="content"}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{/block}
+{block name="script"}
+
+{/block}
diff --git a/application/admin/view/user/user_level/tash.php b/application/admin/view/user/user_level/tash.php
new file mode 100644
index 00000000..bf52f8e3
--- /dev/null
+++ b/application/admin/view/user/user_level/tash.php
@@ -0,0 +1,168 @@
+{extend name="public/container"}
+{block name="content"}
+
+
+
+
+
+
+
+
+
+ 添加等级任务,任务类型中的{literal}{$num}{/literal}会自动替换成限定数量+系统预设的单位生成任务名
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{/block}
+{block name="script"}
+
+{/block}
diff --git a/application/admin/view/user/user_level/user_level_list.php b/application/admin/view/user/user_level/user_level_list.php
new file mode 100644
index 00000000..7719337a
--- /dev/null
+++ b/application/admin/view/user/user_level/user_level_list.php
@@ -0,0 +1,161 @@
+{extend name="public/container"}
+{block name="content"}
+
+
+{/block}
+{block name="script"}
+
+{/block}