|
|
@ -6,6 +6,8 @@ const URL_BACK = 'url://back';
|
|||
use think\exception\HttpResponseException;
|
||||
use think\Response;
|
||||
use think\response\Redirect;
|
||||
use app\common\model\MallImage;
|
||||
use think\db;
|
||||
|
||||
if (!function_exists('success')) {
|
||||
|
||||
|
|
@ -51,3 +53,89 @@ if (!function_exists('result')) {
|
|||
throw new HttpResponseException($response);
|
||||
}
|
||||
}
|
||||
|
||||
if(!function_exists('goods_imgs_upload')){
|
||||
/**
|
||||
* 简单对称加密算法之解密
|
||||
* @param String $union_id 指定id
|
||||
* @param String $type 类型
|
||||
* @param String $ori_img 原图
|
||||
* @param String $thumb_img 缩略图
|
||||
* @param String $ori_fm_img 原图封面
|
||||
* @param String $thumb_img_f 缩略图封面
|
||||
* @param String $goods_imgs 编辑时数据库中图片
|
||||
* @date 20190906
|
||||
* @return li
|
||||
*/
|
||||
//上传商品图片
|
||||
function goods_imgs_upload($union_id,$type,$ori_img, $thumb_img,$ori_fm_img,$thumb_img_f,$goods_imgs=array())
|
||||
{
|
||||
$_goodsimgsModel= new MallImage();
|
||||
//$tps = C('TMPL_PARSE_STRING');
|
||||
$inequality_img=array();
|
||||
if($ori_img){
|
||||
$ori_img_ys=array();
|
||||
if($goods_imgs){
|
||||
foreach ($goods_imgs as $key=> $v){
|
||||
$ori_img_ys[$v['id']]=$v['ori_image'];
|
||||
$goods_imgs[$v['id']]=$v;
|
||||
}
|
||||
$inequality_img = array_diff($ori_img_ys,$ori_img);//前端踢掉的图片
|
||||
}
|
||||
foreach ($ori_img as $key=> $v){
|
||||
if(in_array($v,$ori_img_ys,TRUE)){
|
||||
if($v==$ori_fm_img && $thumb_img_f=$thumb_img[$key]){
|
||||
$data3['is_cover']=1;
|
||||
}else{
|
||||
$data3['is_cover']=0;
|
||||
}
|
||||
$_goodsimgsModel->where(array('ori_image'=>$v))->update($data3);
|
||||
continue;
|
||||
}
|
||||
$ori_img_url=trim($v);
|
||||
if(!$ori_img_url){
|
||||
$array = array(
|
||||
'code' =>400,
|
||||
'msg' =>'上传文件处理失败',
|
||||
);
|
||||
return $array;
|
||||
}
|
||||
$thumb_img_url=trim($thumb_img[$key]);
|
||||
if(!$thumb_img_url){
|
||||
$array = array(
|
||||
'code' =>400,
|
||||
'msg' =>'上传文件处理失败',
|
||||
);
|
||||
return $array;
|
||||
}
|
||||
$data1['ori_image']=$yu_url=$ori_img_url;
|
||||
$data1['thumb_image']=$slt_url=$thumb_img_url;
|
||||
if($v==$ori_fm_img && $thumb_img_f=$thumb_img[$key]){
|
||||
$data1['is_cover']=1;
|
||||
}else{
|
||||
$data1['is_cover']=0;
|
||||
}
|
||||
$data1['type']=$type;
|
||||
$data1['union_id']=$union_id;
|
||||
$_goodsimgsModel::create($data1);
|
||||
}
|
||||
if($inequality_img){
|
||||
foreach ($inequality_img as $key1=> $v1){
|
||||
$mag=Db::table('yo_mall_image')->where('id',$key1)->delete();
|
||||
if($mag){
|
||||
$ori_image_del=Env::get('root_path').'public'.$goods_imgs[$key1]['ori_image'];
|
||||
if(file_exists($ori_image_del))
|
||||
{
|
||||
unlink($ori_image_del);
|
||||
}
|
||||
$thumb_image_del=Env::get('root_path').'public'.$goods_imgs[$key1]['thumb_image'];
|
||||
if(file_exists($thumb_image_del))
|
||||
{
|
||||
unlink($thumb_image_del);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
<?php
|
||||
/**
|
||||
* 会员账户流水记录表控制器
|
||||
*/
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Request;
|
||||
use app\common\model\AccountLog;
|
||||
|
||||
use app\common\validate\AccountLogValidate;
|
||||
|
||||
class AccountLogController extends Controller
|
||||
{
|
||||
|
||||
//积分记录
|
||||
public function integrallist(Request $request, AccountLog $model)
|
||||
{
|
||||
$SOURCE_TYPE=$model->SOURCE_TYPE;
|
||||
$param = $request->param();
|
||||
|
||||
$where = [];
|
||||
if(isset($param['source_type']) && $param['source_type']){
|
||||
$source_type = $param['source_type'];
|
||||
$where[] = ['source_type','in',$source_type];
|
||||
}
|
||||
|
||||
if(isset($param['keyword']) && $param['keyword']){
|
||||
$where[] = [$param['keyword_type'],'like','%'.$param['keyword'].'%'];
|
||||
}
|
||||
if (isset($param['start_time']) && $param['start_time'] && isset($param['end_time']) && $param['end_time']) {
|
||||
$where[] = ['al.create_time', 'between', [strtotime($param['start_time']), strtotime($param['end_time'])]];
|
||||
}
|
||||
$model = $model
|
||||
->alias('al')
|
||||
->field('al.*,u.mobile,u.nickname,u.sn as user_sn,u.avatar')
|
||||
->join('user u', 'u.id = al.user_id')
|
||||
->where($where)
|
||||
->scope('where', $param);
|
||||
|
||||
$data = $model->paginate($this->admin['per_page'], false, ['query'=>$request->get()]);
|
||||
//关键词,排序等赋值
|
||||
$this->assign($request->get());
|
||||
|
||||
$this->assign([
|
||||
'data' => $data,
|
||||
'page' => $data->render(),
|
||||
'total' => $data->total(),
|
||||
'source_type_list'=>$SOURCE_TYPE,
|
||||
]);
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,103 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* 文章分类控制器
|
||||
*/
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Request;
|
||||
use app\common\model\ArticleCategory;
|
||||
|
||||
use app\common\validate\ArticleCategoryValidate;
|
||||
|
||||
class ArticleCategoryController extends Controller
|
||||
{
|
||||
|
||||
//列表
|
||||
public function index(Request $request, ArticleCategory $model)
|
||||
{
|
||||
|
||||
$data = $this->getTreeList($model);
|
||||
$this->assign([
|
||||
'data' => $data,
|
||||
|
||||
]);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//添加
|
||||
public function add(Request $request, ArticleCategory $model, ArticleCategoryValidate $validate)
|
||||
{
|
||||
if ($request->isPost()) {
|
||||
$param = $request->param();
|
||||
$validate_result = $validate->scene('add')->check($param);
|
||||
if (!$validate_result) {
|
||||
return error($validate->getError());
|
||||
}
|
||||
|
||||
$result = $model::create($param);
|
||||
|
||||
$url = URL_BACK;
|
||||
if (isset($param['_create']) && $param['_create'] == 1) {
|
||||
$url = URL_RELOAD;
|
||||
}
|
||||
|
||||
return $result ? success('添加成功', $url) : error();
|
||||
}
|
||||
|
||||
$this->assign([
|
||||
'cat_list' => $model::where('parent_id', 0)->select(),
|
||||
]);
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//修改
|
||||
public function edit($id, Request $request, ArticleCategory $model, ArticleCategoryValidate $validate)
|
||||
{
|
||||
|
||||
$data = $model::get($id);
|
||||
if ($request->isPost()) {
|
||||
$param = $request->param();
|
||||
$validate_result = $validate->scene('edit')->check($param);
|
||||
if (!$validate_result) {
|
||||
return error($validate->getError());
|
||||
}
|
||||
|
||||
$result = $data->save($param);
|
||||
return $result ? success() : error();
|
||||
}
|
||||
|
||||
$this->assign([
|
||||
'data' => $data,
|
||||
'cat_list' => $model::where('parent_id', 0)->select(),
|
||||
|
||||
]);
|
||||
return $this->fetch('add');
|
||||
|
||||
}
|
||||
|
||||
//删除
|
||||
public function del($id, ArticleCategory $model)
|
||||
{
|
||||
if (count($model->noDeletionId) > 0) {
|
||||
if (is_array($id)) {
|
||||
if (array_intersect($model->noDeletionId, $id)) {
|
||||
return error('ID为' . implode(',', $model->noDeletionId) . '的数据无法删除');
|
||||
}
|
||||
} else if (in_array($id, $model->noDeletionId)) {
|
||||
return error('ID为' . $id . '的数据无法删除');
|
||||
}
|
||||
}
|
||||
|
||||
if ($model->softDelete) {
|
||||
$result = $model->whereIn('id', $id)->useSoftDelete('delete_time', time())->delete();
|
||||
} else {
|
||||
$result = $model->whereIn('id', $id)->delete();
|
||||
}
|
||||
|
||||
return $result ? success('操作成功', URL_RELOAD) : error();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,141 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* 文章管理333333控制器
|
||||
*/
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Request;
|
||||
use app\common\model\Article;
|
||||
|
||||
use app\common\validate\ArticleValidate;
|
||||
|
||||
class ArticleController extends Controller
|
||||
{
|
||||
|
||||
//列表
|
||||
public function index(Request $request, Article $model)
|
||||
{
|
||||
$param = $request->param();
|
||||
$model = $model->scope('where', $param);
|
||||
|
||||
$data = $model->paginate($this->admin['per_page'], false, ['query'=>$request->get()]);
|
||||
//关键词,排序等赋值
|
||||
$this->assign($request->get());
|
||||
|
||||
$this->assign([
|
||||
'data' => $data,
|
||||
'page' => $data->render(),
|
||||
'total' => $data->total(),
|
||||
]);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//添加
|
||||
public function add(Request $request, Article $model, ArticleValidate $validate)
|
||||
{
|
||||
if ($request->isPost()) {
|
||||
$param = $request->param();
|
||||
$validate_result = $validate->scene('add')->check($param);
|
||||
if (!$validate_result) {
|
||||
return error($validate->getError());
|
||||
}
|
||||
$param['content'] = $request->param(false)['content'];
|
||||
|
||||
//处理缩略图上传
|
||||
$attachment_img = new \app\common\model\Attachment;
|
||||
$file_img = $attachment_img->upload('img');
|
||||
if ($file_img) {
|
||||
$param['img'] = $file_img->url;
|
||||
} else {
|
||||
return error($attachment_img->getError());
|
||||
}
|
||||
|
||||
|
||||
$result = $model::create($param);
|
||||
|
||||
$url = URL_BACK;
|
||||
if(isset($param['_create']) && $param['_create']==1){
|
||||
$url = URL_RELOAD;
|
||||
}
|
||||
|
||||
return $result ? success('添加成功',$url) : error();
|
||||
}
|
||||
|
||||
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//修改
|
||||
public function edit($id, Request $request, Article $model, ArticleValidate $validate)
|
||||
{
|
||||
|
||||
$data = $model::get($id);
|
||||
if ($request->isPost()) {
|
||||
$param = $request->param();
|
||||
$validate_result = $validate->scene('edit')->check($param);
|
||||
if (!$validate_result) {
|
||||
return error($validate->getError());
|
||||
}
|
||||
$param['content'] = $request->param(false)['content'];
|
||||
|
||||
//处理缩略图上传
|
||||
if (!empty($_FILES['img']['name'])) {
|
||||
$attachment_img = new \app\common\model\Attachment;
|
||||
$file_img = $attachment_img->upload('img');
|
||||
if ($file_img) {
|
||||
$param['img'] = $file_img->url;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$result = $data->save($param);
|
||||
return $result ? success() : error();
|
||||
}
|
||||
|
||||
$this->assign([
|
||||
'data' => $data,
|
||||
|
||||
]);
|
||||
return $this->fetch('add');
|
||||
|
||||
}
|
||||
|
||||
//删除
|
||||
public function del($id, Article $model)
|
||||
{
|
||||
if (count($model->noDeletionId) > 0) {
|
||||
if (is_array($id)) {
|
||||
if (array_intersect($model->noDeletionId, $id)) {
|
||||
return error('ID为' . implode(',', $model->noDeletionId) . '的数据无法删除');
|
||||
}
|
||||
} else if (in_array($id, $model->noDeletionId)) {
|
||||
return error('ID为' . $id . '的数据无法删除');
|
||||
}
|
||||
}
|
||||
|
||||
if ($model->softDelete) {
|
||||
$result = $model->whereIn('id', $id)->useSoftDelete('delete_time', time())->delete();
|
||||
} else {
|
||||
$result = $model->whereIn('id', $id)->delete();
|
||||
}
|
||||
|
||||
return $result ? success('操作成功', URL_RELOAD) : error();
|
||||
}
|
||||
|
||||
//启用
|
||||
public function enable($id,Article $model)
|
||||
{
|
||||
$result = $model->whereIn('id',$id)->update(['status'=>1]);
|
||||
return $result ? success('操作成功', URL_RELOAD) : error();
|
||||
}
|
||||
|
||||
|
||||
//禁用
|
||||
public function disable($id,Article $model)
|
||||
{
|
||||
$result = $model->whereIn('id',$id)->update(['status'=>0]);
|
||||
return $result ? success('操作成功', URL_RELOAD) : error();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,123 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* 品牌控制器
|
||||
*/
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Request;
|
||||
use app\common\model\Brand;
|
||||
|
||||
use app\common\validate\BrandValidate;
|
||||
|
||||
class BrandController extends Controller
|
||||
{
|
||||
|
||||
//列表
|
||||
public function index(Request $request, Brand $model)
|
||||
{
|
||||
$param = $request->param();
|
||||
$model = $model->scope('where', $param);
|
||||
|
||||
$data = $model->paginate($this->admin['per_page'], false, ['query' => $request->get()]);
|
||||
//关键词,排序等赋值
|
||||
$this->assign($request->get());
|
||||
|
||||
$this->assign([
|
||||
'data' => $data,
|
||||
'page' => $data->render(),
|
||||
'total' => $data->total(),
|
||||
]);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//添加
|
||||
public function add(Request $request, Brand $model, BrandValidate $validate)
|
||||
{
|
||||
if ($request->isPost()) {
|
||||
$param = $request->param();
|
||||
$validate_result = $validate->scene('add')->check($param);
|
||||
if (!$validate_result) {
|
||||
return error($validate->getError());
|
||||
}
|
||||
//处理图片上传
|
||||
$attachment_img = new \app\common\model\Attachment;
|
||||
$file_img = $attachment_img->upload('img');
|
||||
if ($file_img) {
|
||||
$param['img'] = $file_img->url;
|
||||
} else {
|
||||
return error($attachment_img->getError());
|
||||
}
|
||||
|
||||
|
||||
$result = $model::create($param);
|
||||
|
||||
$url = URL_BACK;
|
||||
if (isset($param['_create']) && $param['_create'] == 1) {
|
||||
$url = URL_RELOAD;
|
||||
}
|
||||
|
||||
return $result ? success('添加成功', $url) : error();
|
||||
}
|
||||
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//修改
|
||||
public function edit($id, Request $request, Brand $model, BrandValidate $validate)
|
||||
{
|
||||
|
||||
$data = $model::get($id);
|
||||
if ($request->isPost()) {
|
||||
$param = $request->param();
|
||||
$validate_result = $validate->scene('edit')->check($param);
|
||||
if (!$validate_result) {
|
||||
return error($validate->getError());
|
||||
}
|
||||
//处理图片上传
|
||||
if (!empty($_FILES['img']['name'])) {
|
||||
$attachment_img = new \app\common\model\Attachment;
|
||||
$file_img = $attachment_img->upload('img');
|
||||
if ($file_img) {
|
||||
$param['img'] = $file_img->url;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$result = $data->save($param);
|
||||
return $result ? success() : error();
|
||||
}
|
||||
|
||||
$this->assign([
|
||||
'data' => $data,
|
||||
|
||||
]);
|
||||
return $this->fetch('add');
|
||||
|
||||
}
|
||||
|
||||
//删除
|
||||
public function del($id, Brand $model)
|
||||
{
|
||||
if (count($model->noDeletionId) > 0) {
|
||||
if (is_array($id)) {
|
||||
if (array_intersect($model->noDeletionId, $id)) {
|
||||
return error('ID为' . implode(',', $model->noDeletionId) . '的数据无法删除');
|
||||
}
|
||||
} else if (in_array($id, $model->noDeletionId)) {
|
||||
return error('ID为' . $id . '的数据无法删除');
|
||||
}
|
||||
}
|
||||
|
||||
if ($model->softDelete) {
|
||||
$result = $model->whereIn('id', $id)->useSoftDelete('delete_time', time())->delete();
|
||||
} else {
|
||||
$result = $model->whereIn('id', $id)->delete();
|
||||
}
|
||||
|
||||
return $result ? success('操作成功', URL_RELOAD) : error();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,123 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* 收货地址控制器
|
||||
*/
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Request;
|
||||
use app\common\model\DeliverAddress;
|
||||
use app\common\model\User;
|
||||
use yupoxiong\region\model\Region;
|
||||
|
||||
|
||||
use app\common\validate\DeliverAddressValidate;
|
||||
|
||||
class DeliverAddressController extends Controller
|
||||
{
|
||||
|
||||
//列表
|
||||
public function index(Request $request, DeliverAddress $model)
|
||||
{
|
||||
$param = $request->param();
|
||||
$model = $model->with('user,province,city,district,street')->scope('where', $param);
|
||||
|
||||
$data = $model->paginate($this->admin['per_page'], false, ['query' => $request->get()]);
|
||||
//关键词,排序等赋值
|
||||
$this->assign($request->get());
|
||||
|
||||
$this->assign([
|
||||
'data' => $data,
|
||||
'page' => $data->render(),
|
||||
'total' => $data->total(),
|
||||
]);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//添加
|
||||
public function add(Request $request, DeliverAddress $model, DeliverAddressValidate $validate, Region $region)
|
||||
{
|
||||
if ($request->isPost()) {
|
||||
$param = $request->param();
|
||||
$validate_result = $validate->scene('add')->check($param);
|
||||
if (!$validate_result) {
|
||||
return error($validate->getError());
|
||||
}
|
||||
|
||||
$result = $model::create($param);
|
||||
|
||||
$url = URL_BACK;
|
||||
if (isset($param['_create']) && $param['_create'] == 1) {
|
||||
$url = URL_RELOAD;
|
||||
}
|
||||
|
||||
return $result ? success('添加成功', $url) : error();
|
||||
}
|
||||
|
||||
$this->assign([
|
||||
'user_list' => User::all(),
|
||||
'province_list' => $region->getProvince(),
|
||||
'city_list' => $region->getCity(1),
|
||||
'district_list' => $region->getDistrict(1),
|
||||
'street_list' => $region->getStreet(1),
|
||||
|
||||
]);
|
||||
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//修改
|
||||
public function edit($id, Request $request, DeliverAddress $model, DeliverAddressValidate $validate, Region $region)
|
||||
{
|
||||
|
||||
$data = $model::get($id);
|
||||
if ($request->isPost()) {
|
||||
$param = $request->param();
|
||||
$validate_result = $validate->scene('edit')->check($param);
|
||||
if (!$validate_result) {
|
||||
return error($validate->getError());
|
||||
}
|
||||
|
||||
$result = $data->save($param);
|
||||
return $result ? success() : error();
|
||||
}
|
||||
|
||||
$this->assign([
|
||||
'data' => $data,
|
||||
'user_list' => User::all(),
|
||||
'province_list' => $region->getProvince(),
|
||||
'city_list' => $region->getCity(1),
|
||||
'district_list' => $region->getDistrict(1),
|
||||
'street_list' => $region->getStreet(1),
|
||||
|
||||
|
||||
]);
|
||||
return $this->fetch('add');
|
||||
|
||||
}
|
||||
|
||||
//删除
|
||||
public function del($id, DeliverAddress $model)
|
||||
{
|
||||
if (count($model->noDeletionId) > 0) {
|
||||
if (is_array($id)) {
|
||||
if (array_intersect($model->noDeletionId, $id)) {
|
||||
return error('ID为' . implode(',', $model->noDeletionId) . '的数据无法删除');
|
||||
}
|
||||
} else if (in_array($id, $model->noDeletionId)) {
|
||||
return error('ID为' . $id . '的数据无法删除');
|
||||
}
|
||||
}
|
||||
|
||||
if ($model->softDelete) {
|
||||
$result = $model->whereIn('id', $id)->useSoftDelete('delete_time', time())->delete();
|
||||
} else {
|
||||
$result = $model->whereIn('id', $id)->delete();
|
||||
}
|
||||
|
||||
return $result ? success('操作成功', URL_RELOAD) : error();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,175 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* 常用功能集合
|
||||
*/
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
|
||||
use Endroid\QrCode\ErrorCorrectionLevel;
|
||||
use Endroid\QrCode\LabelAlignment;
|
||||
use Endroid\QrCode\QrCode;
|
||||
use Overtrue\EasySms\EasySms;
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use think\Request;
|
||||
|
||||
class DemoController extends Controller
|
||||
{
|
||||
|
||||
//邮件页面
|
||||
public function email()
|
||||
{
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
//发送邮件功能
|
||||
public function sendEmail(Request $request)
|
||||
{
|
||||
$param = $request->param();
|
||||
|
||||
$config = config('email.smtp');
|
||||
$mail = new PHPMailer(true); // Passing `true` enables exceptions
|
||||
try {
|
||||
|
||||
$address = $param['address'];
|
||||
$subject = $param['subject'];
|
||||
$content = $param['content'];
|
||||
$full_content = $request->param(false)['content'];
|
||||
|
||||
//服务器配置
|
||||
$mail->CharSet = "UTF-8"; //设定邮件编码
|
||||
$mail->SMTPDebug = 0; // 调试模式输出
|
||||
$mail->isSMTP(); // 使用SMTP
|
||||
$mail->Host = $config['host']; // SMTP服务器
|
||||
$mail->SMTPAuth = true; // 允许 SMTP 认证
|
||||
$mail->Username = $config['username']; // SMTP 用户名 即邮箱的用户名
|
||||
$mail->Password = $config['password']; // SMTP 密码 部分邮箱是授权码(例如163邮箱)
|
||||
$mail->SMTPSecure = 'ssl'; // 允许 TLS 或者ssl协议
|
||||
$mail->Port = 465; // 服务器端口 25 或者465 具体要看邮箱服务器支持
|
||||
|
||||
$mail->setFrom($config['address'], $config['name']); //发件人
|
||||
$mail->addAddress($address, $address); // 收件人
|
||||
//$mail->addAddress('ellen@example.com'); // 可添加多个收件人
|
||||
$mail->addReplyTo($config['address'], $config['name']); //回复的时候回复给哪个邮箱 建议和发件人一致
|
||||
//$mail->addCC('cc@example.com'); //抄送
|
||||
//$mail->addBCC('bcc@example.com'); //密送
|
||||
|
||||
//发送附件
|
||||
// $mail->addAttachment('../xy.zip'); // 添加附件
|
||||
//$mail->addAttachment(app()->getRootPath() . 'public/uploads/attachment/20190902/6a673f554c694a41971fca94c7503315.jpg', 'test.jpg'); // 发送附件并且重命名
|
||||
|
||||
//Content
|
||||
$mail->isHTML(true); // 是否以HTML文档格式发送 发送后客户端可直接显示对应HTML内容
|
||||
$mail->Subject = $subject;
|
||||
$mail->Body = $full_content;
|
||||
$mail->AltBody = $content;
|
||||
|
||||
$mail->send();
|
||||
$result = true;
|
||||
$msg = '邮件发送成功';
|
||||
} catch (\Exception $e) {
|
||||
$msg = '邮件发送失败,错误信息:' . $mail->ErrorInfo;
|
||||
$result = false;
|
||||
}
|
||||
|
||||
return $result ? success('成功', URL_RELOAD, '') : error($msg);
|
||||
}
|
||||
|
||||
//短信页面
|
||||
public function sms()
|
||||
{
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//发送短信功能
|
||||
public function sendSms(Request $request)
|
||||
{
|
||||
$param = $request->param();
|
||||
$config = config('sms.');
|
||||
$easySms = new EasySms($config);
|
||||
|
||||
try {
|
||||
$result = $easySms->send($param['mobile'], [
|
||||
'template' => 'SMS_001',
|
||||
'data' => [
|
||||
'code' => 543260
|
||||
],
|
||||
]);
|
||||
$success = true;
|
||||
$msg = '发送成功';
|
||||
} catch (\Exception $e) {
|
||||
$success = false;
|
||||
$msg = $e->getMessage();
|
||||
}
|
||||
|
||||
if (!$success || $result['aliyun']['status'] !== 'success') {
|
||||
return error($msg);
|
||||
}
|
||||
|
||||
return success($msg);
|
||||
}
|
||||
|
||||
|
||||
//二维码页面
|
||||
public function qrCode()
|
||||
{
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
//生成二维码功能
|
||||
public function createQrCode(Request $request)
|
||||
{
|
||||
$param = $request->param();
|
||||
|
||||
$content = $param['content'] ?? '麻烦输入内容OK?';
|
||||
|
||||
//创建码,$content为二维码内容
|
||||
$qrCode = new QrCode($content);
|
||||
//设置尺寸
|
||||
$qrCode->setSize(300);
|
||||
//可以设置binary,png,svg,eps,debug
|
||||
$qrCode->setWriterByName('png');
|
||||
//设置边距
|
||||
$qrCode->setMargin(10);
|
||||
//编码
|
||||
$qrCode->setEncoding('UTF-8');
|
||||
//容错等级
|
||||
$qrCode->setErrorCorrectionLevel(new ErrorCorrectionLevel(ErrorCorrectionLevel::HIGH));
|
||||
//前景色
|
||||
$qrCode->setForegroundColor(['r' => 0, 'g' => 0, 'b' => 0, 'a' => 0]);
|
||||
//背景色
|
||||
$qrCode->setBackgroundColor(['r' => 255, 'g' => 255, 'b' => 255, 'a' => 0]);
|
||||
//标签
|
||||
$qrCode->setLabel('Admin Demo QrCode', 16, null, LabelAlignment::CENTER);
|
||||
//logo地址
|
||||
|
||||
|
||||
$qrCode->setLogoPath(app()->getRootPath() . 'public/uploads/attachment/20190902/6a673f554c694a41971fca94c7503315.jpg');
|
||||
//logo大小
|
||||
$qrCode->setLogoSize(100, 100);
|
||||
//块尺寸设置为整数,默认为true
|
||||
$qrCode->setRoundBlockSize(true);
|
||||
//验证结果
|
||||
$qrCode->setValidateResult(false);
|
||||
//写入选项
|
||||
$qrCode->setWriterOptions(['exclude_xml_declaration' => true]);
|
||||
|
||||
//直接输出图片
|
||||
//header('Content-Type: '.$qrCode->getContentType());
|
||||
//return $qrCode->writeString();
|
||||
|
||||
$file_name = random_int(1, 5);
|
||||
//保存成文件
|
||||
$qrCode->writeFile(app()->getRootPath() . 'public/demo/qrcode/' . $file_name . '.png');
|
||||
$code_url = '/demo/qrcode/' . $file_name . '.png';
|
||||
|
||||
return success('生成成功', URL_CURRENT, ['qrcode' => $code_url]);
|
||||
|
||||
|
||||
// Create a response object
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* 编辑器server
|
||||
* @author yupoxiong<i@yufuping.com>
|
||||
*/
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Request;
|
||||
use tools\UEditor;
|
||||
|
||||
class EditorController extends Controller
|
||||
{
|
||||
|
||||
//编辑器上传等url
|
||||
public function server(Request $request)
|
||||
{
|
||||
$param = $request->param();
|
||||
$config = config('ueditor.');
|
||||
$action = $param['action'];
|
||||
$editor = new UEditor($config);
|
||||
return $editor->server($action);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,105 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* 快递控制器
|
||||
*/
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Request;
|
||||
use app\common\model\Express;
|
||||
|
||||
use app\common\validate\ExpressValidate;
|
||||
|
||||
class ExpressController extends Controller
|
||||
{
|
||||
|
||||
//列表
|
||||
public function index(Request $request, Express $model)
|
||||
{
|
||||
$param = $request->param();
|
||||
$model = $model->scope('where', $param);
|
||||
|
||||
$data = $model->paginate($this->admin['per_page'], false, ['query' => $request->get()]);
|
||||
//关键词,排序等赋值
|
||||
$this->assign($request->get());
|
||||
|
||||
$this->assign([
|
||||
'data' => $data,
|
||||
'page' => $data->render(),
|
||||
'total' => $data->total(),
|
||||
]);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//添加
|
||||
public function add(Request $request, Express $model, ExpressValidate $validate)
|
||||
{
|
||||
if ($request->isPost()) {
|
||||
$param = $request->param();
|
||||
$validate_result = $validate->scene('add')->check($param);
|
||||
if (!$validate_result) {
|
||||
return error($validate->getError());
|
||||
}
|
||||
|
||||
$result = $model::create($param);
|
||||
|
||||
$url = URL_BACK;
|
||||
if (isset($param['_create']) && $param['_create'] == 1) {
|
||||
$url = URL_RELOAD;
|
||||
}
|
||||
|
||||
return $result ? success('添加成功', $url) : error();
|
||||
}
|
||||
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//修改
|
||||
public function edit($id, Request $request, Express $model, ExpressValidate $validate)
|
||||
{
|
||||
|
||||
$data = $model::get($id);
|
||||
if ($request->isPost()) {
|
||||
$param = $request->param();
|
||||
$validate_result = $validate->scene('edit')->check($param);
|
||||
if (!$validate_result) {
|
||||
return error($validate->getError());
|
||||
}
|
||||
|
||||
$result = $data->save($param);
|
||||
return $result ? success() : error();
|
||||
}
|
||||
|
||||
$this->assign([
|
||||
'data' => $data,
|
||||
|
||||
]);
|
||||
return $this->fetch('add');
|
||||
|
||||
}
|
||||
|
||||
//删除
|
||||
public function del($id, Express $model)
|
||||
{
|
||||
if (count($model->noDeletionId) > 0) {
|
||||
if (is_array($id)) {
|
||||
if (array_intersect($model->noDeletionId, $id)) {
|
||||
return error('ID为' . implode(',', $model->noDeletionId) . '的数据无法删除');
|
||||
}
|
||||
} else if (in_array($id, $model->noDeletionId)) {
|
||||
return error('ID为' . $id . '的数据无法删除');
|
||||
}
|
||||
}
|
||||
|
||||
if ($model->softDelete) {
|
||||
$result = $model->whereIn('id', $id)->useSoftDelete('delete_time', time())->delete();
|
||||
} else {
|
||||
$result = $model->whereIn('id', $id)->delete();
|
||||
}
|
||||
|
||||
return $result ? success('操作成功', URL_RELOAD) : error();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
/**
|
||||
* 后台首页控制器
|
||||
* @author yupoxiong<i@yufuping.com>
|
||||
*/
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\model\AdminLog;
|
||||
use app\admin\model\AdminMenu;
|
||||
use app\admin\model\AdminRole;
|
||||
use app\admin\model\AdminUser;
|
||||
use tools\SystemInfo;
|
||||
use think\Request;
|
||||
|
||||
class FinanceController extends Controller
|
||||
{
|
||||
public function lists(Request $request)
|
||||
{
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,170 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* 商品规格设置控制器
|
||||
*/
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Request;
|
||||
use app\common\model\GoodsAttrCategory;
|
||||
use app\common\model\GoodsAttr;
|
||||
use think\db;
|
||||
use app\common\validate\GoodsAttrCategoryValidate;
|
||||
|
||||
class GoodsAttrCategoryController extends Controller
|
||||
{
|
||||
|
||||
//列表
|
||||
public function index(Request $request, GoodsAttrCategory $model)
|
||||
{
|
||||
$param = $request->param();
|
||||
$model = $model->scope('where', $param);
|
||||
|
||||
$data = $model->paginate($this->admin['per_page'], false, ['query'=>$request->get()]);
|
||||
//关键词,排序等赋值
|
||||
$this->assign($request->get());
|
||||
|
||||
$this->assign([
|
||||
'data' => $data,
|
||||
'page' => $data->render(),
|
||||
'total' => $data->total(),
|
||||
]);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//添加
|
||||
public function add(Request $request, GoodsAttrCategory $model,GoodsAttr $gamodel, GoodsAttrCategoryValidate $validate)
|
||||
{
|
||||
if ($request->isPost()) {
|
||||
$param = $request->param();
|
||||
$validate_result = $validate->scene('add')->check($param);
|
||||
if (!$validate_result) {
|
||||
return error($validate->getError());
|
||||
}
|
||||
$attrcategory['name']=$param['name'];
|
||||
// 启动事务
|
||||
$model->startTrans();
|
||||
try{
|
||||
$result = $model::create($attrcategory);
|
||||
$class_id=$result->id;
|
||||
$field_data = [];
|
||||
foreach ($param['attr_name'] as $key => $value) {
|
||||
$field_data[] = [
|
||||
'attr_name' => $param['attr_name'][$key][0],
|
||||
'attr_class_id' => $class_id,
|
||||
'attr_index' =>0,
|
||||
'attr_values' =>'',
|
||||
'sort_order' => $param['sort_order'][$key][0] ?? 255,
|
||||
];
|
||||
}
|
||||
$gamodel::insertAll($field_data);
|
||||
// 提交事务
|
||||
$model->commit();
|
||||
}catch(\Exception $e){
|
||||
// 回滚事务
|
||||
$model->rollback();
|
||||
return error('添加失败');
|
||||
}
|
||||
$url = URL_BACK;
|
||||
if(isset($param['_create']) && $param['_create']==1){
|
||||
$url = URL_RELOAD;
|
||||
}
|
||||
return success('添加成功',$url);
|
||||
}
|
||||
$this->assign([
|
||||
'gamodel_count'=>0,
|
||||
]);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
//修改
|
||||
public function edit($id, Request $request, GoodsAttrCategory $model,GoodsAttr $gamodel, GoodsAttrCategoryValidate $validate)
|
||||
{
|
||||
|
||||
$data = $model::get($id);
|
||||
if ($request->isPost()) {
|
||||
$param = $request->param();
|
||||
$validate_result = $validate->scene('edit')->check($param);
|
||||
if (!$validate_result) {
|
||||
return error($validate->getError());
|
||||
}
|
||||
$attrcategory['name']=$param['name'];
|
||||
// 启动事务
|
||||
$model->startTrans();
|
||||
try{
|
||||
$model->where('id',$id)->update($attrcategory);
|
||||
$where[]=array('attr_class_id','=',$id);
|
||||
Db::table('goods_attr')->where($where)->delete();
|
||||
$field_data = [];
|
||||
foreach ($param['attr_name'] as $key => $value) {
|
||||
$field_data[] = [
|
||||
'attr_name' => $param['attr_name'][$key][0],
|
||||
'attr_class_id' => $id,
|
||||
'attr_index' =>0,
|
||||
'attr_values' =>'',
|
||||
'sort_order' => $param['sort_order'][$key][0] ?? 255,
|
||||
];
|
||||
}
|
||||
$gamodel::insertAll($field_data);
|
||||
// 提交事务
|
||||
$model->commit();
|
||||
}catch(\Exception $e){
|
||||
$msg='提交失败';
|
||||
// 回滚事务
|
||||
$model->rollback();
|
||||
return error($msg);//
|
||||
}
|
||||
|
||||
|
||||
|
||||
$result = $data->save($param);
|
||||
return $result ? success() : error();
|
||||
}
|
||||
$gamodel_list=$gamodel->field('attr_name,sort_order')->where(array('attr_class_id'=>$id))->select();
|
||||
$gamodel_l=array();
|
||||
foreach ($gamodel_list as $k1 =>$v1) {
|
||||
$key=$k1+1;
|
||||
$gamodel_l[$key]['attr_name']=$v1['attr_name'];
|
||||
$gamodel_l[$key]['sort_order']=$v1['sort_order'];
|
||||
}
|
||||
|
||||
|
||||
$this->assign([
|
||||
'data' => $data,
|
||||
'gamodel_list'=>$gamodel_l,
|
||||
'gamodel_count'=>count($gamodel_list),
|
||||
]);
|
||||
return $this->fetch('add');
|
||||
|
||||
}
|
||||
|
||||
//删除
|
||||
public function del($id, GoodsAttrCategory $model)
|
||||
{
|
||||
if (count($model->noDeletionId) > 0) {
|
||||
if (is_array($id)) {
|
||||
if (array_intersect($model->noDeletionId, $id)) {
|
||||
return error('ID为' . implode(',', $model->noDeletionId) . '的数据无法删除');
|
||||
}
|
||||
} else if (in_array($id, $model->noDeletionId)) {
|
||||
return error('ID为' . $id . '的数据无法删除');
|
||||
}
|
||||
}
|
||||
|
||||
if ($model->softDelete) {
|
||||
$result = $model->whereIn('id', $id)->useSoftDelete('delete_time', time())->delete();
|
||||
} else {
|
||||
$result = $model->whereIn('id', $id)->delete();
|
||||
}
|
||||
|
||||
return $result ? success('操作成功', URL_RELOAD) : error();
|
||||
}
|
||||
|
||||
//获取规格分类下的规格
|
||||
public function get_attr()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -7,6 +7,7 @@ namespace app\admin\controller;
|
|||
|
||||
use think\Request;
|
||||
use app\common\model\Goods;
|
||||
use app\common\model\MallImage;
|
||||
use app\common\model\GoodsCategory;
|
||||
use app\common\model\Brand;
|
||||
use app\common\model\GoodsAttrCategory;
|
||||
|
|
@ -20,7 +21,7 @@ class GoodsController extends Controller
|
|||
public function index(Request $request, Goods $model)
|
||||
{
|
||||
$param = $request->param();
|
||||
$model = $model->with('goods_category,brand')->scope('where', $param);
|
||||
$model = $model->with('goods_category')->scope('where', $param);
|
||||
|
||||
$data = $model->paginate($this->admin['per_page'], false, ['query' => $request->get()]);
|
||||
//关键词,排序等赋值
|
||||
|
|
@ -35,7 +36,7 @@ class GoodsController extends Controller
|
|||
}
|
||||
|
||||
//添加
|
||||
public function add(Request $request, Goods $model, GoodsValidate $validate)
|
||||
public function add(Request $request, Goods $model,MallImage $mimode, GoodsValidate $validate)
|
||||
{
|
||||
if ($request->isPost()) {
|
||||
$param = $request->param();
|
||||
|
|
@ -43,39 +44,39 @@ class GoodsController extends Controller
|
|||
if (!$validate_result) {
|
||||
return error($validate->getError());
|
||||
}
|
||||
$param['attr'] = $request->param(false)['attr'];
|
||||
|
||||
$param['detail'] = $request->param(false)['detail'];
|
||||
|
||||
//处理图片上传
|
||||
$attachment_img = new \app\common\model\Attachment;
|
||||
$file_img = $attachment_img->upload('img');
|
||||
if ($file_img) {
|
||||
$param['img'] = $file_img->url;
|
||||
} else {
|
||||
return error($attachment_img->getError());
|
||||
// 启动事务
|
||||
$model->startTrans();
|
||||
try{
|
||||
$model::create($param);
|
||||
$goods_id=$model->getLastInsID();
|
||||
goods_imgs_upload($goods_id,1,$param['ori_img'],$param['thumb_img'],$param['ori_fm_img'],$param['thumb_img_f']);
|
||||
// 提交事务
|
||||
$model->commit();
|
||||
}catch(\Exception $e){
|
||||
// 回滚事务
|
||||
$model->rollback();
|
||||
return error($e->getMessage());
|
||||
}
|
||||
|
||||
$result = $model::create($param);
|
||||
|
||||
$url = URL_BACK;
|
||||
if (isset($param['_create']) && $param['_create'] == 1) {
|
||||
if(isset($param['_create']) && $param['_create']==1){
|
||||
$url = URL_RELOAD;
|
||||
}
|
||||
|
||||
return $result ? success('添加成功', $url) : error();
|
||||
return success('添加成功',$url);
|
||||
}
|
||||
|
||||
$this->assign([
|
||||
'goods_category_list' => $this->getSelectList(new GoodsCategory),
|
||||
'brand_list' => Brand::all(),
|
||||
'imgurl_list'=>array(),
|
||||
]);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//修改
|
||||
public function edit($id, Request $request, Goods $model, GoodsValidate $validate)
|
||||
public function edit($id, Request $request, Goods $model ,MallImage $mimode, GoodsValidate $validate)
|
||||
{
|
||||
|
||||
$data = $model::get($id);
|
||||
|
|
@ -85,29 +86,39 @@ class GoodsController extends Controller
|
|||
if (!$validate_result) {
|
||||
return error($validate->getError());
|
||||
}
|
||||
$param['attr'] = $request->param(false)['attr'];
|
||||
|
||||
$param['detail'] = $request->param(false)['detail'];
|
||||
|
||||
//处理图片上传
|
||||
if (!empty($_FILES['img']['name'])) {
|
||||
$attachment_img = new \app\common\model\Attachment;
|
||||
$file_img = $attachment_img->upload('img');
|
||||
if ($file_img) {
|
||||
$param['img'] = $file_img->url;
|
||||
// 启动事务
|
||||
$model->startTrans();
|
||||
try{
|
||||
$data->save($param);
|
||||
$MallImage=$mimode->where(array('type'=>1,'union_id'=>$id))->select();
|
||||
goods_imgs_upload($id,1,$param['ori_img'],$param['thumb_img'],$param['ori_fm_img'],$param['thumb_img_f'],$MallImage);
|
||||
// 提交事务
|
||||
$model->commit();
|
||||
}catch(\Exception $e){
|
||||
// 回滚事务
|
||||
$model->rollback();
|
||||
return error($e->getMessage());
|
||||
}
|
||||
return success();
|
||||
}
|
||||
$ori_img='';
|
||||
$thumb_img='';
|
||||
$imgurl_list=$mimode->field('thumb_image,ori_image,is_cover')->where(array('type'=>1,'union_id'=>$id))->select();
|
||||
foreach ($imgurl_list as $key => $v) {
|
||||
$is_cover=$v['is_cover']>0 ? $v['is_cover']:'0';
|
||||
if ($is_cover == 1) {
|
||||
$ori_img = $v['ori_image'];
|
||||
$thumb_img = $v['thumb_image'];
|
||||
}
|
||||
}
|
||||
|
||||
$result = $data->save($param);
|
||||
return $result ? success() : error();
|
||||
}
|
||||
|
||||
$this->assign([
|
||||
'data' => $data,
|
||||
'goods_category_list' => $this->getSelectList(new GoodsCategory, $data->goods_category_id),
|
||||
'brand_list' => Brand::all(),
|
||||
'goodsattrcategory_list' => GoodsAttrCategory::all(),
|
||||
'imgurl_list'=>array(),
|
||||
'ori_img'=>$ori_img,
|
||||
'thumb_img'=>$thumb_img,
|
||||
'imgurl_list'=>$imgurl_list,
|
||||
]);
|
||||
return $this->fetch('add');
|
||||
|
||||
|
|
|
|||
|
|
@ -12,49 +12,91 @@ use app\admin\model\AdminRole;
|
|||
use app\admin\model\AdminUser;
|
||||
use tools\SystemInfo;
|
||||
use think\Request;
|
||||
use think\Db;
|
||||
|
||||
class IndexController extends Controller
|
||||
{
|
||||
public function index(Request $request)
|
||||
{
|
||||
|
||||
//默认密码修改检测
|
||||
$password_danger = 0;
|
||||
if (config('admin.password_warning') && $this->user->id == 1 && password_verify('super-admin', $this->user->password)) {
|
||||
$password_danger = 1;
|
||||
|
||||
//更新时间
|
||||
$time = date('Y-m-d H:i:s', time());
|
||||
//今日成交订单
|
||||
$order_num_today = Db::name('order')
|
||||
->where(['order_type' =>1])
|
||||
->whereTime('create_time', 'today')
|
||||
->count();
|
||||
//昨日
|
||||
$order_num_yesterday = Db::name('order')
|
||||
->where(['order_type' =>1])
|
||||
->whereTime('create_time', 'yesterday')
|
||||
->count();
|
||||
//变化
|
||||
$order_num_change = $order_num_today - $order_num_yesterday;
|
||||
if ($order_num_change >= 0) {
|
||||
$order_num_change = '+' . $order_num_change;
|
||||
}
|
||||
//总
|
||||
$order_num_all = Db::name('order')
|
||||
->where(['order_type' =>1])
|
||||
->count();
|
||||
//今日销售金额(元)
|
||||
$order_amount_today = Db::name('order')
|
||||
->where(['order_type' =>1])
|
||||
->whereTime('create_time', 'today')
|
||||
->sum('order_price');
|
||||
//昨日
|
||||
$order_amount_yesterday = Db::name('order')
|
||||
->where(['order_type' =>1])
|
||||
->whereTime('create_time', 'yesterday')
|
||||
->sum('order_price');
|
||||
//总
|
||||
$order_amount_all = Db::name('order')
|
||||
->where(['order_type' =>1])
|
||||
->sum('order_price');
|
||||
//变化
|
||||
$order_amount_change = $order_amount_today - $order_amount_yesterday;
|
||||
if ($order_amount_change >= 0) {
|
||||
$order_amount_change = '+' . $order_amount_change;
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页数据展示,可自行替换
|
||||
*/
|
||||
$this->assign([
|
||||
//后台用户数量
|
||||
'admin_user_count' => AdminUser::count(),
|
||||
//后台角色数量
|
||||
'admin_role_count' => AdminRole::count(),
|
||||
//后台菜单数量
|
||||
'admin_menu_count' => AdminMenu::count(),
|
||||
//后台日志数量
|
||||
'admin_log_count' => AdminLog::count(),
|
||||
]);
|
||||
|
||||
//是否显示欢迎信息
|
||||
$welcome_info = config('admin.welcome_info');
|
||||
if ($welcome_info) {
|
||||
$this->admin['name'] = config('admin.name');
|
||||
// 今天新增会员数量
|
||||
$add_user_today = Db::name('user')
|
||||
->whereTime('create_time', 'today')
|
||||
->count();
|
||||
//昨天
|
||||
$add_user_yesterday = Db::name('user')
|
||||
->whereTime('create_time', 'yesterday')
|
||||
->count();
|
||||
//总
|
||||
$user_all = Db::name('user')
|
||||
->count();
|
||||
//变化
|
||||
$add_change = $add_user_today - $add_user_yesterday;
|
||||
if ($add_change >= 0) {
|
||||
$add_change = '+' . $add_change;
|
||||
}
|
||||
$date=[
|
||||
'time' => $time,
|
||||
'order_num_today' => $order_num_today,
|
||||
'order_num_yesterday' => $order_num_yesterday,
|
||||
'order_num_change' => $order_num_change,
|
||||
'order_amount_today' => $order_amount_today,
|
||||
'order_amount_yesterday' => $order_amount_yesterday,
|
||||
'order_amount_change' => $order_amount_change,
|
||||
|
||||
'add_user_today' => $add_user_today,
|
||||
'add_user_yesterday' => $add_user_yesterday,
|
||||
'add_user_change' => $add_change,
|
||||
|
||||
'order_num_all' => $order_num_all,
|
||||
'order_amount_all' => $order_amount_all,
|
||||
'user_all' => $user_all,
|
||||
];
|
||||
$this->assign([
|
||||
//系统信息
|
||||
'system_info' => SystemInfo::getSystemInfo(),
|
||||
//访问信息
|
||||
'visitor_info' => $request,
|
||||
//默认密码警告
|
||||
'password_danger' => $password_danger,
|
||||
//当前用户
|
||||
'user' => $this->user,
|
||||
//欢迎信息
|
||||
'welcome_info' => $welcome_info
|
||||
'res'=>$date,
|
||||
]);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,15 +5,10 @@
|
|||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\common\model\DeliverAddress;
|
||||
use app\common\model\Express;
|
||||
use app\common\model\Goods;
|
||||
use app\common\model\Order;
|
||||
use app\common\model\OrderGoods;
|
||||
use app\common\model\User;
|
||||
use app\common\validate\OrderValidate;
|
||||
use think\Db;
|
||||
use think\Request;
|
||||
use app\common\model\Order;
|
||||
|
||||
use app\common\validate\OrderValidate;
|
||||
|
||||
class OrderController extends Controller
|
||||
{
|
||||
|
|
@ -22,9 +17,53 @@ class OrderController extends Controller
|
|||
public function index(Request $request, Order $model)
|
||||
{
|
||||
$param = $request->param();
|
||||
$model = $model->with('user,express')->scope('where', $param);
|
||||
$where = [];
|
||||
//订单搜素
|
||||
if (!empty($param['search_key']) && !empty($param['keyword'])) {
|
||||
$keyword = $param['keyword'];
|
||||
switch ($param['search_key']) {
|
||||
case 'order_sn':
|
||||
$where[] = ['o.order_sn', 'like', '%' . $keyword . '%'];
|
||||
break;
|
||||
case 'user_sn':
|
||||
$where[] = ['u.sn', 'like', '%' . $keyword . '%'];
|
||||
break;
|
||||
case 'nickname':
|
||||
$where[] = ['u.nickname', 'like', '%' . $keyword . '%'];
|
||||
break;
|
||||
case 'user_mobile':
|
||||
$where[] = ['u.mobile', 'like', '%' . $keyword . '%'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$data = $model->paginate($this->admin['per_page'], false, ['query' => $request->get()]);
|
||||
//商品名称
|
||||
if (isset($param['goods_name']) && $param['goods_name'] != '') {
|
||||
$where[] = ['o.goods_name', 'like', '%' . $param['goods_name'] . '%'];
|
||||
}
|
||||
|
||||
//订单类型
|
||||
if (isset($param['order_type']) && $param['order_type'] != '') {
|
||||
$where[] = ['o.order_type', '=', $param['order_type']];
|
||||
}
|
||||
|
||||
//下单时间
|
||||
if (isset($param['start_time']) && $param['start_time'] != '') {
|
||||
$where[] = ['o.create_time', '>=', strtotime($param['start_time'])];
|
||||
}
|
||||
if (isset($param['end_time']) && $param['end_time'] != '') {
|
||||
$where[] = ['o.create_time', '<=', strtotime($param['end_time'])];
|
||||
}
|
||||
$model = $model
|
||||
->alias('o')
|
||||
->field('o.*,u.mobile,u.nickname,u.sn,u.avatar')
|
||||
->join('user u', 'u.id = o.user_id')
|
||||
->where($where)
|
||||
->order('o.id desc')
|
||||
->group('o.id')
|
||||
->scope('where', $param);
|
||||
|
||||
$data = $model->paginate($this->admin['per_page'], false, ['query'=>$request->get()]);
|
||||
//关键词,排序等赋值
|
||||
$this->assign($request->get());
|
||||
|
||||
|
|
@ -35,95 +74,4 @@ class OrderController extends Controller
|
|||
]);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//添加
|
||||
public function add(Request $request, Order $model, OrderValidate $validate)
|
||||
{
|
||||
if ($request->isPost()) {
|
||||
$param = $request->param();
|
||||
$validate_result = $validate->scene('add')->check($param);
|
||||
if (!$validate_result) {
|
||||
return error($validate->getError());
|
||||
}
|
||||
|
||||
$result = $model::create($param);
|
||||
|
||||
$url = URL_BACK;
|
||||
if (isset($param['_create']) && $param['_create'] == 1) {
|
||||
$url = URL_RELOAD;
|
||||
}
|
||||
|
||||
return $result ? success('添加成功', $url) : error();
|
||||
}
|
||||
|
||||
$this->assign([
|
||||
'user_list' => User::all(),
|
||||
'express_list' => Express::all(),
|
||||
|
||||
]);
|
||||
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//修改
|
||||
public function edit($id, Request $request, Order $model, OrderValidate $validate)
|
||||
{
|
||||
|
||||
$data = $model::get($id);
|
||||
if ($request->isPost()) {
|
||||
$param = $request->param();
|
||||
$validate_result = $validate->scene('edit')->check($param);
|
||||
if (!$validate_result) {
|
||||
return error($validate->getError());
|
||||
}
|
||||
|
||||
$result = $data->save($param);
|
||||
return $result ? success() : error();
|
||||
}
|
||||
|
||||
$this->assign([
|
||||
'data' => $data,
|
||||
'user_list' => User::all(),
|
||||
'express_list' => Express::all(),
|
||||
|
||||
]);
|
||||
return $this->fetch('add');
|
||||
|
||||
}
|
||||
|
||||
//删除
|
||||
public function del($id, Order $model)
|
||||
{
|
||||
if (count($model->noDeletionId) > 0) {
|
||||
if (is_array($id)) {
|
||||
if (array_intersect($model->noDeletionId, $id)) {
|
||||
return error('ID为' . implode(',', $model->noDeletionId) . '的数据无法删除');
|
||||
}
|
||||
} else if (in_array($id, $model->noDeletionId)) {
|
||||
return error('ID为' . $id . '的数据无法删除');
|
||||
}
|
||||
}
|
||||
|
||||
if ($model->softDelete) {
|
||||
$result = $model->whereIn('id', $id)->useSoftDelete('delete_time', time())->delete();
|
||||
} else {
|
||||
$result = $model->whereIn('id', $id)->delete();
|
||||
}
|
||||
|
||||
return $result ? success('操作成功', URL_RELOAD) : error();
|
||||
}
|
||||
|
||||
|
||||
//订单详情
|
||||
public function detail($id, Order $model)
|
||||
{
|
||||
$data = $model::get($id);
|
||||
$this->assign([
|
||||
'data' => $data
|
||||
]);
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,125 @@
|
|||
<?php
|
||||
/**
|
||||
* 配置表控制器
|
||||
*/
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Request;
|
||||
use app\common\model\ShopConfig;
|
||||
use app\common\model\Goods;
|
||||
|
||||
use app\common\validate\ShopConfigValidate;
|
||||
|
||||
class ShopConfigController extends Controller
|
||||
{
|
||||
|
||||
//每日收益
|
||||
public function shouyi(Request $request, ShopConfig $model, ShopConfigValidate $validate)
|
||||
{
|
||||
if ($request->isPost()) {
|
||||
$param = $request->param();
|
||||
ShopConfig::set('shouyi', 'time', $param['time']);
|
||||
ShopConfig::set('shouyi', 'num', $param['num']);
|
||||
$url = URL_RELOAD;
|
||||
return success('添加成功',$url);
|
||||
}
|
||||
$config = [
|
||||
'time' => ShopConfig::get('shouyi', 'time'),
|
||||
'num' => ShopConfig::get('shouyi', 'num'),
|
||||
];
|
||||
$this->assign([
|
||||
'config' => $config,
|
||||
]);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//分销管理
|
||||
public function fenxiao(Request $request, ShopConfig $model, ShopConfigValidate $validate)
|
||||
{
|
||||
if ($request->isPost()) {
|
||||
$param = $request->param();
|
||||
ShopConfig::set('fenxiao', 'first_ratio', $param['first_ratio']);
|
||||
ShopConfig::set('fenxiao', 'second_ratio', $param['second_ratio']);
|
||||
ShopConfig::set('fenxiao', 'number', $param['number']);
|
||||
$url = URL_RELOAD;
|
||||
return success('添加成功',$url);
|
||||
}
|
||||
$config = [
|
||||
'first_ratio' => ShopConfig::get('fenxiao', 'first_ratio'),
|
||||
'second_ratio' => ShopConfig::get('fenxiao', 'second_ratio'),
|
||||
'number' => ShopConfig::get('fenxiao', 'number'),
|
||||
];
|
||||
$this->assign([
|
||||
'config' => $config,
|
||||
]);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//政策协议
|
||||
public function policy(Request $request, ShopConfig $model, ShopConfigValidate $validate)
|
||||
{
|
||||
if ($request->isPost()) {
|
||||
$param = $request->param();
|
||||
ShopConfig::set('policy', 'integral_rule', $param['integral_rule']);
|
||||
$url = URL_RELOAD;
|
||||
return success('添加成功',$url);
|
||||
}
|
||||
$config = [
|
||||
'integral_rule' => ShopConfig::get('policy', 'integral_rule'),
|
||||
];
|
||||
$this->assign([
|
||||
'config' => $config,
|
||||
]);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//会员提现
|
||||
public function withdraw(Request $request, ShopConfig $model, ShopConfigValidate $validate)
|
||||
{
|
||||
if ($request->isPost()) {
|
||||
$param = $request->param();
|
||||
ShopConfig::set('withdraw', 'min_withdraw', $param['min_withdraw']);
|
||||
ShopConfig::set('withdraw', 'max_withdraw', $param['max_withdraw']);
|
||||
ShopConfig::set('withdraw', 'poundage', $param['poundage']);
|
||||
$url = URL_RELOAD;
|
||||
return success('添加成功',$url);
|
||||
}
|
||||
$config = [
|
||||
'min_withdraw' => ShopConfig::get('withdraw', 'min_withdraw'),
|
||||
'max_withdraw' => ShopConfig::get('withdraw', 'max_withdraw'),
|
||||
'poundage' => ShopConfig::get('withdraw', 'poundage'),
|
||||
];
|
||||
$this->assign([
|
||||
'config' => $config,
|
||||
]);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//试用设备设置
|
||||
public function goods(Request $request, Goods $gmodel, ShopConfigValidate $validate)
|
||||
{
|
||||
if ($request->isPost()) {
|
||||
$param = $request->param();
|
||||
ShopConfig::set('goods', 'goods_id', $param['goods_id']);
|
||||
ShopConfig::set('goods', 'day', $param['day']);
|
||||
ShopConfig::set('goods', 'is_withdraw', $param['is_withdraw']);
|
||||
ShopConfig::set('goods', 'is_first', $param['is_first']);
|
||||
ShopConfig::set('goods', 'is_open', $param['is_open']);
|
||||
$url = URL_RELOAD;
|
||||
return success('添加成功',$url);
|
||||
}
|
||||
$config = [
|
||||
'goods_id' => ShopConfig::get('goods', 'goods_id'),
|
||||
'day' => ShopConfig::get('goods', 'day'),
|
||||
'is_withdraw' => ShopConfig::get('goods', 'is_withdraw'),
|
||||
'is_first' => ShopConfig::get('goods', 'is_first'),
|
||||
'is_open' => ShopConfig::get('goods', 'is_open'),
|
||||
'goods_list'=>Goods::all(),
|
||||
];
|
||||
$this->assign([
|
||||
'config' => $config,
|
||||
]);
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,105 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* 标签控制器
|
||||
*/
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Request;
|
||||
use app\common\model\Tag;
|
||||
|
||||
use app\common\validate\TagValidate;
|
||||
|
||||
class TagController extends Controller
|
||||
{
|
||||
|
||||
//列表
|
||||
public function index(Request $request, Tag $model)
|
||||
{
|
||||
$param = $request->param();
|
||||
$model = $model->scope('where', $param);
|
||||
|
||||
$data = $model->paginate($this->admin['per_page'], false, ['query' => $request->get()]);
|
||||
//关键词,排序等赋值
|
||||
$this->assign($request->get());
|
||||
|
||||
$this->assign([
|
||||
'data' => $data,
|
||||
'page' => $data->render(),
|
||||
'total' => $data->total(),
|
||||
]);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//添加
|
||||
public function add(Request $request, Tag $model, TagValidate $validate)
|
||||
{
|
||||
if ($request->isPost()) {
|
||||
$param = $request->param();
|
||||
$validate_result = $validate->scene('add')->check($param);
|
||||
if (!$validate_result) {
|
||||
return error($validate->getError());
|
||||
}
|
||||
|
||||
$result = $model::create($param);
|
||||
|
||||
$url = URL_BACK;
|
||||
if (isset($param['_create']) && $param['_create'] == 1) {
|
||||
$url = URL_RELOAD;
|
||||
}
|
||||
|
||||
return $result ? success('添加成功', $url) : error();
|
||||
}
|
||||
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//修改
|
||||
public function edit($id, Request $request, Tag $model, TagValidate $validate)
|
||||
{
|
||||
|
||||
$data = $model::get($id);
|
||||
if ($request->isPost()) {
|
||||
$param = $request->param();
|
||||
$validate_result = $validate->scene('edit')->check($param);
|
||||
if (!$validate_result) {
|
||||
return error($validate->getError());
|
||||
}
|
||||
|
||||
$result = $data->save($param);
|
||||
return $result ? success() : error();
|
||||
}
|
||||
|
||||
$this->assign([
|
||||
'data' => $data,
|
||||
|
||||
]);
|
||||
return $this->fetch('add');
|
||||
|
||||
}
|
||||
|
||||
//删除
|
||||
public function del($id, Tag $model)
|
||||
{
|
||||
if (count($model->noDeletionId) > 0) {
|
||||
if (is_array($id)) {
|
||||
if (array_intersect($model->noDeletionId, $id)) {
|
||||
return error('ID为' . implode(',', $model->noDeletionId) . '的数据无法删除');
|
||||
}
|
||||
} else if (in_array($id, $model->noDeletionId)) {
|
||||
return error('ID为' . $id . '的数据无法删除');
|
||||
}
|
||||
}
|
||||
|
||||
if ($model->softDelete) {
|
||||
$result = $model->whereIn('id', $id)->useSoftDelete('delete_time', time())->delete();
|
||||
} else {
|
||||
$result = $model->whereIn('id', $id)->delete();
|
||||
}
|
||||
|
||||
return $result ? success('操作成功', URL_RELOAD) : error();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,131 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* 测试控制器
|
||||
*/
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Request;
|
||||
use app\common\model\Test;
|
||||
|
||||
use app\common\validate\TestValidate;
|
||||
|
||||
class TestController extends Controller
|
||||
{
|
||||
|
||||
//列表
|
||||
public function index(Request $request, Test $model)
|
||||
{
|
||||
$param = $request->param();
|
||||
$model = $model->scope('where', $param);
|
||||
if (isset($param['export_data']) && $param['export_data'] == 1) {
|
||||
$header = ['ID','',];
|
||||
$body = [];
|
||||
$data = $model->select();
|
||||
foreach ($data as $item) {
|
||||
$record = [];
|
||||
$record['id'] = $item->id;
|
||||
$record['name'] = $item->name;
|
||||
|
||||
$body[] = $record;
|
||||
}
|
||||
return $this->exportData($header, $body, 'test-' . date('Y-m-d-H-i-s'));
|
||||
}
|
||||
$data = $model->paginate($this->admin['per_page'], false, ['query'=>$request->get()]);
|
||||
//关键词,排序等赋值
|
||||
$this->assign($request->get());
|
||||
|
||||
$this->assign([
|
||||
'data' => $data,
|
||||
'page' => $data->render(),
|
||||
'total' => $data->total(),
|
||||
]);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//添加
|
||||
public function add(Request $request, Test $model, TestValidate $validate)
|
||||
{
|
||||
if ($request->isPost()) {
|
||||
$param = $request->param();
|
||||
$validate_result = $validate->scene('add')->check($param);
|
||||
if (!$validate_result) {
|
||||
return error($validate->getError());
|
||||
}
|
||||
|
||||
$result = $model::create($param);
|
||||
|
||||
$url = URL_BACK;
|
||||
if(isset($param['_create']) && $param['_create']==1){
|
||||
$url = URL_RELOAD;
|
||||
}
|
||||
|
||||
return $result ? success('添加成功',$url) : error();
|
||||
}
|
||||
|
||||
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//修改
|
||||
public function edit($id, Request $request, Test $model, TestValidate $validate)
|
||||
{
|
||||
|
||||
$data = $model::get($id);
|
||||
if ($request->isPost()) {
|
||||
$param = $request->param();
|
||||
$validate_result = $validate->scene('edit')->check($param);
|
||||
if (!$validate_result) {
|
||||
return error($validate->getError());
|
||||
}
|
||||
|
||||
$result = $data->save($param);
|
||||
return $result ? success() : error();
|
||||
}
|
||||
|
||||
$this->assign([
|
||||
'data' => $data,
|
||||
|
||||
]);
|
||||
return $this->fetch('add');
|
||||
|
||||
}
|
||||
|
||||
//删除
|
||||
public function del($id, Test $model)
|
||||
{
|
||||
if (count($model->noDeletionId) > 0) {
|
||||
if (is_array($id)) {
|
||||
if (array_intersect($model->noDeletionId, $id)) {
|
||||
return error('ID为' . implode(',', $model->noDeletionId) . '的数据无法删除');
|
||||
}
|
||||
} else if (in_array($id, $model->noDeletionId)) {
|
||||
return error('ID为' . $id . '的数据无法删除');
|
||||
}
|
||||
}
|
||||
|
||||
if ($model->softDelete) {
|
||||
$result = $model->whereIn('id', $id)->useSoftDelete('delete_time', time())->delete();
|
||||
} else {
|
||||
$result = $model->whereIn('id', $id)->delete();
|
||||
}
|
||||
|
||||
return $result ? success('操作成功', URL_RELOAD) : error();
|
||||
}
|
||||
|
||||
//启用
|
||||
public function enable($id,Test $model)
|
||||
{
|
||||
$result = $model->whereIn('id',$id)->update(['status'=>1]);
|
||||
return $result ? success('操作成功', URL_RELOAD) : error();
|
||||
}
|
||||
|
||||
|
||||
//禁用
|
||||
public function disable($id,Test $model)
|
||||
{
|
||||
$result = $model->whereIn('id',$id)->update(['status'=>0]);
|
||||
return $result ? success('操作成功', URL_RELOAD) : error();
|
||||
}
|
||||
}
|
||||
|
|
@ -7,9 +7,11 @@ namespace app\admin\controller;
|
|||
|
||||
use think\Request;
|
||||
use app\common\model\User;
|
||||
use app\common\model\UserLevel;
|
||||
use app\common\model\Order;
|
||||
use app\common\model\Goods;
|
||||
|
||||
use app\common\validate\UserValidate;
|
||||
use app\common\validate\OrderValidate;
|
||||
|
||||
class UserController extends Controller
|
||||
{
|
||||
|
|
@ -18,27 +20,45 @@ class UserController extends Controller
|
|||
public function index(Request $request, User $model)
|
||||
{
|
||||
$param = $request->param();
|
||||
$model = $model->with('user_level')->scope('where', $param);
|
||||
if (isset($param['export_data']) && $param['export_data'] == 1) {
|
||||
$header = ['ID', '头像', '用户等级', '用户名', '手机号', '昵称', '是否启用', '创建时间',];
|
||||
$body = [];
|
||||
$data = $model->select();
|
||||
foreach ($data as $item) {
|
||||
$record = [];
|
||||
$record['id'] = $item->id;
|
||||
$record['avatar'] = $item->avatar;
|
||||
$record['user_level_id'] = $item->user_level->name ?? '';
|
||||
$record['username'] = $item->username;
|
||||
$record['mobile'] = $item->mobile;
|
||||
$record['nickname'] = $item->nickname;
|
||||
$record['status'] = $item->status_text;
|
||||
$record['create_time'] = $item->create_time;
|
||||
$where = [];
|
||||
//查询
|
||||
if(isset($param['keyword']) && $param['keyword']){
|
||||
$where[] = [$param['keyword_type'],'like','%'.$param['keyword'].'%'];
|
||||
}
|
||||
//等级查询
|
||||
if(isset($param['level']) && $param['level'] != ''){
|
||||
$where[] = ['user_level_id','=',$param['level']];
|
||||
}
|
||||
//提现积分
|
||||
if(isset($param['integral_start']) && $param['integral_start']){
|
||||
$where[] = ['integral','>=',$param['integral_start']];
|
||||
}
|
||||
if(isset($param['integral_end']) && $param['integral_end']){
|
||||
$where[] = ['integral','<=',$param['integral_end']];
|
||||
}
|
||||
//注册时间
|
||||
if(isset($param['start_time']) && $param['start_time']!=''){
|
||||
$where[] = ['create_time','>=',strtotime($param['start_time'])];
|
||||
}
|
||||
if(isset($param['end_time']) && $param['end_time']!=''){
|
||||
$where[] = ['create_time','<=',strtotime($param['end_time'])];
|
||||
}
|
||||
|
||||
$body[] = $record;
|
||||
}
|
||||
return $this->exportData($header, $body, 'user-' . date('Y-m-d-H-i-s'));
|
||||
}
|
||||
$model = $model->where($where)->scope('where', $param);
|
||||
$data = $model->paginate($this->admin['per_page'], false, ['query' => $request->get()]);
|
||||
foreach ($data as $key => $value) {
|
||||
// 上级推荐人
|
||||
$value['first_leader_info'] = User::getUserInfo($value['first_leader']);
|
||||
//推荐下级人数
|
||||
$value['fans'] = User::where([
|
||||
['first_leader|second_leader', '=', $value['id']]
|
||||
])->count();
|
||||
|
||||
//设备数量
|
||||
$value['sb_num'] = Order::where([
|
||||
['user_id', '=', $value['id']]
|
||||
])->count();
|
||||
}
|
||||
//关键词,排序等赋值
|
||||
$this->assign($request->get());
|
||||
|
||||
|
|
@ -78,13 +98,6 @@ class UserController extends Controller
|
|||
|
||||
return $result ? success('添加成功', $url) : error();
|
||||
}
|
||||
|
||||
$this->assign([
|
||||
'user_level_list' => UserLevel::all(),
|
||||
|
||||
]);
|
||||
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
|
@ -115,8 +128,6 @@ class UserController extends Controller
|
|||
|
||||
$this->assign([
|
||||
'data' => $data,
|
||||
'user_level_list' => UserLevel::all(),
|
||||
|
||||
]);
|
||||
return $this->fetch('add');
|
||||
|
||||
|
|
@ -157,4 +168,47 @@ class UserController extends Controller
|
|||
$result = $model->whereIn('id', $id)->update(['status' => 0]);
|
||||
return $result ? success('操作成功', URL_RELOAD) : error();
|
||||
}
|
||||
|
||||
|
||||
//分配设备
|
||||
public function equipmentadd(Request $request,Order $omodel)
|
||||
{
|
||||
if ($request->isPost()) {
|
||||
$param = $request->param();
|
||||
$goods_ids=$param['goods_id'];
|
||||
if(count($goods_ids)==0){
|
||||
return error('请选择设备信息');
|
||||
}
|
||||
$field_data = array();
|
||||
foreach ($goods_ids as $key => $value) {
|
||||
if($param['goods_id'][$key][0] && $param['number'][$key][0] && $param['end_time'][$key][0]){
|
||||
$goods_info=Goods::where(array('id'=>$param['goods_id'][$key][0]))->find()->toArray();
|
||||
$field_data[] = [
|
||||
'order_no'=>get_order_sn(),
|
||||
'goods_id' => $param['goods_id'][$key][0],
|
||||
'number' => $param['number'][$key][0],
|
||||
'end_time' => strtotime($param['end_time'][$key][0]),
|
||||
'user_id' => $param['id'],
|
||||
'goods_name' => $goods_info['name'],
|
||||
'attr' => $goods_info['attr'],
|
||||
'order_price' => $goods_info['price']*$param['number'][$key][0],
|
||||
'create_time'=>time(),
|
||||
];
|
||||
}
|
||||
}
|
||||
if(count($field_data)==0){
|
||||
return error('请检查设备信息是否填写完整');
|
||||
}
|
||||
$result = $omodel->insertAll($field_data);
|
||||
$url = URL_BACK;
|
||||
if (isset($param['_create']) && $param['_create'] == 1) {
|
||||
$url = URL_RELOAD;
|
||||
}
|
||||
return $result ? success('添加成功', $url) : error();
|
||||
}
|
||||
$this->assign([
|
||||
'goods_list' => Goods::all(),
|
||||
]);
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,152 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* 用户等级控制器
|
||||
*/
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Request;
|
||||
use app\common\model\UserLevel;
|
||||
|
||||
use app\common\validate\UserLevelValidate;
|
||||
|
||||
class UserLevelController extends Controller
|
||||
{
|
||||
|
||||
//列表
|
||||
public function index(Request $request, UserLevel $model)
|
||||
{
|
||||
$param = $request->param();
|
||||
$model = $model->scope('where', $param);
|
||||
if (isset($param['export_data']) && $param['export_data'] == 1) {
|
||||
$header = ['ID', '名称', '简介', '图片', '是否启用', '创建时间',];
|
||||
$body = [];
|
||||
$data = $model->select();
|
||||
foreach ($data as $item) {
|
||||
$record = [];
|
||||
$record['id'] = $item->id;
|
||||
$record['name'] = $item->name;
|
||||
$record['description'] = $item->description;
|
||||
$record['img'] = $item->img;
|
||||
$record['status'] = $item->status_text;
|
||||
$record['create_time'] = $item->create_time;
|
||||
|
||||
$body[] = $record;
|
||||
}
|
||||
return $this->exportData($header, $body, 'user_level-' . date('Y-m-d-H-i-s'));
|
||||
}
|
||||
$data = $model->paginate($this->admin['per_page'], false, ['query' => $request->get()]);
|
||||
//关键词,排序等赋值
|
||||
$this->assign($request->get());
|
||||
|
||||
$this->assign([
|
||||
'data' => $data,
|
||||
'page' => $data->render(),
|
||||
'total' => $data->total(),
|
||||
]);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//添加
|
||||
public function add(Request $request, UserLevel $model, UserLevelValidate $validate)
|
||||
{
|
||||
if ($request->isPost()) {
|
||||
$param = $request->param();
|
||||
$validate_result = $validate->scene('add')->check($param);
|
||||
if (!$validate_result) {
|
||||
return error($validate->getError());
|
||||
}
|
||||
//处理图片上传
|
||||
$attachment_img = new \app\common\model\Attachment;
|
||||
$file_img = $attachment_img->upload('img');
|
||||
if ($file_img) {
|
||||
$param['img'] = $file_img->url;
|
||||
} else {
|
||||
return error($attachment_img->getError());
|
||||
}
|
||||
|
||||
|
||||
$result = $model::create($param);
|
||||
|
||||
$url = URL_BACK;
|
||||
if (isset($param['_create']) && $param['_create'] == 1) {
|
||||
$url = URL_RELOAD;
|
||||
}
|
||||
|
||||
return $result ? success('添加成功', $url) : error();
|
||||
}
|
||||
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//修改
|
||||
public function edit($id, Request $request, UserLevel $model, UserLevelValidate $validate)
|
||||
{
|
||||
|
||||
$data = $model::get($id);
|
||||
if ($request->isPost()) {
|
||||
$param = $request->param();
|
||||
$validate_result = $validate->scene('edit')->check($param);
|
||||
if (!$validate_result) {
|
||||
return error($validate->getError());
|
||||
}
|
||||
//处理图片上传
|
||||
if (!empty($_FILES['img']['name'])) {
|
||||
$attachment_img = new \app\common\model\Attachment;
|
||||
$file_img = $attachment_img->upload('img');
|
||||
if ($file_img) {
|
||||
$param['img'] = $file_img->url;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$result = $data->save($param);
|
||||
return $result ? success() : error();
|
||||
}
|
||||
|
||||
$this->assign([
|
||||
'data' => $data,
|
||||
|
||||
]);
|
||||
return $this->fetch('add');
|
||||
|
||||
}
|
||||
|
||||
//删除
|
||||
public function del($id, UserLevel $model)
|
||||
{
|
||||
if (count($model->noDeletionId) > 0) {
|
||||
if (is_array($id)) {
|
||||
if (array_intersect($model->noDeletionId, $id)) {
|
||||
return error('ID为' . implode(',', $model->noDeletionId) . '的数据无法删除');
|
||||
}
|
||||
} else if (in_array($id, $model->noDeletionId)) {
|
||||
return error('ID为' . $id . '的数据无法删除');
|
||||
}
|
||||
}
|
||||
|
||||
if ($model->softDelete) {
|
||||
$result = $model->whereIn('id', $id)->useSoftDelete('delete_time', time())->delete();
|
||||
} else {
|
||||
$result = $model->whereIn('id', $id)->delete();
|
||||
}
|
||||
|
||||
return $result ? success('操作成功', URL_RELOAD) : error();
|
||||
}
|
||||
|
||||
//启用
|
||||
public function enable($id, UserLevel $model)
|
||||
{
|
||||
$result = $model->whereIn('id', $id)->update(['status' => 1]);
|
||||
return $result ? success('操作成功', URL_RELOAD) : error();
|
||||
}
|
||||
|
||||
|
||||
//禁用
|
||||
public function disable($id, UserLevel $model)
|
||||
{
|
||||
$result = $model->whereIn('id', $id)->update(['status' => 0]);
|
||||
return $result ? success('操作成功', URL_RELOAD) : error();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,159 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* 微信相关功能
|
||||
*/
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
|
||||
use EasyWeChat\Factory;
|
||||
|
||||
class WeChatController extends Controller
|
||||
{
|
||||
|
||||
//功能概述
|
||||
public function index()
|
||||
{
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//服务端验证
|
||||
public function server()
|
||||
{
|
||||
$config = config('wechat.');
|
||||
|
||||
$app = Factory::officialAccount($config);
|
||||
|
||||
$response = $app->server->serve();
|
||||
|
||||
// 将响应输出
|
||||
return $response->send();
|
||||
}
|
||||
|
||||
//接收 & 回复用户消息
|
||||
public function msg()
|
||||
{
|
||||
$config = config('wechat.');
|
||||
|
||||
$app = Factory::officialAccount($config);
|
||||
|
||||
$app->server->push(function ($message) {
|
||||
return "你好哇";
|
||||
});
|
||||
|
||||
$response = $app->server->serve();
|
||||
|
||||
// 将响应输出
|
||||
$response->send(); // Laravel 里请使用:return $response;
|
||||
}
|
||||
|
||||
//获取用户信息
|
||||
public function user()
|
||||
{
|
||||
$config = config('wechat.');
|
||||
|
||||
$app = Factory::officialAccount($config);
|
||||
$user = $app->user->get('用户的openID');
|
||||
|
||||
}
|
||||
|
||||
|
||||
//发送模版消息
|
||||
public function templateMsg()
|
||||
{
|
||||
$config = config('wechat.');
|
||||
|
||||
$app = Factory::officialAccount($config);
|
||||
|
||||
$app->template_message->send([
|
||||
'touser' => 'user-openid',
|
||||
'template_id' => 'template-id',
|
||||
'url' => 'https://easywechat.org',
|
||||
'miniprogram' => [
|
||||
'appid' => 'xxxxxxx',
|
||||
'pagepath' => 'pages/xxx',
|
||||
],
|
||||
'data' => [
|
||||
'key1' => 'VALUE',
|
||||
'key2' => 'VALUE2',
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
//拉黑用户
|
||||
public function block()
|
||||
{
|
||||
$config = config('wechat.');
|
||||
|
||||
$app = Factory::officialAccount($config);
|
||||
|
||||
$app->user->block('openidxxxxx');
|
||||
// 或者多个用户
|
||||
$app->user->block(['openid1', 'openid2', 'openid3',]);
|
||||
}
|
||||
|
||||
|
||||
//统一下单
|
||||
public function pay()
|
||||
{
|
||||
$config = config('wechat.');
|
||||
$app = Factory::payment($config);
|
||||
$result = $app->order->unify([
|
||||
'body' => '腾讯充值中心-QQ会员充值',
|
||||
'out_trade_no' => '20150806125346',
|
||||
'total_fee' => 88,
|
||||
'spbill_create_ip' => '123.12.12.123', // 可选,如不传该参数,SDK 将会自动获取相应 IP 地址
|
||||
'notify_url' => 'https://pay.weixin.qq.com/wxpay/pay.action', // 支付结果通知网址,如果不设置则会使用配置里的默认地址
|
||||
'trade_type' => 'JSAPI', // 请对应换成你的支付方式对应的值类型
|
||||
'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
//根据微信订单号退款
|
||||
public function refundByTransactionId()
|
||||
{
|
||||
$config = config('wechat.');
|
||||
$app = Factory::payment($config);
|
||||
$result = $app->refund->byTransactionId('transaction-id-xxx', 'refund-no-xxx', 10000, 10000, [
|
||||
// 可在此处传入其他参数,详细参数见微信支付文档
|
||||
'refund_desc' => '商品已售完',
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
//根据商户订单号退款
|
||||
public function refundByOutTradeNo()
|
||||
{
|
||||
$config = config('wechat.');
|
||||
$app = Factory::payment($config);
|
||||
$result = $app->refund->byOutTradeNumber('out-trade-no-xxx', 'refund-no-xxx', 20000, 1000, [
|
||||
// 可在此处传入其他参数,详细参数见微信支付文档
|
||||
'refund_desc' => '退运费',
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
//发送普通红包
|
||||
public function redPacket()
|
||||
{
|
||||
$config = config('wechat.');
|
||||
$app = Factory::payment($config);
|
||||
$redpack = $app->redpack;
|
||||
$redpackData = [
|
||||
'mch_billno' => 'xy123456',
|
||||
'send_name' => '测试红包',
|
||||
're_openid' => 'oxTWIuGaIt6gTKsQRLau2M0yL16E',
|
||||
'total_num' => 1, //固定为1,可不传
|
||||
'total_amount' => 100, //单位为分,不小于100
|
||||
'wishing' => '祝福语',
|
||||
'client_ip' => '192.168.0.1', //可不传,不传则由 SDK 取当前客户端 IP
|
||||
'act_name' => '测试活动',
|
||||
'remark' => '测试备注',
|
||||
// ...
|
||||
];
|
||||
|
||||
$result = $redpack->sendNormal($redpackData);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,149 @@
|
|||
<?php
|
||||
/**
|
||||
* 提现申请记录表控制器
|
||||
*/
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Request;
|
||||
use app\common\model\WithdrawApply;
|
||||
use app\common\model\AccountLog;
|
||||
use app\common\model\User;
|
||||
|
||||
use app\common\validate\WithdrawApplyValidate;
|
||||
|
||||
class WithdrawController extends Controller
|
||||
{
|
||||
|
||||
//列表
|
||||
public function lists(Request $request, WithdrawApply $model)
|
||||
{
|
||||
$WITHDRAW_TYPE=$model->WITHDRAW_TYPE;
|
||||
$STATUS_TYPE=$model->STATUS_TYPE;
|
||||
$param = $request->param();
|
||||
|
||||
$where = [];
|
||||
// 会员信息
|
||||
if (!empty($param['search_key']) && !empty($param['keyword'])) {
|
||||
$keyword = $param['keyword'];
|
||||
if ($param['search_key'] == 'user_sn') {
|
||||
$where[] = ['u.sn', '=', $keyword];
|
||||
} elseif ($param['search_key'] == 'nickname'){
|
||||
$where[] = ['u.nickname', 'like', '%' . $keyword . '%'];
|
||||
}
|
||||
}
|
||||
|
||||
//提现单号
|
||||
if (isset($param['withdraw_sn']) && $param['withdraw_sn'] != '') {
|
||||
$where[] = ['w.sn', '=', $param['withdraw_sn']];
|
||||
}
|
||||
|
||||
//提现方式
|
||||
if (isset($param['type']) && $param['type'] != '') {
|
||||
$where[] = ['type', '=', $param['type']];
|
||||
}
|
||||
|
||||
//提现状态
|
||||
if (isset($param['status']) && $param['status'] != '') {
|
||||
$where[] = ['w.status', '=', $param['status']];
|
||||
}
|
||||
|
||||
// 提现时间
|
||||
if (isset($param['start_time']) && $param['start_time'] && isset($param['end_time']) && $param['end_time']) {
|
||||
$where[] = ['w.create_time', 'between', [strtotime($param['start_time']), strtotime($param['end_time'])]];
|
||||
}
|
||||
|
||||
$model = $model
|
||||
->alias('w')
|
||||
->field('w.*,u.mobile,u.nickname,u.sn as user_sn,u.avatar')
|
||||
->join('user u', 'u.id = w.user_id')
|
||||
->where($where)
|
||||
->scope('where', $param);
|
||||
|
||||
$data = $model->paginate($this->admin['per_page'], false, ['query'=>$request->get()]);
|
||||
//关键词,排序等赋值
|
||||
$this->assign($request->get());
|
||||
|
||||
$this->assign([
|
||||
'data' => $data,
|
||||
'page' => $data->render(),
|
||||
'total' => $data->total(),
|
||||
'type_list' =>$WITHDRAW_TYPE,
|
||||
'status_list'=>$STATUS_TYPE,
|
||||
]);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function review($id,Request $request, WithdrawApply $model)
|
||||
{
|
||||
$this->assign([
|
||||
'id' => $id,
|
||||
]);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
//审核通过
|
||||
public function confirm(Request $request, WithdrawApply $model)
|
||||
{
|
||||
$param = $request->param();
|
||||
$id = $param['id'];
|
||||
$withdraw =$model
|
||||
->where('id', $id)
|
||||
->find();
|
||||
// 判断提现单是否为待提现状态 1
|
||||
if($withdraw['status'] != 1) {
|
||||
return error('不是待提现申请单');
|
||||
}
|
||||
// 启动事务
|
||||
$model->startTrans();
|
||||
try{
|
||||
// 直接标识为审核成功状态
|
||||
$model
|
||||
->where('id', $id)
|
||||
->update(['status' =>2, 'update_time' => time(),'description'=>$param['description']]);
|
||||
// 提交事务
|
||||
$model->commit();
|
||||
}catch(\Exception $e){
|
||||
// 回滚事务
|
||||
$model->rollback();
|
||||
return error($e->getMessage());
|
||||
}
|
||||
return success('审核通过');
|
||||
}
|
||||
|
||||
//审核拒绝
|
||||
public function refuse(Request $request, WithdrawApply $model)
|
||||
{
|
||||
$model->startTrans();
|
||||
$param = $request->param();
|
||||
try{
|
||||
$withdraw_apply = WithdrawApply::where('id', $param['id'])->find();
|
||||
$withdraw_apply->status =3; // 提现失败
|
||||
$withdraw_apply->description = $param['description'];
|
||||
$withdraw_apply->update_time = time();
|
||||
$withdraw_apply->save();
|
||||
|
||||
//拒绝提现,回退佣金
|
||||
$user = User::get($withdraw_apply['user_id']);
|
||||
$user->integral = ['inc', $withdraw_apply['money']];
|
||||
$user->save();
|
||||
|
||||
//增加账户变动记录
|
||||
AccountLog::AccountRecord(
|
||||
$withdraw_apply['user_id'],
|
||||
$withdraw_apply['money'],
|
||||
1,
|
||||
130,
|
||||
'',
|
||||
$withdraw_apply['id'],
|
||||
$withdraw_apply['sn']
|
||||
);
|
||||
$model->commit();
|
||||
} catch (Exception $e){
|
||||
$model->rollback();
|
||||
return error($e->getMessage());
|
||||
}
|
||||
return success('提现失败已回退用户账户');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,174 @@
|
|||
{extend name="public/base" /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<style type="text/css">
|
||||
.layui-table-cell {
|
||||
height: auto;
|
||||
white-space: normal;
|
||||
}
|
||||
.layui-card-header.layuiadmin-card-header-auto {
|
||||
padding-top: 15px;
|
||||
padding-bottom: 15px;
|
||||
height: auto;
|
||||
}
|
||||
.layui-form-label{ width:100px; }
|
||||
</style>
|
||||
<!--数据列表页面-->
|
||||
<section class="content">
|
||||
|
||||
<!--顶部搜索筛选-->
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
<div class="box-body">
|
||||
<form class="form-inline searchForm" id="searchForm" action="{:url('integrallist')}" method="GET">
|
||||
<div class="layui-form layui-card-header layuiadmin-card-header-auto">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">订单搜索:</label>
|
||||
<div class="layui-input-inline" style="width: 200px;">
|
||||
<select name="keyword_type" id="keyword_type">
|
||||
<option value="sn" {if isset($keyword_type) && $keyword_type=='sn'}selected{/if}>会员编号</option>
|
||||
<option value="nickname" {if isset($keyword_type) && $keyword_type=='nickname'}selected{/if}>会员昵称</option>
|
||||
<option value="mobile" {if isset($keyword_type) && $keyword_type=='mobile'}selected{/if}>会员手机号码</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-input-inline" style="width: 200px;">
|
||||
<input type="text" id="keyword" name="keyword" value="{$keyword?$keyword:'';}" placeholder="请输入关键词" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">变动类型:</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="source_type" id="source_type">
|
||||
<option value="0">全部</option>
|
||||
{foreach $source_type_list as $key => $value}
|
||||
<option value="{$key}" {if isset($source_type) && $source_type==$key}selected{/if}>{$value}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">下单时间:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" class="layui-input" id="start_time" name="start_time" value="{$start_time?$start_time:'';}" autocomplete="off">
|
||||
</div>
|
||||
<div class="layui-input-inline" style="margin-right: 5px;width: 10px;">
|
||||
<label class="layui-form-mid">-</label>
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" class="layui-input" id="end_time" name="end_time" value="{$end_time?$end_time:'';}" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<div class="layui-inline">
|
||||
<button class="btn btn-success btn-sm" type="submit" >查询</button>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button onclick="clearSearchForm()" class="btn btn-sm btn-default" type="button"><i
|
||||
class="fa fa-eraser"></i> 清空查询
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
|
||||
<!--数据列表顶部-->
|
||||
<div class="box-header">
|
||||
<div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body table-responsive">
|
||||
<table class="table table-hover table-bordered datatable" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>流水单号(20位)</th>
|
||||
<th>会员昵称</th>
|
||||
<th>会员编号</th>
|
||||
<th>手机号码</th>
|
||||
<th>来源类型</th>
|
||||
<th>来源单号</th>
|
||||
<th>变动总数</th>
|
||||
<th>剩余总数</th>
|
||||
<th>变动时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="data" item="item"}
|
||||
<tr>
|
||||
<td>{$item.log_sn}</td>
|
||||
<td>{$item.nickname}</td>
|
||||
<td>{$item.user_sn}</td>
|
||||
<td>{$item.mobile}</td>
|
||||
<td>{$item.source_type_text}</td>
|
||||
<td>{$item.source_sn}</td>
|
||||
<td>{$item.change_amount}</td>
|
||||
<td>{$item.left_amount}</td>
|
||||
<td>{$item.create_time}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据列表底部 -->
|
||||
<div class="box-footer">
|
||||
{$page|raw}
|
||||
<label class="control-label pull-right" style="margin-right: 10px; font-weight: 100;">
|
||||
<small>共{$total}条记录</small>
|
||||
<small>每页显示</small>
|
||||
|
||||
<select class="input-sm" onchange="changePerPage(this)">
|
||||
<option value="10" {if $admin.per_page==10}selected{/if}>10</option>
|
||||
<option value="20" {if $admin.per_page==20}selected{/if}>20</option>
|
||||
<option value="30" {if $admin.per_page==30}selected{/if}>30</option>
|
||||
<option value="50" {if $admin.per_page==50}selected{/if}>50</option>
|
||||
<option value="100" {if $admin.per_page==100}selected{/if}>100</option>
|
||||
</select>
|
||||
|
||||
<small>条记录</small>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<script type="text/javascript">
|
||||
layui.use(['form','table'], function(){
|
||||
var form = layui.form;
|
||||
form.render('select');
|
||||
});
|
||||
//日期时间范围
|
||||
laydate.render({
|
||||
elem: '#start_time'
|
||||
,type: 'datetime'
|
||||
,trigger: 'click'
|
||||
});
|
||||
|
||||
//日期时间范围
|
||||
laydate.render({
|
||||
elem: '#end_time'
|
||||
,type: 'datetime'
|
||||
,trigger: 'click'
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
|
||||
|
|
@ -1,243 +0,0 @@
|
|||
{extend name='public/base' /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-primary">
|
||||
<!-- 表单头部 -->
|
||||
<div class="box-header with-border">
|
||||
<div class="btn-group">
|
||||
<a class="btn flat btn-sm btn-default BackButton">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
返回
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 表单 -->
|
||||
<form id="dataForm" class="form-horizontal dataForm" action="" method="post" enctype="multipart/form-data">
|
||||
<!-- 表单字段区域 -->
|
||||
<div class="box-body">
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-sm-2 control-label">标题</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="name" name="name" value="{$data.name|default=''}" placeholder="请输入标题" type="text" class="form-control field-text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="user_id" class="col-sm-2 control-label">发布人</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<select name="user_id" id="user_id" class="form-control field-select" data-placeholder="请选择发布人">
|
||||
<option value=""></option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#user_id').select2();
|
||||
</script>
|
||||
<div class="form-group">
|
||||
<label for="article_category_id" class="col-sm-2 control-label">所属分类</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<select name="article_category_id" id="article_category_id" class="form-control field-select" data-placeholder="请选择所属分类">
|
||||
<option value=""></option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#article_category_id').select2();
|
||||
</script>
|
||||
<div class="form-group">
|
||||
<label for="description" class="col-sm-2 control-label">简介</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="description" name="description" value="{$data.description|default=''}" placeholder="请输入简介" type="text" class="form-control field-text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="content" class="col-sm-2 control-label">内容</label>
|
||||
<div class="col-sm-10">
|
||||
<script id="content" name="content" type="text/plain">{$data.content|raw|default=''}</script>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
UE.delEditor('content');
|
||||
var UE_content = UE.getEditor('content',{
|
||||
serverUrl :UEServer
|
||||
});
|
||||
</script>
|
||||
<div class="form-group">
|
||||
<label for="is_top" class="col-sm-2 control-label">是否置顶</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input class="input-switch" id="is_top" value="1" {if(!isset($data) ||$data.is_top==1)}checked{/if} type="checkbox" />
|
||||
<input class="switch field-switch" placeholder="是否置顶" name="is_top" value="{$data.is_top|default='1'}" hidden />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$('#is_top').bootstrapSwitch({
|
||||
onText: "是",
|
||||
offText: "否",
|
||||
onColor: "success",
|
||||
offColor: "danger",
|
||||
onSwitchChange: function (event, state) {
|
||||
$(event.target).closest('.bootstrap-switch').next().val(state ? '1' : '0').change();
|
||||
}
|
||||
});
|
||||
</script><div class="form-group">
|
||||
<label for="is_hot" class="col-sm-2 control-label">是否热门</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input class="input-switch" id="is_hot" value="1" {if(!isset($data) ||$data.is_hot==1)}checked{/if} type="checkbox" />
|
||||
<input class="switch field-switch" placeholder="是否热门" name="is_hot" value="{$data.is_hot|default='1'}" hidden />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$('#is_hot').bootstrapSwitch({
|
||||
onText: "是",
|
||||
offText: "否",
|
||||
onColor: "success",
|
||||
offColor: "danger",
|
||||
onSwitchChange: function (event, state) {
|
||||
$(event.target).closest('.bootstrap-switch').next().val(state ? '1' : '0').change();
|
||||
}
|
||||
});
|
||||
</script> <div class="form-group">
|
||||
<label for="img" class="col-sm-2 control-label">缩略图</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="img" name="img" placeholder="请上传缩略图" {if isset($data.img)}data-initial-preview="{$data.img}"{/if} type="file" class="form-control field-image" >
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#img').fileinput({
|
||||
language: 'zh',
|
||||
overwriteInitial: true,
|
||||
browseLabel: '浏览',
|
||||
initialPreviewAsData: true,
|
||||
dropZoneEnabled: false,
|
||||
showUpload:false,
|
||||
showRemove: false,
|
||||
allowedFileTypes:['image'],
|
||||
maxFileSize:10240,
|
||||
});
|
||||
</script>
|
||||
<div class="form-group">
|
||||
<label for="sort_number" class="col-sm-2 control-label">排序</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="sort_number" name="sort_number" value="{$data.sort_number|default='1000'}" placeholder="请输入排序" type="text" class="form-control field-text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="view_count" class="col-sm-2 control-label">浏览数</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<div class="input-group">
|
||||
<input id="view_count" name="view_count" value="{$data.view_count|default='0'}" placeholder="请输入浏览数" type="number" class="form-control field-number">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#view_count')
|
||||
.bootstrapNumber({
|
||||
upClass: 'success',
|
||||
downClass: 'primary',
|
||||
center: true
|
||||
});
|
||||
</script>
|
||||
|
||||
</div>
|
||||
<!-- 表单底部 -->
|
||||
<div class="box-footer">
|
||||
{:token()}
|
||||
<div class="col-sm-2">
|
||||
</div>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
{if !isset($data)}
|
||||
<div class="btn-group pull-right">
|
||||
<label class="createContinue">
|
||||
<input type="checkbox" value="1" id="_create" name="_create"
|
||||
title="继续添加数据">继续添加</label>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="btn-group">
|
||||
<button type="submit" class="btn flat btn-info dataFormSubmit">
|
||||
保存
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button type="reset" class="btn flat btn-default dataFormReset">
|
||||
重置
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<script>
|
||||
/** 表单验证 **/
|
||||
$('#dataForm').validate({
|
||||
rules: {
|
||||
'name': {
|
||||
required: true,
|
||||
},
|
||||
'user_id': {
|
||||
required: true,
|
||||
},
|
||||
'article_category_id': {
|
||||
required: true,
|
||||
},
|
||||
'description': {
|
||||
required: true,
|
||||
},
|
||||
'content': {
|
||||
required: true,
|
||||
},
|
||||
'is_top': {
|
||||
required: true,
|
||||
},
|
||||
'is_hot': {
|
||||
required: true,
|
||||
},
|
||||
'sort_number': {
|
||||
required: true,
|
||||
},
|
||||
'view_count': {
|
||||
required: true,
|
||||
},
|
||||
|
||||
},
|
||||
messages: {
|
||||
'name': {
|
||||
required: "标题不能为空",
|
||||
},
|
||||
'user_id': {
|
||||
required: "发布人不能为空",
|
||||
},
|
||||
'article_category_id': {
|
||||
required: "所属分类不能为空",
|
||||
},
|
||||
'description': {
|
||||
required: "简介不能为空",
|
||||
},
|
||||
'content': {
|
||||
required: "内容不能为空",
|
||||
},
|
||||
'is_top': {
|
||||
required: "是否置顶不能为空",
|
||||
},
|
||||
'is_hot': {
|
||||
required: "是否热门不能为空",
|
||||
},
|
||||
'sort_number': {
|
||||
required: "排序不能为空",
|
||||
},
|
||||
'view_count': {
|
||||
required: "浏览数不能为空",
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
|
|
@ -1,138 +0,0 @@
|
|||
{extend name="public/base" /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<!--数据列表页面-->
|
||||
<section class="content">
|
||||
|
||||
<!--顶部搜索筛选-->
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
<div class="box-body">
|
||||
<form class="form-inline searchForm" id="searchForm" action="{:url('index')}" method="GET">
|
||||
|
||||
<div class="form-group">
|
||||
<input value="{$_keywords ? $_keywords : '' ;}"
|
||||
name="_keywords" id="_keywords" class="form-control input-sm" placeholder="标题/简介">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<button class="btn btn-sm btn-primary" type="submit"><i class="fa fa-search"></i> 查询
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<button onclick="clearSearchForm()" class="btn btn-sm btn-default" type="button"><i
|
||||
class="fa fa-eraser"></i> 清空查询
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
|
||||
<!--数据列表顶部-->
|
||||
<div class="box-header">
|
||||
<div>
|
||||
<a title="添加" data-toggle="tooltip" class="btn btn-primary btn-sm " href="{:url('add')}">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-danger btn-sm AjaxButton" data-toggle="tooltip" title="删除选中数据" data-confirm-title="删除确认" data-confirm-content="您确定要删除选中的数据吗?" data-id="checked" data-url="{:url('del')}">
|
||||
<i class="fa fa-trash"></i> 删除
|
||||
</a>
|
||||
|
||||
<a class="btn btn-success btn-sm ReloadButton" data-toggle="tooltip" title="刷新">
|
||||
<i class="fa fa-refresh"></i> 刷新
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body table-responsive">
|
||||
<table class="table table-hover table-bordered datatable" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<input id="dataCheckAll" type="checkbox" onclick="checkAll(this)" class="checkbox" placeholder="全选/取消">
|
||||
</th>
|
||||
<th>ID</th>
|
||||
<th>标题</th>
|
||||
<th>发布人</th>
|
||||
<th>所属分类</th>
|
||||
<th>简介</th>
|
||||
<th>是否置顶</th>
|
||||
<th>是否热门</th>
|
||||
<th>缩略图</th>
|
||||
<th>排序</th>
|
||||
<th>浏览数</th>
|
||||
<th>发布时间</th>
|
||||
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="data" item="item"}
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" onclick="checkThis(this)" name="data-checkbox" data-id="{$item.id}" class="checkbox data-list-check" value="{$item.id}" placeholder="选择/取消">
|
||||
</td>
|
||||
<td>{$item.id}</td>
|
||||
<td>{$item.name}</td>
|
||||
<td>{$item.user_id}</td>
|
||||
<td>{$item.article_category_id}</td>
|
||||
<td>{$item.description}</td>
|
||||
<td>{$item.is_top_text}</td>
|
||||
<td>{$item.is_hot_text}</td>
|
||||
<td><img class="dataListImg" src="{$item.img}"></td>
|
||||
<td>{$item.sort_number}</td>
|
||||
<td>{$item.view_count}</td>
|
||||
<td>{$item.create_time}</td>
|
||||
|
||||
<td class="td-do">
|
||||
<a href="{:url('edit',['id'=>$item.id])}"
|
||||
class="btn btn-primary btn-xs" title="修改" data-toggle="tooltip">
|
||||
<i class="fa fa-pencil"></i>
|
||||
</a>
|
||||
<a class="btn btn-danger btn-xs AjaxButton" data-toggle="tooltip" title="删除" data-id="{$item.id}" data-confirm-title="删除确认" data-confirm-content='您确定要删除ID为 <span class="text-red">{$item.id}</span> 的数据吗' data-url="{:url('del')}">
|
||||
<i class="fa fa-trash"></i>
|
||||
</a>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据列表底部 -->
|
||||
<div class="box-footer">
|
||||
{$page|raw}
|
||||
<label class="control-label pull-right" style="margin-right: 10px; font-weight: 100;">
|
||||
<small>共{$total}条记录</small>
|
||||
<small>每页显示</small>
|
||||
|
||||
<select class="input-sm" onchange="changePerPage(this)">
|
||||
<option value="10" {if $admin.per_page==10}selected{/if}>10</option>
|
||||
<option value="20" {if $admin.per_page==20}selected{/if}>20</option>
|
||||
<option value="30" {if $admin.per_page==30}selected{/if}>30</option>
|
||||
<option value="50" {if $admin.per_page==50}selected{/if}>50</option>
|
||||
<option value="100" {if $admin.per_page==100}selected{/if}>100</option>
|
||||
</select>
|
||||
|
||||
<small>条记录</small>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/block}
|
||||
|
||||
|
|
@ -1,100 +0,0 @@
|
|||
{extend name='public/base' /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-primary">
|
||||
<!-- 表单头部 -->
|
||||
<div class="box-header with-border">
|
||||
<div class="btn-group">
|
||||
<a class="btn flat btn-sm btn-default BackButton">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
返回
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 表单 -->
|
||||
<form id="dataForm" class="form-horizontal dataForm" action="" method="post"
|
||||
enctype="multipart/form-data">
|
||||
<!-- 表单字段区域 -->
|
||||
<div class="box-body">
|
||||
<div class="form-group">
|
||||
<label for="parent_id" class="col-sm-2 control-label">上级分类</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<select name="parent_id" id="parent_id" class="form-control field-select"
|
||||
data-placeholder="请选择上级分类">
|
||||
<option value="0">顶级分类</option>
|
||||
{foreach name='cat_list' id='item'}
|
||||
<option value="{$item.id}" {if isset($data)&& $data.parent_id==$item.id}selected{/if}>{$item.name}</option>
|
||||
{/foreach}
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#parent_id').select2();
|
||||
</script>
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-sm-2 control-label">名称</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="name" name="name" value="{$data.name|default=''}" placeholder="请输入名称"
|
||||
type="text" class="form-control field-text">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- 表单底部 -->
|
||||
<div class="box-footer">
|
||||
{:token()}
|
||||
<div class="col-sm-2">
|
||||
</div>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
{if !isset($data)}
|
||||
<div class="btn-group pull-right">
|
||||
<label class="createContinue">
|
||||
<input type="checkbox" value="1" id="_create" name="_create"
|
||||
title="继续添加数据">继续添加</label>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="btn-group">
|
||||
<button type="submit" class="btn flat btn-info dataFormSubmit">
|
||||
保存
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button type="reset" class="btn flat btn-default dataFormReset">
|
||||
重置
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<script>
|
||||
/** 表单验证 **/
|
||||
$('#dataForm').validate({
|
||||
rules: {
|
||||
'parent_id': {
|
||||
required: true,
|
||||
},
|
||||
'name': {
|
||||
required: true,
|
||||
},
|
||||
|
||||
},
|
||||
messages: {
|
||||
'parent_id': {
|
||||
required: "上级分类不能为空",
|
||||
},
|
||||
'name': {
|
||||
required: "名称不能为空",
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
{extend name="public/base" /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<!--数据列表页面-->
|
||||
<section class="content">
|
||||
|
||||
<!--顶部搜索筛选-->
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
<div class="box-body">
|
||||
<form class="form-inline searchForm" id="searchForm" action="{:url('index')}" method="GET">
|
||||
|
||||
<div class="form-group">
|
||||
<input value="{$_keywords ? $_keywords : '' ;}"
|
||||
name="_keywords" id="_keywords" class="form-control input-sm" placeholder="名称">
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<button class="btn btn-sm btn-primary" type="submit"><i class="fa fa-search"></i> 查询
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<button onclick="clearSearchForm()" class="btn btn-sm btn-default" type="button"><i
|
||||
class="fa fa-eraser"></i> 清空查询
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
|
||||
<!--数据列表顶部-->
|
||||
<div class="box-header">
|
||||
<div>
|
||||
<a title="添加" data-toggle="tooltip" class="btn btn-primary btn-sm " href="{:url('add')}">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-danger btn-sm AjaxButton" data-toggle="tooltip" title="删除选中数据"
|
||||
data-confirm-title="删除确认" data-confirm-content="您确定要删除选中的数据吗?" data-id="checked"
|
||||
data-url="{:url('del')}">
|
||||
<i class="fa fa-trash"></i> 删除
|
||||
</a>
|
||||
|
||||
<a class="btn btn-success btn-sm ReloadButton" data-toggle="tooltip" title="刷新">
|
||||
<i class="fa fa-refresh"></i> 刷新
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body table-responsive">
|
||||
<table class="table table-hover table-bordered datatable" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<input id="dataCheckAll" type="checkbox" onclick="checkAll(this)" class="checkbox"
|
||||
placeholder="全选/取消">
|
||||
</th>
|
||||
<th>ID</th>
|
||||
<th>名称</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{$data|raw}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/block}
|
||||
|
||||
|
|
@ -1,95 +0,0 @@
|
|||
{extend name='public/base' /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-primary">
|
||||
<!-- 表单头部 -->
|
||||
<div class="box-header with-border">
|
||||
<div class="btn-group">
|
||||
<a class="btn flat btn-sm btn-default BackButton">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
返回
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 表单 -->
|
||||
<form id="dataForm" class="form-horizontal dataForm" action="" method="post" enctype="multipart/form-data">
|
||||
<!-- 表单字段区域 -->
|
||||
<div class="box-body">
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-sm-2 control-label">名称</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="name" name="name" value="{$data.name|default=''}" placeholder="请输入名称" type="text" class="form-control field-text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="img" class="col-sm-2 control-label">图片</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="img" name="img" placeholder="请上传图片" {if isset($data.img)}data-initial-preview="{$data.img}"{/if} type="file" class="form-control field-image" >
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#img').fileinput({
|
||||
language: 'zh',
|
||||
overwriteInitial: true,
|
||||
browseLabel: '浏览',
|
||||
initialPreviewAsData: true,
|
||||
dropZoneEnabled: false,
|
||||
showUpload:false,
|
||||
showRemove: false,
|
||||
allowedFileTypes:['image'],
|
||||
maxFileSize:10240,
|
||||
});
|
||||
</script>
|
||||
|
||||
</div>
|
||||
<!-- 表单底部 -->
|
||||
<div class="box-footer">
|
||||
{:token()}
|
||||
<div class="col-sm-2">
|
||||
</div>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
{if !isset($data)}
|
||||
<div class="btn-group pull-right">
|
||||
<label class="createContinue">
|
||||
<input type="checkbox" value="1" id="_create" name="_create"
|
||||
title="继续添加数据">继续添加</label>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="btn-group">
|
||||
<button type="submit" class="btn flat btn-info dataFormSubmit">
|
||||
保存
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button type="reset" class="btn flat btn-default dataFormReset">
|
||||
重置
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<script>
|
||||
/** 表单验证 **/
|
||||
$('#dataForm').validate({
|
||||
rules: {
|
||||
'name': {
|
||||
required: true,
|
||||
},
|
||||
|
||||
},
|
||||
messages: {
|
||||
'name': {
|
||||
required: "名称不能为空",
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
|
|
@ -1,131 +0,0 @@
|
|||
{extend name="public/base" /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<!--数据列表页面-->
|
||||
<section class="content">
|
||||
|
||||
<!--顶部搜索筛选-->
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
<div class="box-body">
|
||||
<form class="form-inline searchForm" id="searchForm" action="{:url('index')}" method="GET">
|
||||
|
||||
<div class="form-group">
|
||||
<input value="{$_keywords ? $_keywords : '' ;}"
|
||||
name="_keywords" id="_keywords" class="form-control input-sm" placeholder="名称">
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<button class="btn btn-sm btn-primary" type="submit"><i class="fa fa-search"></i> 查询
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<button onclick="clearSearchForm()" class="btn btn-sm btn-default" type="button"><i
|
||||
class="fa fa-eraser"></i> 清空查询
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
|
||||
<!--数据列表顶部-->
|
||||
<div class="box-header">
|
||||
<div>
|
||||
<a title="添加" data-toggle="tooltip" class="btn btn-primary btn-sm " href="{:url('add')}">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-danger btn-sm AjaxButton" data-toggle="tooltip" title="删除选中数据"
|
||||
data-confirm-title="删除确认" data-confirm-content="您确定要删除选中的数据吗?" data-id="checked"
|
||||
data-url="{:url('del')}">
|
||||
<i class="fa fa-trash"></i> 删除
|
||||
</a>
|
||||
|
||||
<a class="btn btn-success btn-sm ReloadButton" data-toggle="tooltip" title="刷新">
|
||||
<i class="fa fa-refresh"></i> 刷新
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body table-responsive">
|
||||
<table class="table table-hover table-bordered datatable" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<input id="dataCheckAll" type="checkbox" onclick="checkAll(this)" class="checkbox"
|
||||
placeholder="全选/取消">
|
||||
</th>
|
||||
<th>ID</th>
|
||||
<th>名称</th>
|
||||
<th>图片</th>
|
||||
<th>创建时间</th>
|
||||
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="data" item="item"}
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" onclick="checkThis(this)" name="data-checkbox"
|
||||
data-id="{$item.id}" class="checkbox data-list-check" value="{$item.id}"
|
||||
placeholder="选择/取消">
|
||||
</td>
|
||||
<td>{$item.id}</td>
|
||||
<td>{$item.name}</td>
|
||||
<td><img class="dataListImg" src="{$item.img}"></td>
|
||||
<td>{$item.create_time}</td>
|
||||
|
||||
<td class="td-do">
|
||||
<a href="{:url('edit',['id'=>$item.id])}"
|
||||
class="btn btn-primary btn-xs" title="修改" data-toggle="tooltip">
|
||||
<i class="fa fa-pencil"></i>
|
||||
</a>
|
||||
<a class="btn btn-danger btn-xs AjaxButton" data-toggle="tooltip" title="删除"
|
||||
data-id="{$item.id}" data-confirm-title="删除确认"
|
||||
data-confirm-content='您确定要删除ID为 <span class="text-red">{$item.id}</span> 的数据吗'
|
||||
data-url="{:url('del')}">
|
||||
<i class="fa fa-trash"></i>
|
||||
</a>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据列表底部 -->
|
||||
<div class="box-footer">
|
||||
{$page|raw}
|
||||
<label class="control-label pull-right" style="margin-right: 10px; font-weight: 100;">
|
||||
<small>共{$total}条记录</small>
|
||||
<small>每页显示</small>
|
||||
|
||||
<select class="input-sm" onchange="changePerPage(this)">
|
||||
<option value="10" {if $admin.per_page==10}selected{/if}>10</option>
|
||||
<option value="20" {if $admin.per_page==20}selected{/if}>20</option>
|
||||
<option value="30" {if $admin.per_page==30}selected{/if}>30</option>
|
||||
<option value="50" {if $admin.per_page==50}selected{/if}>50</option>
|
||||
<option value="100" {if $admin.per_page==100}selected{/if}>100</option>
|
||||
</select>
|
||||
|
||||
<small>条记录</small>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/block}
|
||||
|
||||
|
|
@ -1,282 +0,0 @@
|
|||
{extend name='public/base' /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-primary">
|
||||
<!-- 表单头部 -->
|
||||
<div class="box-header with-border">
|
||||
<div class="btn-group">
|
||||
<a class="btn flat btn-sm btn-default BackButton">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
返回
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 表单 -->
|
||||
<form id="dataForm" class="form-horizontal dataForm" action="" method="post"
|
||||
enctype="multipart/form-data">
|
||||
<!-- 表单字段区域 -->
|
||||
<div class="box-body">
|
||||
<div class="form-group">
|
||||
<label for="user_id" class="col-sm-2 control-label">用户</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<select name="user_id" id="user_id" class="form-control field-select"
|
||||
data-placeholder="请选择用户">
|
||||
<option value=""></option>
|
||||
{foreach name='user_list' id='item'}
|
||||
<option value="{$item.id}" {if isset($data) &&
|
||||
$data.user_id==$item.id}selected{/if}>
|
||||
{$item.nickname}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#user_id').select2();
|
||||
</script>
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-sm-2 control-label">姓名</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="name" name="name" value="{$data.name|default=''}" placeholder="请输入姓名"
|
||||
type="text" class="form-control field-text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="mobile" class="col-sm-2 control-label">手机号</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="mobile" name="mobile" value="{$data.mobile|default=''}" placeholder="请输入手机号"
|
||||
type="tel" maxlength="11" class="form-control field-mobile">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="province_id" class="col-sm-2 control-label">省</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<select name="province_id" id="province_id" class="form-control field-select"
|
||||
data-placeholder="请选择省" onchange="getRegion(this.value,1)">
|
||||
<option value=""></option>
|
||||
{foreach name='province_list' id='item'}
|
||||
<option value="{$item.id}" {if isset($data) &&
|
||||
$data.province_id==$item.id}selected{/if}>
|
||||
{$item.name}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#province_id').select2();
|
||||
</script>
|
||||
<div class="form-group">
|
||||
<label for="city_id" class="col-sm-2 control-label">市</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<select name="city_id" id="city_id" class="form-control field-select"
|
||||
data-placeholder="请选择市" onchange="getRegion(this.value,2)">
|
||||
<option value=""></option>
|
||||
{foreach name='city_list' id='item'}
|
||||
<option value="{$item.id}" {if isset($data) &&
|
||||
$data.city_id==$item.id}selected{/if}>
|
||||
{$item.name}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#city_id').select2();
|
||||
</script>
|
||||
<div class="form-group">
|
||||
<label for="district_id" class="col-sm-2 control-label">区</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<select name="district_id" id="district_id" class="form-control field-select"
|
||||
data-placeholder="请选择区" onchange="getRegion(this.value,3)">
|
||||
<option value=""></option>
|
||||
{foreach name='district_list' id='item'}
|
||||
<option value="{$item.id}" {if isset($data) &&
|
||||
$data.district_id==$item.id}selected{/if}>
|
||||
{$item.name}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#district_id').select2();
|
||||
</script>
|
||||
<div class="form-group">
|
||||
<label for="street_id" class="col-sm-2 control-label">街道</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<select name="street_id" id="street_id" class="form-control field-select"
|
||||
data-placeholder="请选择街道" onchange="getRegion(this.value,4)">
|
||||
<option value=""></option>
|
||||
{foreach name='street_list' id='item'}
|
||||
<option value="{$item.id}" {if isset($data) &&
|
||||
$data.street_id==$item.id}selected{/if}>
|
||||
{$item.name}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#street_id').select2();
|
||||
</script>
|
||||
<div class="form-group">
|
||||
<label for="detail" class="col-sm-2 control-label">详细地址</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="detail" name="detail" value="{$data.detail|default=''}" placeholder="请输入详细地址"
|
||||
type="text" class="form-control field-text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="is_default" class="col-sm-2 control-label">是否默认</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input class="input-switch" id="is_default" value="1" {if(!isset($data)
|
||||
||$data.is_default==1)}checked{/if} type="checkbox"/>
|
||||
<input class="switch field-switch" placeholder="是否默认" name="is_default"
|
||||
value="{$data.is_default|default='0'}" hidden/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$('#is_default').bootstrapSwitch({
|
||||
onText: "是",
|
||||
offText: "否",
|
||||
onColor: "success",
|
||||
offColor: "danger",
|
||||
onSwitchChange: function (event, state) {
|
||||
$(event.target).closest('.bootstrap-switch').next().val(state ? '1' : '0').change();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<!-- 表单底部 -->
|
||||
<div class="box-footer">
|
||||
{:token()}
|
||||
<div class="col-sm-2">
|
||||
</div>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
{if !isset($data)}
|
||||
<div class="btn-group pull-right">
|
||||
<label class="createContinue">
|
||||
<input type="checkbox" value="1" id="_create" name="_create"
|
||||
title="继续添加数据">继续添加</label>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="btn-group">
|
||||
<button type="submit" class="btn flat btn-info dataFormSubmit">
|
||||
保存
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button type="reset" class="btn flat btn-default dataFormReset">
|
||||
重置
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<script>
|
||||
/** 表单验证 **/
|
||||
$('#dataForm').validate({
|
||||
rules: {
|
||||
'user_id': {
|
||||
required: true,
|
||||
},
|
||||
'name': {
|
||||
required: true,
|
||||
},
|
||||
'mobile': {
|
||||
required: true,
|
||||
},
|
||||
'province_id': {
|
||||
required: true,
|
||||
},
|
||||
'city_id': {
|
||||
required: true,
|
||||
},
|
||||
'district_id': {
|
||||
required: true,
|
||||
},
|
||||
'street_id': {
|
||||
required: true,
|
||||
},
|
||||
'detail': {
|
||||
required: true,
|
||||
},
|
||||
'is_default': {
|
||||
required: true,
|
||||
},
|
||||
|
||||
},
|
||||
messages: {
|
||||
'user_id': {
|
||||
required: "用户不能为空",
|
||||
},
|
||||
'name': {
|
||||
required: "姓名不能为空",
|
||||
},
|
||||
'mobile': {
|
||||
required: "手机号不能为空",
|
||||
},
|
||||
'province_id': {
|
||||
required: "省不能为空",
|
||||
},
|
||||
'city_id': {
|
||||
required: "市不能为空",
|
||||
},
|
||||
'district_id': {
|
||||
required: "区不能为空",
|
||||
},
|
||||
'street_id': {
|
||||
required: "街道不能为空",
|
||||
},
|
||||
'detail': {
|
||||
required: "详细地址不能为空",
|
||||
},
|
||||
'is_default': {
|
||||
required: "是否默认不能为空",
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
var regionId = ['#province_id', '#city_id', '#district_id', '#street_id'];
|
||||
var regionHtml = ['请选择省', '请选择市', '请选择区(县)', '请选择街道'];
|
||||
|
||||
$(function () {
|
||||
getRegion(0, 0);
|
||||
});
|
||||
|
||||
function getRegion(parent_id, level) {
|
||||
clearSon(level);
|
||||
var html = '<option value="-1">' + regionHtml[level] + '</option>';
|
||||
$.post('/region/getRegion', {parent_id: parent_id, level: level}, function (result) {
|
||||
$.each(result, function (index, item) {
|
||||
html += '<option value="' + item.id + '">' + item.name + '</option>'
|
||||
});
|
||||
$(regionId[level]).html(html);
|
||||
$('.field-select').select2();
|
||||
});
|
||||
}
|
||||
|
||||
function clearSon(level) {
|
||||
for (var i = level + 1; i <= 4; i++) {
|
||||
var html = '<option value="-1">' + regionHtml[i] + '</option>';
|
||||
$(regionId[i]).html(html);
|
||||
$('.field-select').select2();
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
{/block}
|
||||
|
|
@ -1,138 +0,0 @@
|
|||
{extend name="public/base" /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<!--数据列表页面-->
|
||||
<section class="content">
|
||||
|
||||
<!--顶部搜索筛选-->
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
<div class="box-body">
|
||||
<form class="form-inline searchForm" id="searchForm" action="{:url('index')}" method="GET">
|
||||
|
||||
<div class="form-group">
|
||||
<input value="{$_keywords ? $_keywords : '' ;}"
|
||||
name="_keywords" id="_keywords" class="form-control input-sm" placeholder="姓名/手机号">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<button class="btn btn-sm btn-primary" type="submit"><i class="fa fa-search"></i> 查询
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<button onclick="clearSearchForm()" class="btn btn-sm btn-default" type="button"><i
|
||||
class="fa fa-eraser"></i> 清空查询
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
|
||||
<!--数据列表顶部-->
|
||||
<div class="box-header">
|
||||
<div>
|
||||
<a title="添加" data-toggle="tooltip" class="btn btn-primary btn-sm " href="{:url('add')}">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-danger btn-sm AjaxButton" data-toggle="tooltip" title="删除选中数据" data-confirm-title="删除确认" data-confirm-content="您确定要删除选中的数据吗?" data-id="checked" data-url="{:url('del')}">
|
||||
<i class="fa fa-trash"></i> 删除
|
||||
</a>
|
||||
|
||||
<a class="btn btn-success btn-sm ReloadButton" data-toggle="tooltip" title="刷新">
|
||||
<i class="fa fa-refresh"></i> 刷新
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body table-responsive">
|
||||
<table class="table table-hover table-bordered datatable" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<input id="dataCheckAll" type="checkbox" onclick="checkAll(this)" class="checkbox" placeholder="全选/取消">
|
||||
</th>
|
||||
<th>ID</th>
|
||||
<th>用户</th>
|
||||
<th>姓名</th>
|
||||
<th>手机号</th>
|
||||
<th>省</th>
|
||||
<th>市</th>
|
||||
<th>区</th>
|
||||
<th>街道</th>
|
||||
<th>详细地址</th>
|
||||
<th>是否默认</th>
|
||||
<th>创建时间</th>
|
||||
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="data" item="item"}
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" onclick="checkThis(this)" name="data-checkbox" data-id="{$item.id}" class="checkbox data-list-check" value="{$item.id}" placeholder="选择/取消">
|
||||
</td>
|
||||
<td>{$item.id}</td>
|
||||
<td>{$item.user.nickname|default=''}</td>
|
||||
<td>{$item.name}</td>
|
||||
<td>{$item.mobile}</td>
|
||||
<td>{$item.province.name|default=''}</td>
|
||||
<td>{$item.city.name|default=''}</td>
|
||||
<td>{$item.district.name|default=''}</td>
|
||||
<td>{$item.street.name|default=''}</td>
|
||||
<td>{$item.detail}</td>
|
||||
<td>{$item.is_default_text}</td>
|
||||
<td>{$item.create_time}</td>
|
||||
|
||||
<td class="td-do">
|
||||
<a href="{:url('edit',['id'=>$item.id])}"
|
||||
class="btn btn-primary btn-xs" title="修改" data-toggle="tooltip">
|
||||
<i class="fa fa-pencil"></i>
|
||||
</a>
|
||||
<a class="btn btn-danger btn-xs AjaxButton" data-toggle="tooltip" title="删除" data-id="{$item.id}" data-confirm-title="删除确认" data-confirm-content='您确定要删除ID为 <span class="text-red">{$item.id}</span> 的数据吗' data-url="{:url('del')}">
|
||||
<i class="fa fa-trash"></i>
|
||||
</a>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据列表底部 -->
|
||||
<div class="box-footer">
|
||||
{$page|raw}
|
||||
<label class="control-label pull-right" style="margin-right: 10px; font-weight: 100;">
|
||||
<small>共{$total}条记录</small>
|
||||
<small>每页显示</small>
|
||||
|
||||
<select class="input-sm" onchange="changePerPage(this)">
|
||||
<option value="10" {if $admin.per_page==10}selected{/if}>10</option>
|
||||
<option value="20" {if $admin.per_page==20}selected{/if}>20</option>
|
||||
<option value="30" {if $admin.per_page==30}selected{/if}>30</option>
|
||||
<option value="50" {if $admin.per_page==50}selected{/if}>50</option>
|
||||
<option value="100" {if $admin.per_page==100}selected{/if}>100</option>
|
||||
</select>
|
||||
|
||||
<small>条记录</small>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/block}
|
||||
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
<!--空白页面参考模版-->
|
||||
{extend name="public/base" /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
<form id="dataForm" class="dataForm form-horizontal" action="{:url('sendEmail')}" method="post"
|
||||
enctype="multipart/form-data">
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<div class="fields-group">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="address" class="col-sm-2 control-label">收信人</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="fa fa-user"></i></span>
|
||||
<input maxlength="300" id="address" name="address" class="form-control"
|
||||
placeholder="多个地址请用英文逗号隔开">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="subject" class="col-sm-2 control-label">主题</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="fa fa-file-text"></i></span>
|
||||
<input maxlength="300" id="subject" name="subject"
|
||||
class="form-control"
|
||||
placeholder="主题">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="subject" class="col-sm-2 control-label">邮件正文</label>
|
||||
<div class="col-sm-8">
|
||||
|
||||
<textarea id="content" name="content" class="form-control" style="height: 300px"
|
||||
placeholder="邮件正文"></textarea>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="subject" class="col-sm-2 control-label">附件</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<div class="btn btn-default btn-file">
|
||||
<i class="fa fa-paperclip"></i>点击上传
|
||||
<input type="file" id="attachment" name="attachment"
|
||||
accept="image/jpeg,image/png,image/gif,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">
|
||||
</div>
|
||||
<small class="help-block">最大不超过2MB</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-footer">
|
||||
{:token()}
|
||||
<div class="col-sm-2">
|
||||
</div>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<div class="btn-group">
|
||||
<button type="submit" class="btn flat btn-info dataFormSubmit">
|
||||
保存
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button type="reset" class="btn flat btn-default dataFormReset">
|
||||
重置
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
<script>
|
||||
$('#dataForm').validate();
|
||||
</script>
|
||||
|
||||
{/block}
|
||||
|
|
@ -1,164 +0,0 @@
|
|||
<!--空白页面参考模版-->
|
||||
{extend name="public/base" /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
{js href="__ADMIN_PLUGINS__/jquery-qrcode/jquery-qrcode.min.js" /}
|
||||
|
||||
<section class="content">
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">前端生成二维码</h3>
|
||||
</div>
|
||||
|
||||
|
||||
<form id="frontDataForm" class="dataForm form-horizontal" method="post" onsubmit="return frontCreate()" enctype="multipart/form-data">
|
||||
<div class="box-body">
|
||||
<div class="fields-group">
|
||||
<div class="form-group">
|
||||
<label for="frontContent" class="col-sm-2 control-label">内容</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="fa fa-pencil"></i></span>
|
||||
<input name="content" id="frontContent" maxlength="210" class="form-control" placeholder="请输入文字或网址,按回车键生成">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">生成结果</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div style="text-align: center">
|
||||
<div id="frontResult"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="box">
|
||||
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">PHP生成二维码</h3>
|
||||
</div>
|
||||
|
||||
<form id="dataForm" class="dataForm form-horizontal" method="post" onsubmit="return create()" enctype="multipart/form-data">
|
||||
<div class="box-body">
|
||||
<div class="fields-group">
|
||||
<div class="form-group">
|
||||
<label for="content" class="col-sm-2 control-label">内容</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="fa fa-pencil"></i></span>
|
||||
<input name="content" id="content" maxlength="210" class="form-control" placeholder="请输入文字或网址,按回车键生成">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">生成结果</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div style="text-align: center">
|
||||
<img src="" id="result">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<img id="qrLogo" style="display: none;" src="/uploads/attachment/20190902/6a673f554c694a41971fca94c7503315.jpg">
|
||||
<script>
|
||||
|
||||
function frontCreate() {
|
||||
var content = $("#frontContent").val();
|
||||
|
||||
//jquery-qrcode 文档地址 https://larsjung.de/jquery-qrcode/
|
||||
$('#frontResult').qrcode({
|
||||
width: "300",
|
||||
height: "300",
|
||||
mode:4,
|
||||
mSize: 0.3,
|
||||
text: toUtf8(content),
|
||||
image:$('#qrLogo')[0]
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//php生成
|
||||
function create() {
|
||||
var content = $("#content").val();
|
||||
$.ajax({
|
||||
url: '{:url("createQrCode")}',
|
||||
type: "post",
|
||||
data: {
|
||||
content:content
|
||||
},
|
||||
dataType: 'json',
|
||||
cache: false,
|
||||
async:false,
|
||||
success: function (result) {
|
||||
console.log(result);
|
||||
if(result.code==1){
|
||||
$("#result").attr('src',result.data.qrcode+"?"+img_name_random());
|
||||
}else {
|
||||
layer.msg(result.msg,{icon:2});
|
||||
}
|
||||
},
|
||||
error: function (XMLHttpRequest, textStatus, errorThrown) {
|
||||
layer.msg('系统异常,请稍后重试',{icon:2});
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
//图片后缀随机数
|
||||
function img_name_random() {
|
||||
var rand_one = parseInt(100 * Math.random());
|
||||
var rand_two = parseInt(100 * Math.random());
|
||||
return String(rand_one) + String(rand_two);
|
||||
}
|
||||
|
||||
|
||||
function toUtf8(str) {
|
||||
var out, i, len, c;
|
||||
out = "";
|
||||
len = str.length;
|
||||
for(i = 0; i < len; i++) {
|
||||
c = str.charCodeAt(i);
|
||||
if ((c >= 0x0001) && (c <= 0x007F)) {
|
||||
out += str.charAt(i);
|
||||
} else if (c > 0x07FF) {
|
||||
out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));
|
||||
out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F));
|
||||
out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
|
||||
} else {
|
||||
out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F));
|
||||
out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
</section>
|
||||
|
||||
{/block}
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
<!--空白页面参考模版-->
|
||||
{extend name="public/base" /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<section class="content">
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
<form id="dataForm" class="dataForm form-horizontal" method="post" onsubmit="return send()"
|
||||
enctype="multipart/form-data">
|
||||
<div class="box-body">
|
||||
<div class="fields-group">
|
||||
<div class="form-group">
|
||||
<label for="mobile" class="col-sm-2 control-label">手机号</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="fa fa-pencil"></i></span>
|
||||
<input name="mobile" id="mobile" maxlength="11" class="form-control"
|
||||
placeholder="请输手机号">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">发送结果</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div style="text-align: center" id="result">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
function send() {
|
||||
var mobile = $("#mobile").val();
|
||||
$.ajax({
|
||||
url: '{:url("sendSms")}',
|
||||
type: "post",
|
||||
data: {
|
||||
mobile: mobile
|
||||
},
|
||||
dataType: 'json',
|
||||
cache: false,
|
||||
async: false,
|
||||
success: function (result) {
|
||||
|
||||
$("#result").html(result.msg);
|
||||
layer.msg(result.msg);
|
||||
},
|
||||
error: function (XMLHttpRequest, textStatus, errorThrown) {
|
||||
layer.msg("系统异常,请稍后重试");
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</section>
|
||||
|
||||
{/block}
|
||||
|
|
@ -1,91 +0,0 @@
|
|||
{extend name='public/base' /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-primary">
|
||||
<!-- 表单头部 -->
|
||||
<div class="box-header with-border">
|
||||
<div class="btn-group">
|
||||
<a class="btn flat btn-sm btn-default BackButton">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
返回
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 表单 -->
|
||||
<form id="dataForm" class="form-horizontal dataForm" action="" method="post"
|
||||
enctype="multipart/form-data">
|
||||
<!-- 表单字段区域 -->
|
||||
<div class="box-body">
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-sm-2 control-label">名称</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="name" name="name" value="{$data.name|default=''}" placeholder="请输入名称"
|
||||
type="text" class="form-control field-text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="code" class="col-sm-2 control-label">编码</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="code" name="code" value="{$data.code|default=''}" placeholder="请输入编码"
|
||||
type="text" class="form-control field-text">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- 表单底部 -->
|
||||
<div class="box-footer">
|
||||
{:token()}
|
||||
<div class="col-sm-2">
|
||||
</div>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
{if !isset($data)}
|
||||
<div class="btn-group pull-right">
|
||||
<label class="createContinue">
|
||||
<input type="checkbox" value="1" id="_create" name="_create"
|
||||
title="继续添加数据">继续添加</label>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="btn-group">
|
||||
<button type="submit" class="btn flat btn-info dataFormSubmit">
|
||||
保存
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button type="reset" class="btn flat btn-default dataFormReset">
|
||||
重置
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<script>
|
||||
/** 表单验证 **/
|
||||
$('#dataForm').validate({
|
||||
rules: {
|
||||
'name': {
|
||||
required: true,
|
||||
},
|
||||
'code': {
|
||||
required: true,
|
||||
},
|
||||
|
||||
},
|
||||
messages: {
|
||||
'name': {
|
||||
required: "名称不能为空",
|
||||
},
|
||||
'code': {
|
||||
required: "编码不能为空",
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
|
|
@ -1,124 +0,0 @@
|
|||
{extend name="public/base" /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<!--数据列表页面-->
|
||||
<section class="content">
|
||||
|
||||
<!--顶部搜索筛选-->
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
<div class="box-body">
|
||||
<form class="form-inline searchForm" id="searchForm" action="{:url('index')}" method="GET">
|
||||
|
||||
<div class="form-group">
|
||||
<input value="{$_keywords ? $_keywords : '' ;}"
|
||||
name="_keywords" id="_keywords" class="form-control input-sm" placeholder="名称">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<button class="btn btn-sm btn-primary" type="submit"><i class="fa fa-search"></i> 查询
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<button onclick="clearSearchForm()" class="btn btn-sm btn-default" type="button"><i
|
||||
class="fa fa-eraser"></i> 清空查询
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
|
||||
<!--数据列表顶部-->
|
||||
<div class="box-header">
|
||||
<div>
|
||||
<a title="添加" data-toggle="tooltip" class="btn btn-primary btn-sm " href="{:url('add')}">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-danger btn-sm AjaxButton" data-toggle="tooltip" title="删除选中数据" data-confirm-title="删除确认" data-confirm-content="您确定要删除选中的数据吗?" data-id="checked" data-url="{:url('del')}">
|
||||
<i class="fa fa-trash"></i> 删除
|
||||
</a>
|
||||
|
||||
<a class="btn btn-success btn-sm ReloadButton" data-toggle="tooltip" title="刷新">
|
||||
<i class="fa fa-refresh"></i> 刷新
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body table-responsive">
|
||||
<table class="table table-hover table-bordered datatable" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<input id="dataCheckAll" type="checkbox" onclick="checkAll(this)" class="checkbox" placeholder="全选/取消">
|
||||
</th>
|
||||
<th>ID</th>
|
||||
<th>名称</th>
|
||||
<th>编码</th>
|
||||
<th>创建时间</th>
|
||||
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="data" item="item"}
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" onclick="checkThis(this)" name="data-checkbox" data-id="{$item.id}" class="checkbox data-list-check" value="{$item.id}" placeholder="选择/取消">
|
||||
</td>
|
||||
<td>{$item.id}</td>
|
||||
<td>{$item.name}</td>
|
||||
<td>{$item.code}</td>
|
||||
<td>{$item.create_time}</td>
|
||||
|
||||
<td class="td-do">
|
||||
<a href="{:url('edit',['id'=>$item.id])}"
|
||||
class="btn btn-primary btn-xs" title="修改" data-toggle="tooltip">
|
||||
<i class="fa fa-pencil"></i>
|
||||
</a>
|
||||
<a class="btn btn-danger btn-xs AjaxButton" data-toggle="tooltip" title="删除" data-id="{$item.id}" data-confirm-title="删除确认" data-confirm-content='您确定要删除ID为 <span class="text-red">{$item.id}</span> 的数据吗' data-url="{:url('del')}">
|
||||
<i class="fa fa-trash"></i>
|
||||
</a>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据列表底部 -->
|
||||
<div class="box-footer">
|
||||
{$page|raw}
|
||||
<label class="control-label pull-right" style="margin-right: 10px; font-weight: 100;">
|
||||
<small>共{$total}条记录</small>
|
||||
<small>每页显示</small>
|
||||
|
||||
<select class="input-sm" onchange="changePerPage(this)">
|
||||
<option value="10" {if $admin.per_page==10}selected{/if}>10</option>
|
||||
<option value="20" {if $admin.per_page==20}selected{/if}>20</option>
|
||||
<option value="30" {if $admin.per_page==30}selected{/if}>30</option>
|
||||
<option value="50" {if $admin.per_page==50}selected{/if}>50</option>
|
||||
<option value="100" {if $admin.per_page==100}selected{/if}>100</option>
|
||||
</select>
|
||||
|
||||
<small>条记录</small>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/block}
|
||||
|
||||
|
|
@ -0,0 +1,177 @@
|
|||
{extend name="public/base" /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<style>
|
||||
.layui-card .header-title {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.layui-card .header-title::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
width: 4px;
|
||||
height: 18px;
|
||||
vertical-align: -4px;
|
||||
margin-right: 5px;
|
||||
background: #3A91FB;
|
||||
}
|
||||
.layui-card .survey-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.layui-card .survey-list .item {
|
||||
width: 20%;
|
||||
min-width: 200px;
|
||||
}
|
||||
.layui-card .survey-list .item .title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.layui-card .survey-list .item .title img {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
margin-right: 12px;
|
||||
}
|
||||
.layui-card .survey-list .item .layuiadmin-big-font {
|
||||
margin-left: 42px;
|
||||
color: #333;
|
||||
font-size: 25px;
|
||||
}
|
||||
</style>
|
||||
<section class="content">
|
||||
<!-- 订单-->
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">
|
||||
<div class="header-title">订单概况</div>
|
||||
</div>
|
||||
<div class="layui-card-body layuiadmin-card-list survey-list">
|
||||
<div class="item">
|
||||
<div class="title">
|
||||
<img class="icon" src="__PUBLIC__/static/common/image/finance/month_order_amount.png" alt="">
|
||||
<div>本月订单金额(元)</div>
|
||||
</div>
|
||||
|
||||
<p class="layuiadmin-big-font">1</p>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="title">
|
||||
<img class="icon" src="__PUBLIC__/static/common/image/finance/total_order_amount.png" alt="">
|
||||
<div>订单总金额(元)</div>
|
||||
</div>
|
||||
|
||||
<p class="layuiadmin-big-font">1</p>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="title">
|
||||
<img class="icon" src="__PUBLIC__/static/common/image/finance/order_num.png" alt="">
|
||||
<div>订单总数(笔)</div>
|
||||
</div>
|
||||
|
||||
<p class="layuiadmin-big-font">1</p>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="title">
|
||||
<img class="icon" src="__PUBLIC__/static/common/image/finance/refund_amount.png" alt="">
|
||||
<div>退款订单总额(元)</div>
|
||||
</div>
|
||||
|
||||
<p class="layuiadmin-big-font">1</p>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="title">
|
||||
<img class="icon" src="__PUBLIC__/static/common/image/finance/refund_num.png" alt="">
|
||||
<div>退款订单总数(笔)</div>
|
||||
</div>
|
||||
|
||||
<p class="layuiadmin-big-font">1</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--会员-->
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">
|
||||
<div class="header-title">会员概况</div>
|
||||
</div>
|
||||
<div class="layui-card-body layuiadmin-card-list survey-list">
|
||||
<div class="item">
|
||||
<div class="title">
|
||||
<img class="icon" src="__PUBLIC__/static/common/image/finance/total_user_money.png" alt="">
|
||||
<div>会员余额(元)</div>
|
||||
</div>
|
||||
|
||||
<p class="layuiadmin-big-font">1</p>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="title">
|
||||
<img class="icon" src="__PUBLIC__/static/common/image/finance/total_user_integral.png" alt="">
|
||||
<div>会员积分 </div>
|
||||
</div>
|
||||
|
||||
<p class="layuiadmin-big-font">1</p>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="title">
|
||||
<img class="icon" src="__PUBLIC__/static/common/image/finance/able_earnings.png" alt="">
|
||||
<div>会员可提现佣金(元)</div>
|
||||
</div>
|
||||
|
||||
<p class="layuiadmin-big-font">1</p>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="title">
|
||||
<img class="icon" src="__PUBLIC__/static/common/image/finance/have_withdraw_earnings.png" alt="">
|
||||
<div>会员已提现佣金(元)</div>
|
||||
</div>
|
||||
|
||||
<p class="layuiadmin-big-font">1</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--分销-->
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">
|
||||
<div class="header-title">分销概况</div>
|
||||
</div>
|
||||
<div class="layui-card-body layuiadmin-card-list survey-list">
|
||||
<div class="item">
|
||||
<div class="title">
|
||||
<img class="icon" src="__PUBLIC__/static/common/image/finance/month_earnings.png" alt="">
|
||||
<div>本月分销佣金(元)</div>
|
||||
</div>
|
||||
|
||||
<p class="layuiadmin-big-font">1</p>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="title">
|
||||
<img class="icon" src="__PUBLIC__/static/common/image/finance/distribution_earnings.png" alt="">
|
||||
<div>分销总佣金(元)</div>
|
||||
</div>
|
||||
|
||||
<p class="layuiadmin-big-font">1</p>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="title">
|
||||
<img class="icon" src="__PUBLIC__/static/common/image/finance/wait_earnings.png" alt="">
|
||||
<div>提现中佣金(元)</div>
|
||||
</div>
|
||||
|
||||
<p class="layuiadmin-big-font">1</p>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="title">
|
||||
<img class="icon" src="__PUBLIC__/static/common/image/finance/distribution_have_withdraw.png" alt="">
|
||||
<div>已提现佣金(元)</div>
|
||||
</div>
|
||||
|
||||
<p class="layuiadmin-big-font">1</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<script>
|
||||
|
||||
</script>
|
||||
|
||||
{/block}
|
||||
|
|
@ -77,7 +77,6 @@ ul.albums li a.btn-fm_z{
|
|||
<ul class="layui-tab-title">
|
||||
<li class="layui-this">基本设置</li>
|
||||
<li>商品详情</li>
|
||||
<li>分销设置</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content">
|
||||
<div class="layui-tab-item layui-show">
|
||||
|
|
@ -227,6 +226,26 @@ ul.albums li a.btn-fm_z{
|
|||
}
|
||||
});
|
||||
</script>
|
||||
<div class="form-group">
|
||||
<label for="is_recommend" class="col-sm-2 control-label">热门推荐</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input class="input-switch" id="is_recommend" value="1" {if(!isset($data)
|
||||
||$data.is_recommend==1)}checked{/if} type="checkbox"/>
|
||||
<input class="switch field-switch" placeholder="是否上架" name="is_recommend"
|
||||
value="{$data.is_recommend|default='1'}" hidden/>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#is_recommend').bootstrapSwitch({
|
||||
onText: "是",
|
||||
offText: "否",
|
||||
onColor: "success",
|
||||
offColor: "danger",
|
||||
onSwitchChange: function (event, state) {
|
||||
$(event.target).closest('.bootstrap-switch').next().val(state ? '1' : '0').change();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div class="form-group">
|
||||
<label for="sort_number" class="col-sm-2 control-label">排序(升序)</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
|
|
@ -260,9 +279,6 @@ ul.albums li a.btn-fm_z{
|
|||
});
|
||||
</script>
|
||||
</div>
|
||||
<div class="layui-tab-item">
|
||||
4
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -93,18 +93,14 @@
|
|||
placeholder="全选/取消">
|
||||
</th>
|
||||
<th>ID</th>
|
||||
<th>图片</th>
|
||||
<th>名称</th>
|
||||
<th>所属分类</th>
|
||||
<th>品牌</th>
|
||||
<th>原价</th>
|
||||
<th>售价</th>
|
||||
<th>重量(克)</th>
|
||||
<th>规格</th>
|
||||
<th>库存</th>
|
||||
<th>排序(升序)</th>
|
||||
<th>是否上架</th>
|
||||
<th>创建时间</th>
|
||||
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
@ -117,18 +113,14 @@
|
|||
placeholder="选择/取消">
|
||||
</td>
|
||||
<td>{$item.id}</td>
|
||||
<td><img class="dataListImg" src="{$item.img}"></td>
|
||||
<td>{$item.name}</td>
|
||||
<td>{$item.goods_category.name|default=''}</td>
|
||||
<td>{$item.brand.name|default=''}</td>
|
||||
<td>{$item.origin_price}</td>
|
||||
<td>{$item.price}</td>
|
||||
<td>{$item.weight}</td>
|
||||
<td>{$item.attr}</td>
|
||||
<td>{$item.stock}</td>
|
||||
<td>{$item.sort_number}</td>
|
||||
<td>{$item.status_text}</td>
|
||||
<td>{$item.create_time}</td>
|
||||
|
||||
<td class="td-do">
|
||||
<a href="{:url('edit',['id'=>$item.id])}"
|
||||
class="btn btn-primary btn-xs" title="修改" data-toggle="tooltip">
|
||||
|
|
|
|||
|
|
@ -1,170 +0,0 @@
|
|||
{extend name='public/base' /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-primary">
|
||||
<!-- 表单头部 -->
|
||||
<div class="box-header with-border">
|
||||
<div class="btn-group">
|
||||
<a class="btn flat btn-sm btn-default BackButton">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
返回
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 表单 -->
|
||||
<form id="dataForm" class="form-horizontal dataForm" action="" method="post" enctype="multipart/form-data">
|
||||
<!-- 表单字段区域 -->
|
||||
<div class="box-body">
|
||||
<div class="form-group box-header with-border">
|
||||
<label for="name" class="col-sm-2 control-label">规格分类名称</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="name" name="name" value="{$data.name|default=''}" placeholder="请输入名称" type="text" class="form-control field-text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body table-responsive">
|
||||
<table id="dataList" class="table table-hover table-bordered datatable" width="100%">
|
||||
<thead>
|
||||
<tr class="input-type">
|
||||
<th>操作</th>
|
||||
<th title="规格名称">规格名称</th>
|
||||
<th title="排序">排序</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="dataBody">
|
||||
{foreach name='gamodel_list' key='k' id='item1'}
|
||||
<tr>
|
||||
<td>
|
||||
<a class="btn btn-xs btn-success" onclick="addNewField(this,2)">追加</a>
|
||||
<a class="btn btn-xs btn-danger" onclick="delThisField(this,1)">删除</a>
|
||||
</td>
|
||||
<td>
|
||||
<label>
|
||||
<input class="form-control field-type" value="{$item1.attr_name}" name="attr_name[{$k}][]"
|
||||
placeholder="请输入规格名称">
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<label>
|
||||
<input class="form-control field-type" value="{$item1.sort_order}" name="sort_order[{$k}][]"
|
||||
placeholder="请输入排序">
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 表单底部 -->
|
||||
<div class="box-footer">
|
||||
{:token()}
|
||||
<div class="col-sm-2">
|
||||
</div>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
{if !isset($data)}
|
||||
<div class="btn-group pull-right">
|
||||
<label class="createContinue">
|
||||
<input type="checkbox" value="1" id="_create" name="_create"
|
||||
title="继续添加数据">继续添加</label>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="btn-group">
|
||||
<button type="submit" class="btn flat btn-info dataFormSubmit">
|
||||
保存
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button type="reset" class="btn flat btn-default dataFormReset">
|
||||
重置
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table>
|
||||
<tbody id="data-template" style="display: none">
|
||||
<tr>
|
||||
<td>
|
||||
<a class="btn btn-xs btn-success" onclick="addNewField(this,2)">追加</a>
|
||||
<a class="btn btn-xs btn-danger" onclick="delThisField(this,1)">删除</a>
|
||||
</td>
|
||||
<td>
|
||||
<label>
|
||||
<input class="form-control" name="attr_nameFORM_INDEX[]" value="" placeholder="规格名称"
|
||||
>
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<label>
|
||||
<input class="form-control" name="sort_orderFORM_INDEX[]" value="" placeholder="排序"
|
||||
>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
<script>
|
||||
/** 表单验证 **/
|
||||
$('#dataForm').validate({
|
||||
rules: {
|
||||
'name': {
|
||||
required: true,
|
||||
},
|
||||
|
||||
},
|
||||
messages: {
|
||||
'name': {
|
||||
required: "名称不能为空",
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
//表单索引
|
||||
var formIndex ='{$gamodel_count}';
|
||||
$(function () {
|
||||
//默认添加一行空的字段
|
||||
if(formIndex==0){
|
||||
addNewField(null, 1);
|
||||
}else{
|
||||
dataBodyRefreshed();
|
||||
}
|
||||
});
|
||||
//添加新的字段
|
||||
function addNewField(obj, type) {
|
||||
|
||||
formIndex++;
|
||||
let template = $("#data-template").html().replace(/FORM_INDEX/g, '[' + formIndex + ']').replace(/INDEX_ID/g, formIndex);
|
||||
|
||||
if (obj == null) {
|
||||
$("#dataBody").append(template);
|
||||
} else {
|
||||
if (type === 1) {
|
||||
$(obj).parent().parent().before(template);
|
||||
} else {
|
||||
$(obj).parent().parent().after(template);
|
||||
}
|
||||
}
|
||||
|
||||
//刷新 dataBody DOM后的操作
|
||||
dataBodyRefreshed();
|
||||
}
|
||||
//列表刷新后的操作
|
||||
function dataBodyRefreshed() {
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
}
|
||||
//删除当前字段
|
||||
function delThisField(obj) {
|
||||
layer.confirm('您确认删除本行吗?', {title: '删除确认', closeBtn: 1, icon: 3}, function () {
|
||||
$(obj).parent().parent().remove();
|
||||
layer.closeAll();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
|
|
@ -1,118 +0,0 @@
|
|||
{extend name="public/base" /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<!--数据列表页面-->
|
||||
<section class="content">
|
||||
|
||||
<!--顶部搜索筛选-->
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
<div class="box-body">
|
||||
<form class="form-inline searchForm" id="searchForm" action="{:url('index')}" method="GET">
|
||||
|
||||
<div class="form-group">
|
||||
<input value="{$_keywords ? $_keywords : '' ;}"
|
||||
name="_keywords" id="_keywords" class="form-control input-sm" placeholder="名称">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<button class="btn btn-sm btn-primary" type="submit"><i class="fa fa-search"></i> 查询
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<button onclick="clearSearchForm()" class="btn btn-sm btn-default" type="button"><i
|
||||
class="fa fa-eraser"></i> 清空查询
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
|
||||
<!--数据列表顶部-->
|
||||
<div class="box-header">
|
||||
<div>
|
||||
<a title="添加" data-toggle="tooltip" class="btn btn-primary btn-sm " href="{:url('add')}">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-danger btn-sm AjaxButton" data-toggle="tooltip" title="删除选中数据" data-confirm-title="删除确认" data-confirm-content="您确定要删除选中的数据吗?" data-id="checked" data-url="{:url('del')}">
|
||||
<i class="fa fa-trash"></i> 删除
|
||||
</a>
|
||||
|
||||
<a class="btn btn-success btn-sm ReloadButton" data-toggle="tooltip" title="刷新">
|
||||
<i class="fa fa-refresh"></i> 刷新
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body table-responsive">
|
||||
<table class="table table-hover table-bordered datatable" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<input id="dataCheckAll" type="checkbox" onclick="checkAll(this)" class="checkbox" placeholder="全选/取消">
|
||||
</th>
|
||||
<th>名称</th>
|
||||
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="data" item="item"}
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" onclick="checkThis(this)" name="data-checkbox" data-id="{$item.id}" class="checkbox data-list-check" value="{$item.id}" placeholder="选择/取消">
|
||||
</td>
|
||||
<td>{$item.name}</td>
|
||||
|
||||
<td class="td-do">
|
||||
<a href="{:url('edit',['id'=>$item.id])}"
|
||||
class="btn btn-primary btn-xs" title="修改" data-toggle="tooltip">
|
||||
<i class="fa fa-pencil"></i>
|
||||
</a>
|
||||
<a class="btn btn-danger btn-xs AjaxButton" data-toggle="tooltip" title="删除" data-id="{$item.id}" data-confirm-title="删除确认" data-confirm-content='您确定要删除ID为 <span class="text-red">{$item.id}</span> 的数据吗' data-url="{:url('del')}">
|
||||
<i class="fa fa-trash"></i>
|
||||
</a>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据列表底部 -->
|
||||
<div class="box-footer">
|
||||
{$page|raw}
|
||||
<label class="control-label pull-right" style="margin-right: 10px; font-weight: 100;">
|
||||
<small>共{$total}条记录</small>
|
||||
<small>每页显示</small>
|
||||
|
||||
<select class="input-sm" onchange="changePerPage(this)">
|
||||
<option value="10" {if $admin.per_page==10}selected{/if}>10</option>
|
||||
<option value="20" {if $admin.per_page==20}selected{/if}>20</option>
|
||||
<option value="30" {if $admin.per_page==30}selected{/if}>30</option>
|
||||
<option value="50" {if $admin.per_page==50}selected{/if}>50</option>
|
||||
<option value="100" {if $admin.per_page==100}selected{/if}>100</option>
|
||||
</select>
|
||||
|
||||
<small>条记录</small>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/block}
|
||||
|
||||
|
|
@ -1,251 +1,154 @@
|
|||
{extend name="public/base" /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<style>
|
||||
.header-font{
|
||||
font-size: 20px
|
||||
}
|
||||
.layui-card .data-all {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 20px;
|
||||
}
|
||||
.layui-card .text-style {
|
||||
font-size: 16px;
|
||||
}
|
||||
.header-time{
|
||||
margin-left: 20px
|
||||
}
|
||||
.layadmin-shortcut .shortcut-list {
|
||||
padding: 30px 0;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.layadmin-shortcut .shortcut-list li {
|
||||
min-width: 100px;
|
||||
margin-bottom: 20px;
|
||||
width: 12.5%;
|
||||
}
|
||||
|
||||
.layadmin-shortcut .shortcut-list .icon{
|
||||
width: 62px;
|
||||
height: 62px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.tips {
|
||||
float: right;
|
||||
padding: 0 10px;
|
||||
margin-top: 10px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
font-size: 12px;
|
||||
color: #3A91FB;
|
||||
border-radius: 30px;
|
||||
border: 1px #3A91FB solid;
|
||||
background: #eaf3ff;
|
||||
}
|
||||
|
||||
</style>
|
||||
<section class="content">
|
||||
<div class="layui-fluid" style="margin-bottom: 100px">
|
||||
<div class="layui-card" >
|
||||
<div class="layui-card-header">
|
||||
<span class="header-font">运营数据</span>
|
||||
<span class="header-time">更新时间:{$res.time}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-sm3">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">
|
||||
成交订单(笔)
|
||||
<span class="tips">今日</span>
|
||||
</div>
|
||||
<div class="layui-card-body layuiadmin-card-list">
|
||||
<p class="layuiadmin-big-font">{$res.order_num_today}</p>
|
||||
<p>昨日:<span class="text-style">{$res.order_num_yesterday}</span>
|
||||
<span class="text-style" {if condition="$res.order_num_change lt 0" } style="color: #009688" {elseif condition="$res.order_num_change egt 0" } style="color: #FA2828" {/if}>{$res.order_num_change}</span></p>
|
||||
|
||||
{if $welcome_info}
|
||||
<div class="row">
|
||||
<div class="pad margin no-print">
|
||||
<div class="callout callout-info">
|
||||
<h4><i class="fa fa-info"></i> 你好,{$user.nickname|default='管理员'}:</h4>
|
||||
欢迎来到{$admin.name|default='后台管理系统'},左侧为菜单区域,右侧为功能区。
|
||||
<div class="data-all">成交订单总量(笔)<div class="text-style">{$res.order_num_all}</div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="layui-col-sm3 ">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">
|
||||
销售金额(元)
|
||||
<span class="tips">今日</span>
|
||||
</div>
|
||||
<div class="layui-card-body layuiadmin-card-list">
|
||||
<p class="layuiadmin-big-font">{$res.order_amount_today}</p>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
<div class="info-box">
|
||||
<span class="info-box-icon bg-aqua">
|
||||
<i class="fa fa-user"></i>
|
||||
</span>
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">后台用户</span>
|
||||
<span class="info-box-number">{$admin_user_count|default='0'}</span>
|
||||
<p>昨日:<span class="text-style">{$res.order_amount_yesterday}</span>
|
||||
<span class="text-style" {if condition="$res.order_amount_change lt 0" } style="color: #009688" {elseif condition="$res.order_amount_change egt 0" } style="color: #FA2828" {/if}>{$res.order_amount_change}</span></p>
|
||||
<div class="data-all">销售总额(元)<div class="text-style">{$res.order_amount_all}</div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
<div class="info-box">
|
||||
<span class="info-box-icon bg-red">
|
||||
<i class="fa fa-users"></i>
|
||||
</span>
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">后台角色</span>
|
||||
<span class="info-box-number">{$admin_role_count|default='0'}</span>
|
||||
<div class="layui-col-sm3 ">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">
|
||||
新增会员(人)
|
||||
<span class="tips">今日</span>
|
||||
</div>
|
||||
<div class="layui-card-body layuiadmin-card-list">
|
||||
<p class="layuiadmin-big-font">{$res.add_user_today}</p>
|
||||
<p >昨日:<span class="text-style">{$res.add_user_yesterday}</span>
|
||||
<span class="text-style" {if condition="$res.add_user_change lt 0" } style="color: #009688" {elseif condition="$res.add_user_change egt 0" } style="color: #FA2828" {/if}>{$res.add_user_change}</span></p>
|
||||
<div class="data-all">会员总量(人)<div class="text-style">{$res.user_all}</div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
<div class="info-box">
|
||||
<span class="info-box-icon bg-green">
|
||||
<i class="fa fa-list"></i>
|
||||
</span>
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">后台菜单</span>
|
||||
<span class="info-box-number">{$admin_menu_count|default='0'}</span>
|
||||
<!--快捷功能-->
|
||||
<div class="layui-col-sm12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">快捷功能</div>
|
||||
<div class="layui-card-body">
|
||||
<div class="layadmin-shortcut">
|
||||
<ul class="shortcut-list">
|
||||
<li class="shop-item" >
|
||||
<a lay-href="{:url('goods/index')}" data-id="29">
|
||||
<img class="icon" src="__PUBLIC__/static/common/image/workbench/goods.png" alt="">
|
||||
<cite>设备管理</cite>
|
||||
</a>
|
||||
</li>
|
||||
<li class="shop-item">
|
||||
<a lay-href="{:url('user/index')}" data-id="33">
|
||||
<img class="icon" src="__PUBLIC__/static/common/image/workbench/user.png" alt="">
|
||||
<cite>会员管理</cite>
|
||||
</a>
|
||||
</li>
|
||||
<li class="shop-item">
|
||||
<a lay-href="{:url('order/index')}" data-id="37">
|
||||
<img class="icon" src="__PUBLIC__/static/common/image/workbench/order.png" alt="">
|
||||
<cite>用户订单管理</cite>
|
||||
</a>
|
||||
</li>
|
||||
<li class="shop-item">
|
||||
<a lay-href="{:url('account_log/integrallist')}" data-id="39">
|
||||
<img class="icon" src="__PUBLIC__/static/common/image/workbench/coupon.png" alt="">
|
||||
<cite>积分记录</cite>
|
||||
</a>
|
||||
</li>
|
||||
<li class="shop-item">
|
||||
<a lay-href="{:url('withdraw/lists')}" data-id="39">
|
||||
<img class="icon" src="__PUBLIC__/static/common/image/workbench/seckill.png" alt="">
|
||||
<cite>提现记录</cite>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clearfix visible-sm-block"></div>
|
||||
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
<div class="info-box">
|
||||
<span class="info-box-icon bg-yellow">
|
||||
<i class="fa fa-keyboard-o"></i>
|
||||
</span>
|
||||
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">操作日志</span>
|
||||
<span class="info-box-number">{$admin_log_count|default='0'}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<section class="col-lg-7 connectedSortable" id="sortable1">
|
||||
|
||||
<div class="box sortable-widget" id="user_info">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">访问信息</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<table class="table table-bordered table-striped">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>用户系统</th>
|
||||
<td>{$system_info.user_os}</td>
|
||||
<th>用户IP</th>
|
||||
<td>{$system_info.user_ip}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>浏览器</th>
|
||||
<td>{$system_info.user_browser}</td>
|
||||
<th>所在城市</th>
|
||||
<td>{$system_info.user_ip_address}</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box sortable-widget" id="system_info">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">系统信息</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<table class="table table-bordered table-striped">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>服务器系统</th>
|
||||
<td>{$system_info.server_os}</td>
|
||||
<th>服务器IP</th>
|
||||
<td>{$system_info.server_ip}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>PHP版本</th>
|
||||
<td>{$system_info.php_version}</td>
|
||||
<th>运行内存限制</th>
|
||||
<td>{$system_info.memory_limit}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>最大文件上传限制</th>
|
||||
<td>{$system_info.upload_max_filesize}</td>
|
||||
<th>单次上传数量限制</th>
|
||||
<td>{$system_info.max_file_uploads}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>最大POST限制</th>
|
||||
<td>{$system_info.post_max_size}</td>
|
||||
<th>项目磁盘剩余容量</th>
|
||||
<td>{$system_info.disk_free}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>ThinkPHP版本</th>
|
||||
<td>{$system_info.think_version}</td>
|
||||
<th>后台系统版本</th>
|
||||
<td>{$system_info.admin_version}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>MySql版本</th>
|
||||
<td>{$system_info.db_version}</td>
|
||||
<th>PHP当前运行模式</th>
|
||||
<td>{$system_info.php_sapi_name}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>PHP当前时区</th>
|
||||
<td>{$system_info.timezone}</td>
|
||||
<th>PHP当前时间</th>
|
||||
<td>{$system_info.date_time}</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
<section class="col-lg-5 connectedSortable" id="composer_info">
|
||||
<div class="box sortable-widget" id="widget2">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">依赖关系</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<table class="table table-bordered table-striped">
|
||||
<tbody>
|
||||
{foreach name='system_info.require_list' id='item'}
|
||||
<tr>
|
||||
<th>{$key}</th>
|
||||
<td>{$item}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{foreach name='system_info.require_dev_list' id='item'}
|
||||
<tr>
|
||||
<th>{$key}</th>
|
||||
<td>{$item}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<script>
|
||||
|
||||
var passwordDanger = {$password_danger};
|
||||
var sortableChanged = false;
|
||||
|
||||
var sortableIds = [];
|
||||
|
||||
$(function () {
|
||||
|
||||
$('.connectedSortable').sortable({
|
||||
placeholder: 'sort-highlight',
|
||||
connectWith: '.connectedSortable',
|
||||
handle: '.box-header',
|
||||
forcePlaceholderSize: true,
|
||||
zIndex: 999999,
|
||||
update: function (event, ui) {
|
||||
sortableChanged = true;
|
||||
let ids1 = $('#sortable1').sortable('toArray');
|
||||
let ids2 = $('#sortable2').sortable('toArray');
|
||||
$.each(ids2, function (index, item) {
|
||||
ids1.push(item);
|
||||
});
|
||||
|
||||
sortableIds = ids1;
|
||||
console.log(sortableIds);
|
||||
|
||||
/* $.ajax({
|
||||
type: "post",
|
||||
url: "",
|
||||
data: {image_ids},
|
||||
dataType: "json",
|
||||
success: function(result) {
|
||||
window.location.reload(); //后台获取到数据刷新页面
|
||||
}
|
||||
});*/
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
$('.connectedSortable .box-header, .connectedSortable .nav-tabs-custom').css('cursor', 'move');
|
||||
|
||||
//密码修改检查
|
||||
if(parseInt(passwordDanger)===1){
|
||||
layer.confirm('系统检测到超级管理员默认密码未修改,是否马上去修改?',{title:'风险提示',closeBtn:1,icon:7},function(){
|
||||
$.pjax({
|
||||
url: '/admin/admin_user/profile.html#privacy',
|
||||
container: '#pjax-container'
|
||||
});
|
||||
layer.closeAll();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
{if !$admin.pjax}
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="renderer" content="webkit">
|
||||
{/if}
|
||||
{block name='title'}
|
||||
<title>{$admin.title|default='Admin'} | {$admin.name|default='Admin'}</title>
|
||||
{/block}
|
||||
{if !$admin.pjax}
|
||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
||||
{include file='public/head_css' /}
|
||||
{include file='public/head_js' /}
|
||||
</head>
|
||||
<body class="hold-transition skin-blue sidebar-mini">
|
||||
{/if}
|
||||
<!-- 内容 -->
|
||||
<div id="pjax-container">
|
||||
{block name='content'}{/block}
|
||||
</div>
|
||||
{if !$admin.pjax}
|
||||
{/if}
|
||||
|
||||
{if !$admin.pjax}
|
||||
</body>
|
||||
</html>
|
||||
{/if}
|
||||
|
|
@ -1,349 +0,0 @@
|
|||
{extend name='public/base' /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-primary">
|
||||
<!-- 表单头部 -->
|
||||
<div class="box-header with-border">
|
||||
<div class="btn-group">
|
||||
<a class="btn flat btn-sm btn-default BackButton">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
返回
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 表单 -->
|
||||
<form id="dataForm" class="form-horizontal dataForm" action="" method="post" enctype="multipart/form-data">
|
||||
<!-- 表单字段区域 -->
|
||||
<div class="box-body">
|
||||
<div class="form-group">
|
||||
<label for="order_no" class="col-sm-2 control-label">订单编号</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="order_no" name="order_no" value="{$data.order_no|default=''}" placeholder="请输入订单编号" type="text" class="form-control field-text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="user_id" class="col-sm-2 control-label">下单用户</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<select name="user_id" id="user_id" class="form-control field-select" data-placeholder="请选择下单用户">
|
||||
<option value=""></option>
|
||||
{foreach name='user_list' id='item'}
|
||||
<option value="{$item.id}" {if isset($data) && $data.user_id==$item.id}selected{/if}>
|
||||
{$item.nickname}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#user_id').select2();
|
||||
</script>
|
||||
<div class="form-group">
|
||||
<label for="order_price" class="col-sm-2 control-label">订单金额</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<div class="input-group">
|
||||
<input id="order_price" name="order_price" value="{$data.order_price|default='0.00'}" placeholder="请输入订单金额" type="number" class="form-control field-number">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#order_price')
|
||||
.bootstrapNumber({
|
||||
upClass: 'success',
|
||||
downClass: 'primary',
|
||||
center: true
|
||||
});
|
||||
</script>
|
||||
<div class="form-group">
|
||||
<label for="pay_price" class="col-sm-2 control-label">支付金额</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<div class="input-group">
|
||||
<input id="pay_price" name="pay_price" value="{$data.pay_price|default='0.00'}" placeholder="请输入支付金额" type="number" class="form-control field-number">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#pay_price')
|
||||
.bootstrapNumber({
|
||||
upClass: 'success',
|
||||
downClass: 'primary',
|
||||
center: true
|
||||
});
|
||||
</script>
|
||||
<div class="form-group">
|
||||
<label for="goods_price" class="col-sm-2 control-label">商品总额</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<div class="input-group">
|
||||
<input id="goods_price" name="goods_price" value="{$data.goods_price|default='0.00'}" placeholder="请输入商品总额" type="number" class="form-control field-number">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#goods_price')
|
||||
.bootstrapNumber({
|
||||
upClass: 'success',
|
||||
downClass: 'primary',
|
||||
center: true
|
||||
});
|
||||
</script>
|
||||
<div class="form-group">
|
||||
<label for="express_price" class="col-sm-2 control-label">运费</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<div class="input-group">
|
||||
<input id="express_price" name="express_price" value="{$data.express_price|default='0.00'}" placeholder="请输入运费" type="number" class="form-control field-number">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#express_price')
|
||||
.bootstrapNumber({
|
||||
upClass: 'success',
|
||||
downClass: 'primary',
|
||||
center: true
|
||||
});
|
||||
</script>
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-sm-2 control-label">姓名</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="name" name="name" value="{$data.name|default=''}" placeholder="请输入姓名" type="text" class="form-control field-text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="mobile" class="col-sm-2 control-label">手机号</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="mobile" name="mobile" value="{$data.mobile|default=''}" placeholder="请输入手机号" type="tel" maxlength="11" class="form-control field-mobile">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="address" class="col-sm-2 control-label">收货地址</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="address" name="address" value="{$data.address|default=''}" placeholder="请输入收货地址" type="text" class="form-control field-text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="express_id" class="col-sm-2 control-label">快递公司</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<select name="express_id" id="express_id" class="form-control field-select" data-placeholder="请选择快递公司">
|
||||
<option value=""></option>
|
||||
{foreach name='express_list' id='item'}
|
||||
<option value="{$item.id}" {if isset($data) && $data.express_id==$item.id}selected{/if}>
|
||||
{$item.name}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#express_id').select2();
|
||||
</script>
|
||||
<div class="form-group">
|
||||
<label for="express_no" class="col-sm-2 control-label">快递单号</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="express_no" name="express_no" value="{$data.express_no|default='0'}" placeholder="请输入快递单号" type="text" class="form-control field-text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="pay_channel" class="col-sm-2 control-label">支付渠道</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="pay_channel" name="pay_channel" value="{$data.pay_channel|default='1'}" placeholder="请输入支付渠道" type="text" class="form-control field-text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="pay_status" class="col-sm-2 control-label">支付状态</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="pay_status" name="pay_status" value="{$data.pay_status|default='0'}" placeholder="请输入支付状态" type="text" class="form-control field-text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="pay_time" class="col-sm-2 control-label">付款时间</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="pay_time" name="pay_time" value="{$data.pay_time|default='0'}" placeholder="请选择付款时间" type="text" class="form-control filed-datetime">
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
laydate.render({
|
||||
elem: '#pay_time',
|
||||
type: 'datetime',
|
||||
value: '{$data.pay_time|default="1900-01-01 00:00:00"}'
|
||||
});
|
||||
</script>
|
||||
<div class="form-group">
|
||||
<label for="deliver_status" class="col-sm-2 control-label">发货状态</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="deliver_status" name="deliver_status" value="{$data.deliver_status|default='0'}" placeholder="请输入发货状态" type="text" class="form-control field-text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="deliver_time" class="col-sm-2 control-label">发货时间</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="deliver_time" name="deliver_time" value="{$data.deliver_time|default='0'}" placeholder="请选择发货时间" type="text" class="form-control filed-datetime">
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
laydate.render({
|
||||
elem: '#deliver_time',
|
||||
type: 'datetime',
|
||||
value: '{$data.deliver_time|default="1900-01-01 00:00:00"}'
|
||||
});
|
||||
</script>
|
||||
<div class="form-group">
|
||||
<label for="receive_time" class="col-sm-2 control-label">收货时间</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="receive_time" name="receive_time" value="{$data.receive_time|default='0'}" placeholder="请选择收货时间" type="text" class="form-control filed-datetime">
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
laydate.render({
|
||||
elem: '#receive_time',
|
||||
type: 'datetime',
|
||||
value: '{$data.receive_time|default="1900-01-01 00:00:00"}'
|
||||
});
|
||||
</script>
|
||||
|
||||
</div>
|
||||
<!-- 表单底部 -->
|
||||
<div class="box-footer">
|
||||
{:token()}
|
||||
<div class="col-sm-2">
|
||||
</div>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
{if !isset($data)}
|
||||
<div class="btn-group pull-right">
|
||||
<label class="createContinue">
|
||||
<input type="checkbox" value="1" id="_create" name="_create"
|
||||
title="继续添加数据">继续添加</label>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="btn-group">
|
||||
<button type="submit" class="btn flat btn-info dataFormSubmit">
|
||||
保存
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button type="reset" class="btn flat btn-default dataFormReset">
|
||||
重置
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<script>
|
||||
/** 表单验证 **/
|
||||
$('#dataForm').validate({
|
||||
rules: {
|
||||
'order_no': {
|
||||
required: true,
|
||||
},
|
||||
'user_id': {
|
||||
required: true,
|
||||
},
|
||||
'order_price': {
|
||||
required: true,
|
||||
},
|
||||
'pay_price': {
|
||||
required: true,
|
||||
},
|
||||
'goods_price': {
|
||||
required: true,
|
||||
},
|
||||
'express_price': {
|
||||
required: true,
|
||||
},
|
||||
'name': {
|
||||
required: true,
|
||||
},
|
||||
'mobile': {
|
||||
required: true,
|
||||
},
|
||||
'address': {
|
||||
required: true,
|
||||
},
|
||||
'express_id': {
|
||||
required: true,
|
||||
},
|
||||
'express_no': {
|
||||
required: true,
|
||||
},
|
||||
'pay_channel': {
|
||||
required: true,
|
||||
},
|
||||
'pay_status': {
|
||||
required: true,
|
||||
},
|
||||
'pay_time': {
|
||||
required: true,
|
||||
},
|
||||
'deliver_status': {
|
||||
required: true,
|
||||
},
|
||||
'deliver_time': {
|
||||
required: true,
|
||||
},
|
||||
'receive_time': {
|
||||
required: true,
|
||||
},
|
||||
|
||||
},
|
||||
messages: {
|
||||
'order_no': {
|
||||
required: "订单编号不能为空",
|
||||
},
|
||||
'user_id': {
|
||||
required: "下单用户不能为空",
|
||||
},
|
||||
'order_price': {
|
||||
required: "订单金额不能为空",
|
||||
},
|
||||
'pay_price': {
|
||||
required: "支付金额不能为空",
|
||||
},
|
||||
'goods_price': {
|
||||
required: "商品总额不能为空",
|
||||
},
|
||||
'express_price': {
|
||||
required: "运费不能为空",
|
||||
},
|
||||
'name': {
|
||||
required: "姓名不能为空",
|
||||
},
|
||||
'mobile': {
|
||||
required: "手机号不能为空",
|
||||
},
|
||||
'address': {
|
||||
required: "收货地址不能为空",
|
||||
},
|
||||
'express_id': {
|
||||
required: "快递公司不能为空",
|
||||
},
|
||||
'express_no': {
|
||||
required: "快递单号不能为空",
|
||||
},
|
||||
'pay_channel': {
|
||||
required: "支付渠道不能为空",
|
||||
},
|
||||
'pay_status': {
|
||||
required: "支付状态不能为空",
|
||||
},
|
||||
'pay_time': {
|
||||
required: "付款时间不能为空",
|
||||
},
|
||||
'deliver_status': {
|
||||
required: "发货状态不能为空",
|
||||
},
|
||||
'deliver_time': {
|
||||
required: "发货时间不能为空",
|
||||
},
|
||||
'receive_time': {
|
||||
required: "收货时间不能为空",
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
|
|
@ -1,113 +0,0 @@
|
|||
<!--空白页面参考模版-->
|
||||
{extend name="public/base" /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<section class="content">
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
|
||||
<!--数据列表顶部-->
|
||||
<div class="box-header">
|
||||
<div class="btn-group">
|
||||
<a class="btn flat btn-sm btn-default BackButton">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
返回
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body table-responsive">
|
||||
<table class="table table-hover table-bordered dataTable no-padding" width="100%">
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<th colspan="10" class="text-center bg-blue">基本信息</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>订单ID</th>
|
||||
<td>{$data.id}</td>
|
||||
<th>订单号</th>
|
||||
<td>{$data.order_no}</td>
|
||||
<th>订单金额</th>
|
||||
<td>{$data.order_price}</td>
|
||||
<th>下单人</th>
|
||||
<td>{$data.user.nickname|default=''}[{$data.user.mobile|default=''}]</td>
|
||||
<th>下单时间</th>
|
||||
<td>{$data.create_time}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th colspan="10" class="text-center bg-blue">支付信息</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>应付金额</th>
|
||||
<td>{$data.pay_price}</td>
|
||||
<th>支付方式</th>
|
||||
<td>{$data.pay_channel_text}</td>
|
||||
<th>实付金额</th>
|
||||
<td>{$data.pay_price}</td>
|
||||
<th>支付状态</th>
|
||||
<td>{$data.pay_status_text}</td>
|
||||
<th>付款时间</th>
|
||||
<td>{$data.pay_time}</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<th colspan="10" class="text-center bg-blue">商品信息</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="4">名称</th>
|
||||
<th colspan="2">价格</th>
|
||||
<th colspan="2">数量</th>
|
||||
<th colspan="2">小记</th>
|
||||
</tr>
|
||||
|
||||
{foreach name='data.orderGoods' item='item'}
|
||||
<tr>
|
||||
<td colspan="4">{$item.name}</td>
|
||||
<td colspan="2">{$item.price}</td>
|
||||
<td colspan="2">{$item.number}</td>
|
||||
<td colspan="2">{$item.total_price}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
|
||||
<tr>
|
||||
<th colspan="10" class="text-center bg-blue">收货信息</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>发货状态</th>
|
||||
<td>{$data.deliver_status_text}</td>
|
||||
<th>收货人姓名</th>
|
||||
<td>{$data.name}</td>
|
||||
<th>订收货人手机号</th>
|
||||
<td>{$data.mobile}</td>
|
||||
<th>收货地址</th>
|
||||
<td>{$data.full_address}</td>
|
||||
<th>快递单号</th>
|
||||
<td>{$data.express_no}[{$data.express.name|default=''}]</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据列表底部 -->
|
||||
<div class="box-footer">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
{/block}
|
||||
|
|
@ -1,90 +1,165 @@
|
|||
{extend name="public/base" /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<style type="text/css">
|
||||
.layui-table-cell {
|
||||
height: auto;
|
||||
white-space: normal;
|
||||
}
|
||||
.layui-card-header.layuiadmin-card-header-auto {
|
||||
padding-top: 15px;
|
||||
padding-bottom: 15px;
|
||||
height: auto;
|
||||
}
|
||||
.layui-form-label{ width:100px; }
|
||||
</style>
|
||||
<!--数据列表页面-->
|
||||
<section class="content">
|
||||
|
||||
<!--顶部搜索筛选-->
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
<div class="box-body">
|
||||
<form class="form-inline searchForm" id="searchForm" action="{:url('index')}" method="GET">
|
||||
|
||||
<div class="form-group">
|
||||
<input value="{$_keywords ? $_keywords : '' ;}"
|
||||
name="_keywords" id="_keywords" class="form-control input-sm" placeholder="订单号/手机号">
|
||||
<div class="layui-form layui-card-header layuiadmin-card-header-auto">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-row">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">订单搜索:</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="search_key">
|
||||
<option value="order_sn" {if isset($search_key) && $search_key=='order_sn'}selected{/if}>订单编号</option>
|
||||
<option value="nickname" {if isset($search_key) && $search_key=='nickname'}selected{/if}>会员昵称</option>
|
||||
<option value="user_mobile" {if isset($search_key) && $search_key=='user_mobile'}selected{/if}>会员手机号码</option>
|
||||
<option value="user_sn" {if isset($search_key) && $search_key=='user_sn'}selected{/if}>会员编号</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button class="btn btn-sm btn-primary" type="submit"><i class="fa fa-search"></i> 查询
|
||||
</button>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<input type="text" name="keyword" id="keyword" value="{$keyword?$keyword:'';}" placeholder="请输入搜索内容"
|
||||
autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">商品名称:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="goods_name" id="goods_name" value="{$goods_name?$goods_name:'';}" placeholder="请输入商品名称"
|
||||
autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-row">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">订单类型:</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="order_type" id="order_type">
|
||||
<option value="">全部</option>
|
||||
<option value="1" {if isset($order_type) && $order_type=='1'}selected{/if}>正式订单</option>
|
||||
<option value="2" {if isset($order_type) && $order_type=='2'}selected{/if}>体验订单</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">下单时间:</label>
|
||||
<div class="layui-input-inline">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="start_time" class="layui-input" id="start_time"
|
||||
placeholder="" autocomplete="off" value="{$start_time?$start_time:'';}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-input-inline" style="margin-right: 5px;width: 20px;">
|
||||
<label class="layui-form-mid">至</label>
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="end_time" class="layui-input" id="end_time"
|
||||
placeholder="" autocomplete="off" value="{$end_time?$end_time:'';}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<button class="btn btn-success btn-sm" type="submit" >查询</button>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button onclick="clearSearchForm()" class="btn btn-sm btn-default" type="button"><i
|
||||
class="fa fa-eraser"></i> 清空查询
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
|
||||
<!--数据列表顶部-->
|
||||
<div class="box-header">
|
||||
<div>
|
||||
|
||||
<a class="btn btn-success btn-sm ReloadButton" data-toggle="tooltip" title="刷新">
|
||||
<i class="fa fa-refresh"></i> 刷新
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body table-responsive">
|
||||
<table class="table table-hover table-bordered datatable" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th>ID</th>
|
||||
<th>订单编号</th>
|
||||
<th>下单用户</th>
|
||||
<th>订单金额</th>
|
||||
<th>收货人姓名</th>
|
||||
<th>收货手机号</th>
|
||||
<th>收货地址</th>
|
||||
<th>支付渠道</th>
|
||||
<th>支付状态</th>
|
||||
<th>发货状态</th>
|
||||
<th>下单时间</th>
|
||||
|
||||
<th>操作</th>
|
||||
<th>
|
||||
<div style="width:380px;text-align:center;">用户信息</div>
|
||||
</th>
|
||||
<th>
|
||||
<div class="layui-table-cell" style="width:380px;text-align:center;">订单信息</div>
|
||||
</th>
|
||||
<th>
|
||||
<div class="layui-table-cell" style="width:380px;text-align:center;">商品信息</div>
|
||||
</th>
|
||||
<th><div class="layui-table-cell" style="width:100px;text-align:center;">购买数量</div></th>
|
||||
<th><div class="layui-table-cell" style="width:200px;text-align:center;">结束时间</div></th>
|
||||
<th><div class="layui-table-cell" style="width:100px;text-align:center;">产生收益</div></th>
|
||||
<th><div class="layui-table-cell" style="width:200px;text-align:center;">创建时间</div></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="data" item="item"}
|
||||
<tr>
|
||||
<td>{$item.id}</td>
|
||||
<td>{$item.order_no}</td>
|
||||
<td>{$item.user.nickname|default=''}</td>
|
||||
<td>{$item.order_price}</td>
|
||||
<td>{$item.name}</td>
|
||||
<td>{$item.mobile}</td>
|
||||
<td>{$item.address}</td>
|
||||
<td>{$item.pay_channel_text}</td>
|
||||
<td>{$item.pay_status_text}</td>
|
||||
<td>{$item.deliver_status_text}</td>
|
||||
<td>{$item.create_time}</td>
|
||||
|
||||
<td class="td-do">
|
||||
<a href="{:url('detail',['id'=>$item.id])}"
|
||||
class="btn btn-primary btn-xs" title="订单详情" data-toggle="tooltip">
|
||||
<i class="fa fa-info-circle"></i>
|
||||
</a>
|
||||
<td class="layui-table-col-special">
|
||||
<div class="layui-table-cell laytable-cell-1-0-2">
|
||||
<img src="{$item.avatar}" style="height:80px;width: 80px;margin-right: 10px;" class="image-show">
|
||||
<div class="layui-input-inline" style="text-align:left;width: 240px;">
|
||||
<p>用户编号:{$item.sn}</p>
|
||||
<p>用户昵称:{$item.nickname}</p>
|
||||
<p>用户手机:{$item.mobile}</p>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="layui-table-col-special">
|
||||
<div class="layui-table-cell laytable-cell-1-0-2">
|
||||
<div class="layui-input-inline" style="text-align:left;width: 240px;">
|
||||
<p>订单编号:{$item.order_no}</p>
|
||||
<p>订单类型:{$item.order_type_text}</p>
|
||||
<p>订单金额:{$item.order_price}</p>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="layui-table-col-special">
|
||||
<div class="layui-table-cell laytable-cell-1-0-2">
|
||||
<div class="layui-input-inline" style="text-align:left;width: 240px;">
|
||||
<p>设备名称:{$item.goods_name}</p>
|
||||
<p>设备规格:{$item.attr}M</p>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="layui-table-cell" style="width:100px;text-align:center;">{$item.number}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="layui-table-cell" style="width:200px;text-align:center;">{$item.end_time}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="layui-table-cell" style="width:100px;text-align:center;">{$item.profit}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="layui-table-cell" style="width:200px;text-align:center;">{$item.create_time}</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
|
|
@ -115,6 +190,24 @@
|
|||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<script>
|
||||
layui.use('form', function(){
|
||||
var form = layui.form;
|
||||
form.render('select');
|
||||
});
|
||||
//日期时间范围
|
||||
laydate.render({
|
||||
elem: '#start_time'
|
||||
,type: 'datetime'
|
||||
,trigger: 'click'
|
||||
});
|
||||
|
||||
//日期时间范围
|
||||
laydate.render({
|
||||
elem: '#end_time'
|
||||
,type: 'datetime'
|
||||
,trigger: 'click'
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@
|
|||
{js href="__ADMIN_PLUGINS__/viewer/jquery-viewer.min.js" /}
|
||||
{js href="__ADMIN_JS__/tag/jquery.tag-editor.js" /}
|
||||
{css href="__ADMIN_JS__/tag/jquery.tag-editor.css" /}
|
||||
<script src="https://www.layuicdn.com/layui/layui.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="https://www.layuicdn.com/layui/css/layui.css">
|
||||
<!--勿必把地图api key更换成自己的-->
|
||||
<script type="text/javascript" src='//webapi.amap.com/maps?v=1.4.15&key=cccf8ea926e153be0a013d55edd47c11&plugin=AMap.ToolBar'></script>
|
||||
<!-- UI组件库 1.0 -->
|
||||
|
|
|
|||
|
|
@ -0,0 +1,81 @@
|
|||
{extend name='public/base' /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-primary">
|
||||
<!-- 表单 -->
|
||||
<form id="dataForm" class="form-horizontal dataForm" action="" method="post" enctype="multipart/form-data">
|
||||
<!-- 表单字段区域 -->
|
||||
<div class="box-body" style="height: 500px;">
|
||||
<div class="form-group">
|
||||
<label for="first_ratio" class="col-sm-2 control-label">一级分销比例</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="first_ratio" name="first_ratio" value="{$config.first_ratio|default=''}" placeholder="请输入一级分销比例" type="text" class="form-control field-text">
|
||||
</div>
|
||||
<label for="name" class="control-label">%</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="second_ratio" class="col-sm-2 control-label">二级分销比例</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="second_ratio" name="second_ratio" value="{$config.second_ratio|default=''}" placeholder="请输入二级分销比例" type="text" class="form-control field-text">
|
||||
</div>
|
||||
<label for="name" class="control-label">%</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="number" class="col-sm-2 control-label">升级人数</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="number" name="number" value="{$config.number|default=''}" placeholder="请输入升级人数" type="text" class="form-control field-text">
|
||||
</div>
|
||||
<label for="name" class="control-label">人</label>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 表单底部 -->
|
||||
<div class="box-footer">
|
||||
{:token()}
|
||||
<div class="col-sm-2">
|
||||
</div>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<div class="btn-group">
|
||||
<button type="submit" class="btn flat btn-info dataFormSubmit">
|
||||
保存
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<script>
|
||||
/** 表单验证 **/
|
||||
$('#dataForm').validate({
|
||||
rules: {
|
||||
'type': {
|
||||
required: true,
|
||||
},
|
||||
'name': {
|
||||
required: true,
|
||||
},
|
||||
'value': {
|
||||
required: true,
|
||||
},
|
||||
|
||||
},
|
||||
messages: {
|
||||
'type': {
|
||||
required: "类型不能为空",
|
||||
},
|
||||
'name': {
|
||||
required: "名称不能为空",
|
||||
},
|
||||
'value': {
|
||||
required: "值不能为空",
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
{extend name='public/base' /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-primary">
|
||||
<!-- 表单 -->
|
||||
<form id="dataForm" class="form-horizontal dataForm" action="" method="post" enctype="multipart/form-data">
|
||||
<!-- 表单字段区域 -->
|
||||
<div class="box-body">
|
||||
<div class="form-group">
|
||||
<label for="goods_id" class="col-sm-2 control-label">体验设备</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<select name="goods_id" id="goods_id" class="form-control field-select"
|
||||
data-placeholder="请选择体验设备">
|
||||
<option value=""></option>
|
||||
{foreach name='config.goods_list' id='item'}
|
||||
<option value="{$item.id}" {if isset($config) &&
|
||||
$config.goods_id==$item.id}selected{/if}>
|
||||
{$item.name}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#goods_id').select2();
|
||||
</script>
|
||||
<div class="form-group">
|
||||
<label for="day" class="col-sm-2 control-label">体验天数</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="day" name="day" value="{$config.day|default=''}" placeholder="请输入体验天数" type="number" class="form-control field-number">
|
||||
</div>
|
||||
<label for="name" class="control-label">天</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="is_withdraw" class="col-sm-2 control-label">是否可提现</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input class="input-switch" id="is_withdraw" value="1" {if(!isset($config) ||$config.is_withdraw==1)}checked{/if} type="checkbox" />
|
||||
<input class="switch field-switch" placeholder="是否可提现" name="is_withdraw" value="{$config.is_withdraw|default=''}" hidden />
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#is_withdraw').bootstrapSwitch({
|
||||
onText: "是",
|
||||
offText: "否",
|
||||
onColor: "success",
|
||||
offColor: "danger",
|
||||
onSwitchChange: function (event, state) {
|
||||
$(event.target).closest('.bootstrap-switch').next().val(state ? '1' : '0').change();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div class="form-group">
|
||||
<label for="is_first" class="col-sm-2 control-label">是否新用户领取</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input class="input-switch" id="is_first" value="1" {if(!isset($config) ||$config.is_first==1)}checked{/if} type="checkbox" />
|
||||
<input class="switch field-switch" placeholder="是否新用户领取" name="is_first" value="{$config.is_first|default=''}" hidden />
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#is_first').bootstrapSwitch({
|
||||
onText: "是",
|
||||
offText: "否",
|
||||
onColor: "success",
|
||||
offColor: "danger",
|
||||
onSwitchChange: function (event, state) {
|
||||
$(event.target).closest('.bootstrap-switch').next().val(state ? '1' : '0').change();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div class="form-group">
|
||||
<label for="is_open" class="col-sm-2 control-label">是否开启</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input class="input-switch" id="is_open" value="1" {if(!isset($config) ||$config.is_open==1)}checked{/if} type="checkbox" />
|
||||
<input class="switch field-switch" placeholder="是否开启" name="is_open" value="{$config.is_open|default=''}" hidden />
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#is_open').bootstrapSwitch({
|
||||
onText: "是",
|
||||
offText: "否",
|
||||
onColor: "success",
|
||||
offColor: "danger",
|
||||
onSwitchChange: function (event, state) {
|
||||
$(event.target).closest('.bootstrap-switch').next().val(state ? '1' : '0').change();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<!-- 表单底部 -->
|
||||
<div class="box-footer">
|
||||
{:token()}
|
||||
<div class="col-sm-2">
|
||||
</div>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<div class="btn-group">
|
||||
<button type="submit" class="btn flat btn-info dataFormSubmit">
|
||||
保存
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<script>
|
||||
/** 表单验证 **/
|
||||
$('#dataForm').validate();
|
||||
</script>
|
||||
{/block}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
{extend name='public/base' /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-primary">
|
||||
<!-- 表单 -->
|
||||
<form id="dataForm" class="form-horizontal dataForm" action="" method="post" enctype="multipart/form-data">
|
||||
<!-- 表单字段区域 -->
|
||||
<div class="box-body" style="height: 550px;">
|
||||
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this">积分规则</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content">
|
||||
<div class="layui-tab-item layui-show">
|
||||
<div class="form-group">
|
||||
<div class="col-sm-10">
|
||||
<script id="integral_rule" name="integral_rule" type="text/plain">{$config.integral_rule|raw|default=''}</script>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
UE.delEditor('integral_rule');
|
||||
var ue = UE.getEditor('integral_rule',{
|
||||
serverUrl :UEServer,
|
||||
});
|
||||
ue.ready(function() {
|
||||
ue.setHeight(250); //设置高度
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
</div>
|
||||
<!-- 表单底部 -->
|
||||
<div class="box-footer">
|
||||
{:token()}
|
||||
<div class="col-sm-2">
|
||||
</div>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<div class="btn-group">
|
||||
<button type="submit" class="btn flat btn-info dataFormSubmit">
|
||||
保存
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<script>
|
||||
/** 表单验证 **/
|
||||
$('#dataForm').validate({
|
||||
rules: {
|
||||
'integral_rule': {
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
'integral_rule': {
|
||||
required: "请输入积分规则",
|
||||
},
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
{extend name='public/base' /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<style>
|
||||
.layui-form-label {
|
||||
color: #6a6f6c;
|
||||
width: 100px;
|
||||
}
|
||||
.layui-input-block {
|
||||
margin-left: 130px;
|
||||
}
|
||||
.tips{
|
||||
color: red;
|
||||
}
|
||||
.layui-laydate-content>.layui-laydate-list {
|
||||
padding-bottom: 0px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.layui-laydate-content>.layui-laydate-list>li{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.merge-box .scrollbox .merge-list {
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
</style>
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-primary">
|
||||
<!-- 表单 -->
|
||||
<form id="dataForm" class="form-horizontal dataForm" action="" method="post" enctype="multipart/form-data">
|
||||
<!-- 表单字段区域 -->
|
||||
<div class="box-body" style="height: 500px;">
|
||||
<div class="form-group">
|
||||
<label for="time" class="col-sm-2 control-label">结算时间</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="time" name="time" value="{$config.time|default=''}" placeholder="请输入类型" type="text" class="form-control field-text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="num" class="col-sm-2 control-label">实时收益</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="num" name="num" value="{$config.num|default=''}" placeholder="请输入名称" type="text" class="form-control field-text">
|
||||
</div>
|
||||
<label for="name" class="control-label">/M</label>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 表单底部 -->
|
||||
<div class="box-footer">
|
||||
{:token()}
|
||||
<div class="col-sm-2">
|
||||
</div>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<div class="btn-group">
|
||||
<button type="submit" class="btn flat btn-info dataFormSubmit">
|
||||
保存
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<script>
|
||||
/** 表单验证 **/
|
||||
$('#dataForm').validate({
|
||||
rules: {
|
||||
'type': {
|
||||
required: true,
|
||||
},
|
||||
'name': {
|
||||
required: true,
|
||||
},
|
||||
'value': {
|
||||
required: true,
|
||||
},
|
||||
|
||||
},
|
||||
messages: {
|
||||
'type': {
|
||||
required: "类型不能为空",
|
||||
},
|
||||
'name': {
|
||||
required: "名称不能为空",
|
||||
},
|
||||
'value': {
|
||||
required: "值不能为空",
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
laydate.render({
|
||||
elem :'#time',
|
||||
trigger : 'click',
|
||||
type: 'time',
|
||||
format: 'HH',
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
{extend name='public/base' /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-primary">
|
||||
<!-- 表单 -->
|
||||
<form id="dataForm" class="form-horizontal dataForm" action="" method="post" enctype="multipart/form-data">
|
||||
<!-- 表单字段区域 -->
|
||||
<div class="box-body" style="height: 500px;">
|
||||
<div class="form-group">
|
||||
<label for="min_withdraw" class="col-sm-2 control-label">最低提现金额</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="min_withdraw" name="min_withdraw" value="{$config.min_withdraw|default=''}" placeholder="请输入最低提现金额" type="text" class="form-control field-text">
|
||||
<span id="min_withdraw-error" class="help-block">会员提现需满足最低提现金额,才能提交提现申请。</span>
|
||||
</div>
|
||||
<label for="name" class="control-label">元</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="max_withdraw" class="col-sm-2 control-label">最高提现金额</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="max_withdraw" name="max_withdraw" value="{$config.max_withdraw|default=''}" placeholder="请输入最高提现金额" type="text" class="form-control field-text">
|
||||
<span id="min_withdraw-error" class="help-block">会员提现允许的最高提现金额。</span>
|
||||
</div>
|
||||
<label for="name" class="control-label">元</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="poundage" class="col-sm-2 control-label">提现手续费</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="poundage" name="poundage" value="{$config.poundage|default=''}" placeholder="请输入提现手续费" type="text" class="form-control field-text">
|
||||
<span id="min_withdraw-error" class="help-block">会员提现时收取的手续费占比。</span>
|
||||
</div>
|
||||
<label for="name" class="control-label">%</label>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 表单底部 -->
|
||||
<div class="box-footer">
|
||||
{:token()}
|
||||
<div class="col-sm-2">
|
||||
</div>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<div class="btn-group">
|
||||
<button type="submit" class="btn flat btn-info dataFormSubmit">
|
||||
保存
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<script>
|
||||
/** 表单验证 **/
|
||||
$('#dataForm').validate();
|
||||
</script>
|
||||
{/block}
|
||||
|
|
@ -1,6 +1,59 @@
|
|||
{extend name='public/base' /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<style type="text/css">
|
||||
/* 图片展示
|
||||
----------------------------------------------- */
|
||||
ul.albums {
|
||||
display: block;
|
||||
min-height: 1px;
|
||||
height: auto;
|
||||
overflow: hidden;
|
||||
padding: 5px 0;
|
||||
margin: 0 15px;
|
||||
}
|
||||
ul.albums li {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
padding: 5px;
|
||||
border: 1px solid #e5e5e5;
|
||||
margin: 5px 0 0 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
ul.albums li a.btn-close {
|
||||
display: block;
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
top: -8px;
|
||||
right: -10px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
ul.albums li a.btn-fm{width: 100px;
|
||||
display:none;
|
||||
height: 100px;
|
||||
border: 0px;
|
||||
opacity: 0.5;
|
||||
background-color: #000;
|
||||
line-height: 100px;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
position: absolute;}
|
||||
ul.albums li:hover a.btn-fm{ display: block; }
|
||||
ul.albums li a.btn-fm_z{
|
||||
display:none;
|
||||
color: #ccc;
|
||||
border: 0px;
|
||||
background-color: #000;
|
||||
position: absolute;
|
||||
bottom: 5px;
|
||||
left: 5px;
|
||||
opacity: 0.6;
|
||||
width: 40px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
|
@ -27,23 +80,32 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="img" class="col-sm-2 control-label">图片</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="img" name="img" placeholder="请上传图片" type="file"
|
||||
class="form-control field-image" data-initial-preview="{$data.img|default=''}">
|
||||
<label for="img" class="col-sm-2 control-label">头像</label>
|
||||
<ul class="albums" id="albums">
|
||||
<li id="nophoto" ><img src="{if isset($data.img)}{$data.img}{else}/static/admin/images/nophoto_100x100.png{/if}" style="width: 100px;height: 100px;"></li>
|
||||
<input type="hidden" name="img" id="img" value="{$data.img|default=''}">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#img').fileinput({
|
||||
language: 'zh',
|
||||
overwriteInitial: true,
|
||||
browseLabel: '浏览',
|
||||
initialPreviewAsData: true,
|
||||
dropZoneEnabled: false,
|
||||
showUpload: false,
|
||||
showRemove: false,
|
||||
allowedFileTypes: ['image'],
|
||||
maxFileSize: 10240,
|
||||
<script type="text/javascript">
|
||||
layui.use(['upload','laydate','form'], function(){
|
||||
var form = layui.form;
|
||||
var upload = layui.upload;
|
||||
//执行实例
|
||||
upload.render({
|
||||
elem: '#nophoto' //绑定元素
|
||||
,url: "{:url('file/icon')}" //接口url
|
||||
,data:{type:0,width:200,heigh:200}
|
||||
,field:'image'
|
||||
,multiple: true
|
||||
,done: function(res){
|
||||
$(".albums img").attr('src',res.data.avatar_logo);
|
||||
$("#img").val(res.data.avatar_logo);
|
||||
}
|
||||
,error: function(){
|
||||
layer.tips('图片错误', '#btn');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div class="form-group">
|
||||
|
|
|
|||
|
|
@ -1,145 +0,0 @@
|
|||
<!--统计,图表展示页面-->
|
||||
{extend name="public/base" /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
|
||||
{js href="__ADMIN_PLUGINS__/echarts/echarts.simple.min.js" /}
|
||||
|
||||
<section class="content">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">订单统计</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
|
||||
</button>
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-box-tool dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
|
||||
<i class="fa fa-wrench"></i></button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="#">Action</a></li>
|
||||
<li><a href="#">Another action</a></li>
|
||||
<li><a href="#">Something else here</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="#">Separated link</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<p class="text-center">
|
||||
<strong>Sales: 1 Jan, 2014 - 30 Jul, 2014</strong>
|
||||
</p>
|
||||
|
||||
<div class="chart">
|
||||
<!-- Sales Chart Canvas -->
|
||||
<canvas id="salesChart" style="height: 180px; width: 585px;" height="360" width="1170"></canvas>
|
||||
</div>
|
||||
<!-- /.chart-responsive -->
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
<div class="col-md-4">
|
||||
<p class="text-center">
|
||||
<strong>Goal Completion</strong>
|
||||
</p>
|
||||
|
||||
<div class="progress-group">
|
||||
<span class="progress-text">Add Products to Cart</span>
|
||||
<span class="progress-number"><b>160</b>/200</span>
|
||||
|
||||
<div class="progress sm">
|
||||
<div class="progress-bar progress-bar-aqua" style="width: 80%"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.progress-group -->
|
||||
<div class="progress-group">
|
||||
<span class="progress-text">Complete Purchase</span>
|
||||
<span class="progress-number"><b>310</b>/400</span>
|
||||
|
||||
<div class="progress sm">
|
||||
<div class="progress-bar progress-bar-red" style="width: 80%"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.progress-group -->
|
||||
<div class="progress-group">
|
||||
<span class="progress-text">Visit Premium Page</span>
|
||||
<span class="progress-number"><b>480</b>/800</span>
|
||||
|
||||
<div class="progress sm">
|
||||
<div class="progress-bar progress-bar-green" style="width: 80%"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.progress-group -->
|
||||
<div class="progress-group">
|
||||
<span class="progress-text">Send Inquiries</span>
|
||||
<span class="progress-number"><b>250</b>/500</span>
|
||||
|
||||
<div class="progress sm">
|
||||
<div class="progress-bar progress-bar-yellow" style="width: 80%"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.progress-group -->
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
</div>
|
||||
<!-- ./box-body -->
|
||||
<div class="box-footer">
|
||||
<div class="row">
|
||||
<div class="col-sm-3 col-xs-6">
|
||||
<div class="description-block border-right">
|
||||
<span class="description-percentage text-green"><i class="fa fa-caret-up"></i> 17%</span>
|
||||
<h5 class="description-header">$35,210.43</h5>
|
||||
<span class="description-text">TOTAL REVENUE</span>
|
||||
</div>
|
||||
<!-- /.description-block -->
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
<div class="col-sm-3 col-xs-6">
|
||||
<div class="description-block border-right">
|
||||
<span class="description-percentage text-yellow"><i class="fa fa-caret-left"></i> 0%</span>
|
||||
<h5 class="description-header">$10,390.90</h5>
|
||||
<span class="description-text">TOTAL COST</span>
|
||||
</div>
|
||||
<!-- /.description-block -->
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
<div class="col-sm-3 col-xs-6">
|
||||
<div class="description-block border-right">
|
||||
<span class="description-percentage text-green"><i class="fa fa-caret-up"></i> 20%</span>
|
||||
<h5 class="description-header">$24,813.53</h5>
|
||||
<span class="description-text">TOTAL PROFIT</span>
|
||||
</div>
|
||||
<!-- /.description-block -->
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
<div class="col-sm-3 col-xs-6">
|
||||
<div class="description-block">
|
||||
<span class="description-percentage text-red"><i class="fa fa-caret-down"></i> 18%</span>
|
||||
<h5 class="description-header">1200</h5>
|
||||
<span class="description-text">GOAL COMPLETIONS</span>
|
||||
</div>
|
||||
<!-- /.description-block -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
</div>
|
||||
<!-- /.box-footer -->
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
{/block}
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
{extend name='public/base' /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-primary">
|
||||
<!-- 表单头部 -->
|
||||
<div class="box-header with-border">
|
||||
<div class="btn-group">
|
||||
<a class="btn flat btn-sm btn-default BackButton">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
返回
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 表单 -->
|
||||
<form id="dataForm" class="form-horizontal dataForm" action="" method="post" enctype="multipart/form-data">
|
||||
<!-- 表单字段区域 -->
|
||||
<div class="box-body">
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-sm-2 control-label">名称</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="name" name="name" value="{$data.name|default=''}" placeholder="请输入名称" type="text" class="form-control field-text">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- 表单底部 -->
|
||||
<div class="box-footer">
|
||||
{:token()}
|
||||
<div class="col-sm-2">
|
||||
</div>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
{if !isset($data)}
|
||||
<div class="btn-group pull-right">
|
||||
<label class="createContinue">
|
||||
<input type="checkbox" value="1" id="_create" name="_create"
|
||||
title="继续添加数据">继续添加</label>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="btn-group">
|
||||
<button type="submit" class="btn flat btn-info dataFormSubmit">
|
||||
保存
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button type="reset" class="btn flat btn-default dataFormReset">
|
||||
重置
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<script>
|
||||
/** 表单验证 **/
|
||||
$('#dataForm').validate({
|
||||
rules: {
|
||||
'name': {
|
||||
required: true,
|
||||
},
|
||||
|
||||
},
|
||||
messages: {
|
||||
'name': {
|
||||
required: "名称不能为空",
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
|
|
@ -1,122 +0,0 @@
|
|||
{extend name="public/base" /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<!--数据列表页面-->
|
||||
<section class="content">
|
||||
|
||||
<!--顶部搜索筛选-->
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
<div class="box-body">
|
||||
<form class="form-inline searchForm" id="searchForm" action="{:url('index')}" method="GET">
|
||||
|
||||
<div class="form-group">
|
||||
<input value="{$_keywords ? $_keywords : '' ;}"
|
||||
name="_keywords" id="_keywords" class="form-control input-sm" placeholder="名称">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<button class="btn btn-sm btn-primary" type="submit"><i class="fa fa-search"></i> 查询
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<button onclick="clearSearchForm()" class="btn btn-sm btn-default" type="button"><i
|
||||
class="fa fa-eraser"></i> 清空查询
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
|
||||
<!--数据列表顶部-->
|
||||
<div class="box-header">
|
||||
<div>
|
||||
<a title="添加" data-toggle="tooltip" class="btn btn-primary btn-sm " href="{:url('add')}">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-danger btn-sm AjaxButton" data-toggle="tooltip" title="删除选中数据" data-confirm-title="删除确认" data-confirm-content="您确定要删除选中的数据吗?" data-id="checked" data-url="{:url('del')}">
|
||||
<i class="fa fa-trash"></i> 删除
|
||||
</a>
|
||||
|
||||
<a class="btn btn-success btn-sm ReloadButton" data-toggle="tooltip" title="刷新">
|
||||
<i class="fa fa-refresh"></i> 刷新
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body table-responsive">
|
||||
<table class="table table-hover table-bordered datatable" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<input id="dataCheckAll" type="checkbox" onclick="checkAll(this)" class="checkbox" placeholder="全选/取消">
|
||||
</th>
|
||||
<th>ID</th>
|
||||
<th>名称</th>
|
||||
<th>创建时间</th>
|
||||
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="data" item="item"}
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" onclick="checkThis(this)" name="data-checkbox" data-id="{$item.id}" class="checkbox data-list-check" value="{$item.id}" placeholder="选择/取消">
|
||||
</td>
|
||||
<td>{$item.id}</td>
|
||||
<td>{$item.name}</td>
|
||||
<td>{$item.create_time}</td>
|
||||
|
||||
<td class="td-do">
|
||||
<a href="{:url('edit',['id'=>$item.id])}"
|
||||
class="btn btn-primary btn-xs" title="修改" data-toggle="tooltip">
|
||||
<i class="fa fa-pencil"></i>
|
||||
</a>
|
||||
<a class="btn btn-danger btn-xs AjaxButton" data-toggle="tooltip" title="删除" data-id="{$item.id}" data-confirm-title="删除确认" data-confirm-content='您确定要删除ID为 <span class="text-red">{$item.id}</span> 的数据吗' data-url="{:url('del')}">
|
||||
<i class="fa fa-trash"></i>
|
||||
</a>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据列表底部 -->
|
||||
<div class="box-footer">
|
||||
{$page|raw}
|
||||
<label class="control-label pull-right" style="margin-right: 10px; font-weight: 100;">
|
||||
<small>共{$total}条记录</small>
|
||||
<small>每页显示</small>
|
||||
|
||||
<select class="input-sm" onchange="changePerPage(this)">
|
||||
<option value="10" {if $admin.per_page==10}selected{/if}>10</option>
|
||||
<option value="20" {if $admin.per_page==20}selected{/if}>20</option>
|
||||
<option value="30" {if $admin.per_page==30}selected{/if}>30</option>
|
||||
<option value="50" {if $admin.per_page==50}selected{/if}>50</option>
|
||||
<option value="100" {if $admin.per_page==100}selected{/if}>100</option>
|
||||
</select>
|
||||
|
||||
<small>条记录</small>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/block}
|
||||
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
{extend name='public/base' /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-primary">
|
||||
<!-- 表单头部 -->
|
||||
<div class="box-header with-border">
|
||||
<div class="btn-group">
|
||||
<a class="btn flat btn-sm btn-default BackButton">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
返回
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 表单 -->
|
||||
<form id="dataForm" class="form-horizontal dataForm" action="" method="post" enctype="multipart/form-data">
|
||||
<!-- 表单字段区域 -->
|
||||
<div class="box-body">
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-sm-2 control-label"></label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="name" name="name" value="{$data.name|default=''}" placeholder="请输入" type="text" class="form-control field-text">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- 表单底部 -->
|
||||
<div class="box-footer">
|
||||
{:token()}
|
||||
<div class="col-sm-2">
|
||||
</div>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
{if !isset($data)}
|
||||
<div class="btn-group pull-right">
|
||||
<label class="createContinue">
|
||||
<input type="checkbox" value="1" id="_create" name="_create"
|
||||
title="继续添加数据">继续添加</label>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="btn-group">
|
||||
<button type="submit" class="btn flat btn-info dataFormSubmit">
|
||||
保存
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button type="reset" class="btn flat btn-default dataFormReset">
|
||||
重置
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<script>
|
||||
/** 表单验证 **/
|
||||
$('#dataForm').validate({
|
||||
rules: {
|
||||
'name': {
|
||||
required: true,
|
||||
},
|
||||
|
||||
},
|
||||
messages: {
|
||||
'name': {
|
||||
required: "不能为空",
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
|
|
@ -1,139 +0,0 @@
|
|||
{extend name="public/base" /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<!--数据列表页面-->
|
||||
<section class="content">
|
||||
|
||||
<!--顶部搜索筛选-->
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
<div class="box-body">
|
||||
<form class="form-inline searchForm" id="searchForm" action="{:url('index')}" method="GET">
|
||||
|
||||
<div class="form-group">
|
||||
<input value="{$_keywords ? $_keywords : '' ;}"
|
||||
name="_keywords" id="_keywords" class="form-control input-sm" placeholder="">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<button class="btn btn-sm btn-primary" type="submit"><i class="fa fa-search"></i> 查询
|
||||
</button>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button onclick="exportData()" class="btn btn-sm btn-warning exportData" type="button"><i class="fa fa-search"></i> 导出
|
||||
</button>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button onclick="clearSearchForm()" class="btn btn-sm btn-default" type="button"><i
|
||||
class="fa fa-eraser"></i> 清空查询
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
|
||||
<!--数据列表顶部-->
|
||||
<div class="box-header">
|
||||
<div>
|
||||
<a title="添加" data-toggle="tooltip" class="btn btn-primary btn-sm " href="{:url('add')}">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-danger btn-sm AjaxButton" data-toggle="tooltip" title="删除选中数据" data-confirm-title="删除确认" data-confirm-content="您确定要删除选中的数据吗?" data-id="checked" data-url="{:url('del')}">
|
||||
<i class="fa fa-trash"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-success btn-sm AjaxButton" data-toggle="tooltip" title="启用选中数据" data-confirm-title="启用确认" data-confirm-content="您确定要启用选中的数据吗?" data-id="checked" data-url="{:url('enable')}">
|
||||
<i class="fa fa-circle"></i> 启用
|
||||
</a>
|
||||
|
||||
<a class="btn btn-warning btn-sm AjaxButton" data-toggle="tooltip" title="禁用选中数据" data-confirm-title="禁用确认" data-confirm-content="您确定要禁用选中的数据吗?" data-id="checked" data-url="{:url('disable')}">
|
||||
<i class="fa fa-circle"></i> 禁用
|
||||
</a>
|
||||
|
||||
<a class="btn btn-success btn-sm ReloadButton" data-toggle="tooltip" title="刷新">
|
||||
<i class="fa fa-refresh"></i> 刷新
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body table-responsive">
|
||||
<table class="table table-hover table-bordered datatable" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<input id="dataCheckAll" type="checkbox" onclick="checkAll(this)" class="checkbox" placeholder="全选/取消">
|
||||
</th>
|
||||
<th>ID</th>
|
||||
<th></th>
|
||||
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="data" item="item"}
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" onclick="checkThis(this)" name="data-checkbox" data-id="{$item.id}" class="checkbox data-list-check" value="{$item.id}" placeholder="选择/取消">
|
||||
</td>
|
||||
<td>{$item.id}</td>
|
||||
<td>{$item.name}</td>
|
||||
|
||||
<td class="td-do">
|
||||
<a href="{:url('edit',['id'=>$item.id])}"
|
||||
class="btn btn-primary btn-xs" title="修改" data-toggle="tooltip">
|
||||
<i class="fa fa-pencil"></i>
|
||||
</a>
|
||||
<a class="btn btn-danger btn-xs AjaxButton" data-toggle="tooltip" title="删除" data-id="{$item.id}" data-confirm-title="删除确认" data-confirm-content='您确定要删除ID为 <span class="text-red">{$item.id}</span> 的数据吗' data-url="{:url('del')}">
|
||||
<i class="fa fa-trash"></i>
|
||||
</a>
|
||||
{if $item.status==1}
|
||||
<a class="btn btn-warning btn-xs AjaxButton" data-toggle="tooltip" title="禁用" data-id="{$item.id}" data-confirm-title="禁用确认" data-confirm-content='您确定要禁用ID为 <span class="text-red">{$item.id}</span> 的数据吗' data-url="{:url('disable')}">
|
||||
<i class="fa fa-circle"></i>
|
||||
</a>
|
||||
{else/}
|
||||
<a class="btn btn-success btn-xs AjaxButton" data-toggle="tooltip" title="启用" data-id="{$item.id}" data-confirm-title="启用确认" data-confirm-content='您确定要启用ID为 <span class="text-red">{$item.id}</span> 的数据吗' data-url="{:url('enable')}">
|
||||
<i class="fa fa-circle"></i>
|
||||
</a>
|
||||
{/if}
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据列表底部 -->
|
||||
<div class="box-footer">
|
||||
{$page|raw}
|
||||
<label class="control-label pull-right" style="margin-right: 10px; font-weight: 100;">
|
||||
<small>共{$total}条记录</small>
|
||||
<small>每页显示</small>
|
||||
|
||||
<select class="input-sm" onchange="changePerPage(this)">
|
||||
<option value="10" {if $admin.per_page==10}selected{/if}>10</option>
|
||||
<option value="20" {if $admin.per_page==20}selected{/if}>20</option>
|
||||
<option value="30" {if $admin.per_page==30}selected{/if}>30</option>
|
||||
<option value="50" {if $admin.per_page==50}selected{/if}>50</option>
|
||||
<option value="100" {if $admin.per_page==100}selected{/if}>100</option>
|
||||
</select>
|
||||
|
||||
<small>条记录</small>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/block}
|
||||
|
||||
|
|
@ -1,6 +1,59 @@
|
|||
{extend name='public/base' /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<style type="text/css">
|
||||
/* 图片展示
|
||||
----------------------------------------------- */
|
||||
ul.albums {
|
||||
display: block;
|
||||
min-height: 1px;
|
||||
height: auto;
|
||||
overflow: hidden;
|
||||
padding: 5px 0;
|
||||
margin: 0 15px;
|
||||
}
|
||||
ul.albums li {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
padding: 5px;
|
||||
border: 1px solid #e5e5e5;
|
||||
margin: 5px 0 0 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
ul.albums li a.btn-close {
|
||||
display: block;
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
top: -8px;
|
||||
right: -10px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
ul.albums li a.btn-fm{width: 100px;
|
||||
display:none;
|
||||
height: 100px;
|
||||
border: 0px;
|
||||
opacity: 0.5;
|
||||
background-color: #000;
|
||||
line-height: 100px;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
position: absolute;}
|
||||
ul.albums li:hover a.btn-fm{ display: block; }
|
||||
ul.albums li a.btn-fm_z{
|
||||
display:none;
|
||||
color: #ccc;
|
||||
border: 0px;
|
||||
background-color: #000;
|
||||
position: absolute;
|
||||
bottom: 5px;
|
||||
left: 5px;
|
||||
opacity: 0.6;
|
||||
width: 40px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
|
@ -20,43 +73,33 @@
|
|||
<!-- 表单字段区域 -->
|
||||
<div class="box-body">
|
||||
<div class="form-group">
|
||||
<label for="avatar" class="col-sm-2 control-label">头像</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="avatar" name="avatar" placeholder="请上传头像" {if
|
||||
isset($data.avatar)}data-initial-preview="{$data.avatar}" {/if} type="file"
|
||||
class="form-control field-image" >
|
||||
<label for="img" class="col-sm-2 control-label">头像</label>
|
||||
<ul class="albums" id="albums">
|
||||
<li id="nophoto" ><img src="{if isset($data.avatar)}{$data.avatar}{else}/static/admin/images/nophoto_100x100.png{/if}" style="width: 100px;height: 100px;"></li>
|
||||
<input type="hidden" name="avatar" id="avatar" value="{$data.avatar|default=''}">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#avatar').fileinput({
|
||||
language: 'zh',
|
||||
overwriteInitial: true,
|
||||
browseLabel: '浏览',
|
||||
initialPreviewAsData: true,
|
||||
dropZoneEnabled: false,
|
||||
showUpload: false,
|
||||
showRemove: false,
|
||||
allowedFileTypes: ['image'],
|
||||
maxFileSize: 10240,
|
||||
<script type="text/javascript">
|
||||
layui.use(['upload','laydate','form'], function(){
|
||||
var form = layui.form;
|
||||
var upload = layui.upload;
|
||||
//执行实例
|
||||
upload.render({
|
||||
elem: '#nophoto' //绑定元素
|
||||
,url: "{:url('file/icon')}" //接口url
|
||||
,data:{type:1,width:200,heigh:200}
|
||||
,field:'image'
|
||||
,multiple: true
|
||||
,done: function(res){
|
||||
$(".albums img").attr('src',res.data.avatar_logo_thum);
|
||||
$("#avatar").val(res.data.avatar_logo_thum);
|
||||
}
|
||||
,error: function(){
|
||||
layer.tips('图片错误', '#btn');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div class="form-group">
|
||||
<label for="user_level_id" class="col-sm-2 control-label">用户等级</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<select name="user_level_id" id="user_level_id" class="form-control field-select"
|
||||
data-placeholder="请选择用户等级">
|
||||
<option value=""></option>
|
||||
{foreach name='user_level_list' id='item'}
|
||||
<option value="{$item.id}" {if isset($data) &&
|
||||
$data.user_level_id==$item.id}selected{/if}>
|
||||
{$item.name}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#user_level_id').select2();
|
||||
</script>
|
||||
<div class="form-group">
|
||||
<label for="username" class="col-sm-2 control-label">用户名</label>
|
||||
|
|
@ -65,6 +108,21 @@
|
|||
placeholder="请输入用户名" type="text" class="form-control field-text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group layui-form">
|
||||
<label for="user_level_id" class="col-sm-2 control-label">会员等级</label>
|
||||
<div class="col-sm-10 col-md-10">
|
||||
<input type="radio" name="user_level_id" lay-filter="filter" value="1" title="体验会员" {if(!isset($data)
|
||||
||$data.user_level_id==1)}checked{/if}>
|
||||
<input type="radio" name="user_level_id" lay-filter="filter" value="2" title="正式会员" {if(!isset($data)
|
||||
||$data.user_level_id==2)}checked{/if}>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
layui.use(['upload','laydate','form'], function(){
|
||||
var form = layui.form;
|
||||
form.render();
|
||||
});
|
||||
</script>
|
||||
<div class="form-group">
|
||||
<label for="mobile" class="col-sm-2 control-label">手机号</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
|
|
@ -79,14 +137,6 @@
|
|||
placeholder="请输入昵称" type="text" class="form-control field-text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password" class="col-sm-2 control-label">密码</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="password" name="password"
|
||||
value="{$data.password|default='$2y$10$HU5eKkvynPi0iP/eQqSrmuwUMQhDB18QLLNCwtAvc09KKoLuv3I16'}"
|
||||
placeholder="请输入密码" type="password" class="form-control field-password">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="status" class="col-sm-2 control-label">是否启用</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
|
|
@ -143,9 +193,6 @@
|
|||
/** 表单验证 **/
|
||||
$('#dataForm').validate({
|
||||
rules: {
|
||||
'user_level_id': {
|
||||
required: true,
|
||||
},
|
||||
'username': {
|
||||
required: true,
|
||||
},
|
||||
|
|
@ -155,18 +202,12 @@
|
|||
'nickname': {
|
||||
required: true,
|
||||
},
|
||||
'password': {
|
||||
required: true,
|
||||
},
|
||||
'status': {
|
||||
required: true,
|
||||
},
|
||||
|
||||
},
|
||||
messages: {
|
||||
'user_level_id': {
|
||||
required: "用户等级不能为空",
|
||||
},
|
||||
'username': {
|
||||
required: "用户名不能为空",
|
||||
},
|
||||
|
|
@ -176,9 +217,6 @@
|
|||
'nickname': {
|
||||
required: "昵称不能为空",
|
||||
},
|
||||
'password': {
|
||||
required: "密码不能为空",
|
||||
},
|
||||
'status': {
|
||||
required: "是否启用不能为空",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -0,0 +1,141 @@
|
|||
{extend name='public/base' /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-primary">
|
||||
<!-- 表单头部 -->
|
||||
<div class="box-header with-border">
|
||||
<div class="btn-group">
|
||||
<a class="btn flat btn-sm btn-default BackButton">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
返回
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 表单 -->
|
||||
<form id="dataForm" class="form-horizontal dataForm" action="" method="post"
|
||||
enctype="multipart/form-data">
|
||||
<!-- 表单字段区域 -->
|
||||
<div class="box-body">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-10 col-md-12">
|
||||
<table id="dataList" class="table table-hover table-bordered datatable" width="100%">
|
||||
<thead>
|
||||
<tr class="input-type">
|
||||
<th>操作</th>
|
||||
<th>设备产品</th>
|
||||
<th>数量</th>
|
||||
<th>到期时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="dataBody"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 表单底部 -->
|
||||
<div class="box-footer">
|
||||
{:token()}
|
||||
<div class="col-sm-2">
|
||||
</div>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
{if !isset($data)}
|
||||
<div class="btn-group pull-right">
|
||||
<label class="createContinue">
|
||||
<input type="checkbox" value="1" id="_create" name="_create"
|
||||
title="继续添加数据">继续分配</label>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="btn-group">
|
||||
<button type="submit" class="btn flat btn-info dataFormSubmit">
|
||||
保存
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table>
|
||||
<tbody id="data-template" style="display: none">
|
||||
<tr>
|
||||
<td>
|
||||
<a class="btn btn-xs btn-success" onclick="addNewField(this,2)">追加</a>
|
||||
<a class="btn btn-xs btn-danger" onclick="delThisField(this,1)">删除</a>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<label>
|
||||
<select name="goods_idFORM_INDEX[]" style="min-width: 380px;width: 420px;" class="form-control field-select select2" data-placeholder="请选择设备商品">
|
||||
<option value=""></option>
|
||||
{foreach name='goods_list' id='item'}
|
||||
<option value="{$item.id}">
|
||||
{$item.name}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<label>
|
||||
<input class="form-control field-type" value="" name="numberFORM_INDEX[]" placeholder="请输入数量">
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<label>
|
||||
<input class="form-control field-type" id="end_timeINDEX_ID" value="" name="end_timeFORM_INDEX[]" placeholder="请输入到期时间">
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
<script>
|
||||
/** 表单验证 **/
|
||||
$('#dataForm').validate();
|
||||
//表单索引
|
||||
var formIndex =0;
|
||||
addNewField(null, 1);
|
||||
//添加新的字段
|
||||
function addNewField(obj, type) {
|
||||
formIndex++;
|
||||
let template = $("#data-template").html().replace(/FORM_INDEX/g, '[' + formIndex + ']').replace(/INDEX_ID/g, formIndex);
|
||||
if (obj == null) {
|
||||
$("#dataBody").append(template);
|
||||
} else {
|
||||
if (type === 1) {
|
||||
$(obj).parent().parent().before(template);
|
||||
} else {
|
||||
$(obj).parent().parent().after(template);
|
||||
}
|
||||
}
|
||||
laydate.render({
|
||||
elem: '#end_time'+formIndex
|
||||
,type: 'datetime'
|
||||
});
|
||||
//刷新 dataBody DOM后的操作
|
||||
dataBodyRefreshed();
|
||||
}
|
||||
$(function () {
|
||||
dataBodyRefreshed();
|
||||
});
|
||||
|
||||
//删除当前字段
|
||||
function delThisField(obj) {
|
||||
layer.confirm('您确认删除本行吗?', {title: '删除确认', closeBtn: 1, icon: 3}, function () {
|
||||
$(obj).parent().parent().remove();
|
||||
layer.closeAll();
|
||||
});
|
||||
}
|
||||
|
||||
//列表刷新后的操作
|
||||
function dataBodyRefreshed() {
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
$('#dataBody .select2').select2();
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
|
|
@ -1,6 +1,18 @@
|
|||
{extend name="public/base" /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<style type="text/css">
|
||||
.layui-table-cell {
|
||||
height: auto;
|
||||
white-space: normal;
|
||||
}
|
||||
.layui-card-header.layuiadmin-card-header-auto {
|
||||
padding-top: 15px;
|
||||
padding-bottom: 15px;
|
||||
height: auto;
|
||||
}
|
||||
.layui-form-label{ width:100px; }
|
||||
</style>
|
||||
<!--数据列表页面-->
|
||||
<section class="content">
|
||||
|
||||
|
|
@ -10,56 +22,70 @@
|
|||
<div class="box">
|
||||
<div class="box-body">
|
||||
<form class="form-inline searchForm" id="searchForm" action="{:url('index')}" method="GET">
|
||||
|
||||
<div class="form-group">
|
||||
<input value="{$_keywords ? $_keywords : '' ;}"
|
||||
name="_keywords" id="_keywords" class="form-control input-sm"
|
||||
placeholder="用户名/手机号/昵称">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<select name="_order" id="_order" class="form-control input-sm index-order">
|
||||
<option value="">排序字段</option>
|
||||
<option value="id" {if isset($_order) && $_order=='id'}selected{/if}>ID</option>
|
||||
<option value="user_level_id" {if isset($_order) &&
|
||||
$_order=='user_level_id'}selected{/if}>用户等级
|
||||
</option>
|
||||
<option value="mobile" {if isset($_order) && $_order=='mobile'}selected{/if}>手机号
|
||||
</option>
|
||||
<option value="status" {if isset($_order) && $_order=='status'}selected{/if}>是否启用
|
||||
</option>
|
||||
<option value="create_time" {if isset($_order) && $_order=='create_time'}selected{/if}>
|
||||
创建时间
|
||||
</option>
|
||||
<div class="layui-form layui-card-header layuiadmin-card-header-auto">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">会员信息:</label>
|
||||
<div class="layui-input-inline" style="width: 200px;">
|
||||
<select name="keyword_type" id="keyword_type">
|
||||
<option value="sn" {if isset($keyword_type) && $keyword_type=='sn'}selected{/if}>会员编号</option>
|
||||
<option value="nickname" {if isset($keyword_type) && $keyword_type=='nickname'}selected{/if}>会员昵称</option>
|
||||
<option value="mobile" {if isset($keyword_type) && $keyword_type=='mobile'}selected{/if}>会员手机号码</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<select name="_by" id="_by" class="form-control input-sm index-order">
|
||||
<option value="">排序方式</option>
|
||||
<option value="desc" {if isset($_by) && $_by=='desc'}selected{/if}>倒序</option>
|
||||
<option value="asc" {if isset($_by) && $_by=='asc'}selected{/if}>正序</option>
|
||||
<div class="layui-input-inline" style="width: 200px;">
|
||||
<input type="text" id="keyword" name="keyword" value="{$keyword?$keyword:'';}" placeholder="请输入关键词" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">会员等级:</label>
|
||||
<div class="layui-input-inline">
|
||||
<select id="level" name="level" style="height:80px;width: 80px" >
|
||||
<option value="" selected>全部</option>
|
||||
<option value="0" {if isset($level) && $level=='0'}selected{/if}>无等级</option>
|
||||
<option value="1" {if isset($level) && $level=='1'}selected{/if}>体验会员</option>
|
||||
<option value="2" {if isset($level) && $level=='2'}selected{/if}>正式会员</option>
|
||||
</select>
|
||||
</div>
|
||||
<script>
|
||||
$('#_order').select2();
|
||||
$('#_by').select2();
|
||||
</script>
|
||||
|
||||
<div class="form-group">
|
||||
<button class="btn btn-sm btn-primary" type="submit"><i class="fa fa-search"></i> 查询
|
||||
</button>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button onclick="exportData()" class="btn btn-sm btn-warning exportData" type="button"><i
|
||||
class="fa fa-search"></i> 导出
|
||||
</button>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">提现积分:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" class="layui-input" name="integral_start" value="{$integral_start?$integral_start:'';}" autocomplete="off">
|
||||
</div>
|
||||
<div class="layui-input-inline" style="margin-right: 5px;width: 10px;">
|
||||
<label class="layui-form-mid">-</label>
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" class="layui-input" name="integral_end" value="{$integral_end?$integral_end:'';}" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">注册时间:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" class="layui-input" id="start_time" name="start_time" value="{$start_time?$start_time:'';}" autocomplete="off">
|
||||
</div>
|
||||
<div class="layui-input-inline" style="margin-right: 5px;width: 10px;">
|
||||
<label class="layui-form-mid">-</label>
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" class="layui-input" id="end_time" name="end_time" value="{$end_time?$end_time:'';}" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<button class="btn btn-success btn-sm" type="submit" >查询</button>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button onclick="clearSearchForm()" class="btn btn-sm btn-default" type="button"><i
|
||||
class="fa fa-eraser"></i> 清空查询
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -73,14 +99,6 @@
|
|||
<!--数据列表顶部-->
|
||||
<div class="box-header">
|
||||
<div>
|
||||
<a title="添加" data-toggle="tooltip" class="btn btn-primary btn-sm " href="{:url('add')}">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-danger btn-sm AjaxButton" data-toggle="tooltip" title="删除选中数据"
|
||||
data-confirm-title="删除确认" data-confirm-content="您确定要删除选中的数据吗?" data-id="checked"
|
||||
data-url="{:url('del')}">
|
||||
<i class="fa fa-trash"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-success btn-sm AjaxButton" data-toggle="tooltip" title="启用选中数据"
|
||||
data-confirm-title="启用确认" data-confirm-content="您确定要启用选中的数据吗?" data-id="checked"
|
||||
data-url="{:url('enable')}">
|
||||
|
|
@ -93,30 +111,38 @@
|
|||
<i class="fa fa-circle"></i> 禁用
|
||||
</a>
|
||||
|
||||
<a class="btn btn-success btn-sm ReloadButton" data-toggle="tooltip" title="刷新">
|
||||
<i class="fa fa-refresh"></i> 刷新
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body table-responsive">
|
||||
<table class="table table-hover table-bordered datatable" width="100%">
|
||||
<div class="box-body table-responsive" style="position: relative; width:100%;">
|
||||
<table class="layui-table" style="width: auto;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<input id="dataCheckAll" type="checkbox" onclick="checkAll(this)" class="checkbox"
|
||||
placeholder="全选/取消">
|
||||
</th>
|
||||
<th>ID</th>
|
||||
<th>头像</th>
|
||||
<th>用户等级</th>
|
||||
<th>用户名</th>
|
||||
<th>手机号</th>
|
||||
<th>昵称</th>
|
||||
<th>是否启用</th>
|
||||
<th>创建时间</th>
|
||||
|
||||
<th>操作</th>
|
||||
<th>
|
||||
<div style="width:380px;text-align:center;">用户信息</div>
|
||||
</th>
|
||||
<th>
|
||||
<div class="layui-table-cell" style="width:100px;text-align:center;">用户等级</div>
|
||||
</th>
|
||||
<th>
|
||||
<div class="layui-table-cell" style="width:100px;text-align:center;">可提现积分</div>
|
||||
</th>
|
||||
<th>
|
||||
<div class="layui-table-cell" style="width:100px;text-align:center;">设备数量</div>
|
||||
</th>
|
||||
<th>
|
||||
<div style="width:380px;text-align:center;">上级推荐人</div>
|
||||
</th>
|
||||
<th><div class="layui-table-cell" style="width:120px;text-align:center;">推荐下级人数</div></th>
|
||||
<th><div class="layui-table-cell" style="width:200px;text-align:center;">注册时间</div></th>
|
||||
<th>
|
||||
<div class="layui-table-cell" style="width:200px;text-align:center;">操作</div>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
|
@ -127,47 +153,76 @@
|
|||
data-id="{$item.id}" class="checkbox data-list-check" value="{$item.id}"
|
||||
placeholder="选择/取消">
|
||||
</td>
|
||||
<td>{$item.id}</td>
|
||||
<td><img style="max-width: 40px" src="{$item.avatar}"></td>
|
||||
<td>{$item.user_level.name|default=''}</td>
|
||||
<td>{$item.username}</td>
|
||||
<td>{$item.mobile}</td>
|
||||
<td>{$item.nickname}</td>
|
||||
<td>{$item.status_text}</td>
|
||||
<td>{$item.create_time}</td>
|
||||
<td class="layui-table-col-special">
|
||||
<div class="layui-table-cell laytable-cell-1-0-2">
|
||||
<img src="{$item.avatar}" style="height:80px;width: 80px;margin-right: 10px;" class="image-show">
|
||||
<div class="layui-input-inline" style="text-align:left;width: 240px;">
|
||||
<p>用户编号:{$item.sn}</p>
|
||||
<p>用户昵称:{$item.nickname}</p>
|
||||
<p>用户手机:{$item.mobile}</p>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="layui-table-cell" style="width:100px;text-align:center;">{$item.user_level_id_text}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="layui-table-cell" style="width:100px;text-align:center;">{$item.integral}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="layui-table-cell" style="width:100px;text-align:center;">{$item.sb_num}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="layui-table-cell laytable-cell-1-0-2">
|
||||
{if $item.first_leader_info != '系统'}
|
||||
<img src="{$item.first_leader_info.avatar}" style="height:80px;width: 80px;margin-right: 10px;">
|
||||
<div class="layui-input-inline" style="text-align:left;width: 240px;">
|
||||
<p>用户编号:{$item.first_leader_info.sn}</p>
|
||||
<p>用户昵称:{$item.first_leader_info.nickname}</p>
|
||||
<p>用户手机:{$item.first_leader_info.mobile}</p>
|
||||
</div>
|
||||
{else}
|
||||
<div class="layui-table-cell" style="width:380px;text-align:center;">{$item.first_leader_info}</div>
|
||||
|
||||
{/if}
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="layui-table-cell" style="width:120px;text-align:center;">{$item.fans}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="layui-table-cell" style="width:200px;text-align:center;">{$item.create_time}</div>
|
||||
</td>
|
||||
<td class="td-do">
|
||||
<a href="{:url('edit',['id'=>$item.id])}"
|
||||
class="btn btn-primary btn-xs" title="修改" data-toggle="tooltip">
|
||||
<i class="fa fa-pencil"></i>
|
||||
修改
|
||||
</a>
|
||||
<a class="btn btn-danger btn-xs AjaxButton" data-toggle="tooltip" title="删除"
|
||||
data-id="{$item.id}" data-confirm-title="删除确认"
|
||||
data-confirm-content='您确定要删除ID为 <span class="text-red">{$item.id}</span> 的数据吗'
|
||||
data-url="{:url('del')}">
|
||||
<i class="fa fa-trash"></i>
|
||||
<a href="{:url('equipmentadd',['id'=>$item.id])}"
|
||||
class="btn btn-primary btn-xs" title="分配设备" data-toggle="tooltip">
|
||||
分配设备
|
||||
</a>
|
||||
{if $item.status==1}
|
||||
<a class="btn btn-warning btn-xs AjaxButton" data-toggle="tooltip" title="禁用"
|
||||
data-id="{$item.id}" data-confirm-title="禁用确认"
|
||||
data-confirm-content='您确定要禁用ID为 <span class="text-red">{$item.id}</span> 的数据吗'
|
||||
data-url="{:url('disable')}">
|
||||
<i class="fa fa-circle"></i>
|
||||
禁用
|
||||
</a>
|
||||
{else/}
|
||||
<a class="btn btn-success btn-xs AjaxButton" data-toggle="tooltip" title="启用"
|
||||
data-id="{$item.id}" data-confirm-title="启用确认"
|
||||
data-confirm-content='您确定要启用ID为 <span class="text-red">{$item.id}</span> 的数据吗'
|
||||
data-url="{:url('enable')}">
|
||||
<i class="fa fa-circle"></i>
|
||||
启用
|
||||
</a>
|
||||
{/if}
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 数据列表底部 -->
|
||||
|
|
@ -193,6 +248,24 @@
|
|||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<script>
|
||||
layui.use('form', function(){
|
||||
var form = layui.form;
|
||||
form.render('select');
|
||||
});
|
||||
//日期时间范围
|
||||
laydate.render({
|
||||
elem: '#start_time'
|
||||
,type: 'datetime'
|
||||
,trigger: 'click'
|
||||
});
|
||||
|
||||
//日期时间范围
|
||||
laydate.render({
|
||||
elem: '#end_time'
|
||||
,type: 'datetime'
|
||||
,trigger: 'click'
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,138 +0,0 @@
|
|||
{extend name='public/base' /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-primary">
|
||||
<!-- 表单头部 -->
|
||||
<div class="box-header with-border">
|
||||
<div class="btn-group">
|
||||
<a class="btn flat btn-sm btn-default BackButton">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
返回
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 表单 -->
|
||||
<form id="dataForm" class="form-horizontal dataForm" action="" method="post"
|
||||
enctype="multipart/form-data">
|
||||
<!-- 表单字段区域 -->
|
||||
<div class="box-body">
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-sm-2 control-label">名称</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="name" name="name" value="{$data.name|default=''}" placeholder="请输入名称"
|
||||
type="text" class="form-control field-text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="description" class="col-sm-2 control-label">简介</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="description" name="description" value="{$data.description|default=''}"
|
||||
placeholder="请输入简介" type="text" class="form-control field-text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="img" class="col-sm-2 control-label">图片</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input id="img" name="img" placeholder="请上传图片" {if
|
||||
isset($data.img)}data-initial-preview="{$data.img}" {/if} type="file"
|
||||
class="form-control field-image" >
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#img').fileinput({
|
||||
language: 'zh',
|
||||
overwriteInitial: true,
|
||||
browseLabel: '浏览',
|
||||
initialPreviewAsData: true,
|
||||
dropZoneEnabled: false,
|
||||
showUpload: false,
|
||||
showRemove: false,
|
||||
allowedFileTypes: ['image'],
|
||||
maxFileSize: 10240,
|
||||
});
|
||||
</script>
|
||||
<div class="form-group">
|
||||
<label for="status" class="col-sm-2 control-label">是否启用</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<input class="input-switch" id="status" value="1" {if(!isset($data)
|
||||
||$data.status==1)}checked{/if} type="checkbox"/>
|
||||
<input class="switch field-switch" placeholder="是否启用" name="status"
|
||||
value="{$data.status|default='1'}" hidden/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$('#status').bootstrapSwitch({
|
||||
onText: "是",
|
||||
offText: "否",
|
||||
onColor: "success",
|
||||
offColor: "danger",
|
||||
onSwitchChange: function (event, state) {
|
||||
$(event.target).closest('.bootstrap-switch').next().val(state ? '1' : '0').change();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<!-- 表单底部 -->
|
||||
<div class="box-footer">
|
||||
{:token()}
|
||||
<div class="col-sm-2">
|
||||
</div>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
{if !isset($data)}
|
||||
<div class="btn-group pull-right">
|
||||
<label class="createContinue">
|
||||
<input type="checkbox" value="1" id="_create" name="_create"
|
||||
title="继续添加数据">继续添加</label>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="btn-group">
|
||||
<button type="submit" class="btn flat btn-info dataFormSubmit">
|
||||
保存
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button type="reset" class="btn flat btn-default dataFormReset">
|
||||
重置
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<script>
|
||||
/** 表单验证 **/
|
||||
$('#dataForm').validate({
|
||||
rules: {
|
||||
'name': {
|
||||
required: true,
|
||||
},
|
||||
'description': {
|
||||
required: true,
|
||||
},
|
||||
'status': {
|
||||
required: true,
|
||||
},
|
||||
|
||||
},
|
||||
messages: {
|
||||
'name': {
|
||||
required: "名称不能为空",
|
||||
},
|
||||
'description': {
|
||||
required: "简介不能为空",
|
||||
},
|
||||
'status': {
|
||||
required: "是否启用不能为空",
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
|
|
@ -1,165 +0,0 @@
|
|||
{extend name="public/base" /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<!--数据列表页面-->
|
||||
<section class="content">
|
||||
|
||||
<!--顶部搜索筛选-->
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
<div class="box-body">
|
||||
<form class="form-inline searchForm" id="searchForm" action="{:url('index')}" method="GET">
|
||||
|
||||
<div class="form-group">
|
||||
<input value="{$_keywords ? $_keywords : '' ;}"
|
||||
name="_keywords" id="_keywords" class="form-control input-sm" placeholder="名称/简介">
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<button class="btn btn-sm btn-primary" type="submit"><i class="fa fa-search"></i> 查询
|
||||
</button>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button onclick="exportData()" class="btn btn-sm btn-warning exportData" type="button"><i
|
||||
class="fa fa-search"></i> 导出
|
||||
</button>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button onclick="clearSearchForm()" class="btn btn-sm btn-default" type="button"><i
|
||||
class="fa fa-eraser"></i> 清空查询
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
|
||||
<!--数据列表顶部-->
|
||||
<div class="box-header">
|
||||
<div>
|
||||
<a title="添加" data-toggle="tooltip" class="btn btn-primary btn-sm " href="{:url('add')}">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-danger btn-sm AjaxButton" data-toggle="tooltip" title="删除选中数据"
|
||||
data-confirm-title="删除确认" data-confirm-content="您确定要删除选中的数据吗?" data-id="checked"
|
||||
data-url="{:url('del')}">
|
||||
<i class="fa fa-trash"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-success btn-sm AjaxButton" data-toggle="tooltip" title="启用选中数据"
|
||||
data-confirm-title="启用确认" data-confirm-content="您确定要启用选中的数据吗?" data-id="checked"
|
||||
data-url="{:url('enable')}">
|
||||
<i class="fa fa-circle"></i> 启用
|
||||
</a>
|
||||
|
||||
<a class="btn btn-warning btn-sm AjaxButton" data-toggle="tooltip" title="禁用选中数据"
|
||||
data-confirm-title="禁用确认" data-confirm-content="您确定要禁用选中的数据吗?" data-id="checked"
|
||||
data-url="{:url('disable')}">
|
||||
<i class="fa fa-circle"></i> 禁用
|
||||
</a>
|
||||
|
||||
<a class="btn btn-success btn-sm ReloadButton" data-toggle="tooltip" title="刷新">
|
||||
<i class="fa fa-refresh"></i> 刷新
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body table-responsive">
|
||||
<table class="table table-hover table-bordered datatable" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<input id="dataCheckAll" type="checkbox" onclick="checkAll(this)" class="checkbox"
|
||||
placeholder="全选/取消">
|
||||
</th>
|
||||
<th>ID</th>
|
||||
<th>名称</th>
|
||||
<th>简介</th>
|
||||
<th>图片</th>
|
||||
<th>是否启用</th>
|
||||
<th>创建时间</th>
|
||||
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="data" item="item"}
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" onclick="checkThis(this)" name="data-checkbox"
|
||||
data-id="{$item.id}" class="checkbox data-list-check" value="{$item.id}"
|
||||
placeholder="选择/取消">
|
||||
</td>
|
||||
<td>{$item.id}</td>
|
||||
<td>{$item.name}</td>
|
||||
<td>{$item.description}</td>
|
||||
<td><img style="max-width: 40px" src="{$item.img}"></td>
|
||||
<td>{$item.status_text}</td>
|
||||
<td>{$item.create_time}</td>
|
||||
|
||||
<td class="td-do">
|
||||
<a href="{:url('edit',['id'=>$item.id])}"
|
||||
class="btn btn-primary btn-xs" title="修改" data-toggle="tooltip">
|
||||
<i class="fa fa-pencil"></i>
|
||||
</a>
|
||||
<a class="btn btn-danger btn-xs AjaxButton" data-toggle="tooltip" title="删除"
|
||||
data-id="{$item.id}" data-confirm-title="删除确认"
|
||||
data-confirm-content='您确定要删除ID为 <span class="text-red">{$item.id}</span> 的数据吗'
|
||||
data-url="{:url('del')}">
|
||||
<i class="fa fa-trash"></i>
|
||||
</a>
|
||||
{if $item.status==1}
|
||||
<a class="btn btn-warning btn-xs AjaxButton" data-toggle="tooltip" title="禁用"
|
||||
data-id="{$item.id}" data-confirm-title="禁用确认"
|
||||
data-confirm-content='您确定要禁用ID为 <span class="text-red">{$item.id}</span> 的数据吗'
|
||||
data-url="{:url('disable')}">
|
||||
<i class="fa fa-circle"></i>
|
||||
</a>
|
||||
{else/}
|
||||
<a class="btn btn-success btn-xs AjaxButton" data-toggle="tooltip" title="启用"
|
||||
data-id="{$item.id}" data-confirm-title="启用确认"
|
||||
data-confirm-content='您确定要启用ID为 <span class="text-red">{$item.id}</span> 的数据吗'
|
||||
data-url="{:url('enable')}">
|
||||
<i class="fa fa-circle"></i>
|
||||
</a>
|
||||
{/if}
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据列表底部 -->
|
||||
<div class="box-footer">
|
||||
{$page|raw}
|
||||
<label class="control-label pull-right" style="margin-right: 10px; font-weight: 100;">
|
||||
<small>共{$total}条记录</small>
|
||||
<small>每页显示</small>
|
||||
|
||||
<select class="input-sm" onchange="changePerPage(this)">
|
||||
<option value="10" {if $admin.per_page==10}selected{/if}>10</option>
|
||||
<option value="20" {if $admin.per_page==20}selected{/if}>20</option>
|
||||
<option value="30" {if $admin.per_page==30}selected{/if}>30</option>
|
||||
<option value="50" {if $admin.per_page==50}selected{/if}>50</option>
|
||||
<option value="100" {if $admin.per_page==100}selected{/if}>100</option>
|
||||
</select>
|
||||
|
||||
<small>条记录</small>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/block}
|
||||
|
||||
|
|
@ -1,115 +0,0 @@
|
|||
<!--空白页面参考模版-->
|
||||
{extend name="public/base" /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<section class="content">
|
||||
<style>
|
||||
.box-body ol li{
|
||||
margin: 5px 2px;
|
||||
letter-spacing:1px;
|
||||
}
|
||||
</style>
|
||||
<!-- 这里写内容即可 -->
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
<div class="box-body">
|
||||
<p>本Demo的微信相关功能都基于 EasyWeChat 扩展包,该扩展包几乎包含所有微信开发相关功能。有关微信开发的注意事项/坑个人总结了以下几点,希望对大家有所帮助:</p>
|
||||
<ol>
|
||||
<li>
|
||||
配置好微信公众平台/微信支付/企业微信相关配置。例如:app_id,app_secret,token,aes_key,IP白名单,授权域名,扫码通知地址等等。
|
||||
</li>
|
||||
<li>
|
||||
确保配置和自己的环境一致。有可能会犯的错误:配置的是http,实际是https;配置的是xxx.com域名,实际是www.xxx.com域名。
|
||||
</li>
|
||||
<li>
|
||||
确保程序的参数配置和微信公众平台/微信支付/企业微信相关配置一致,例如app_id,app_secret等
|
||||
</li>
|
||||
<li>
|
||||
公众号/企业微信类的确保自己的域名已备案,并且没有被腾讯拉入黑名单;小程序确保域名备案的同时必须为https。
|
||||
</li>
|
||||
<li>
|
||||
验证文件在框架中应该放置在 /public 目录下;关于各种目录的配置,注意微信的规则。
|
||||
</li>
|
||||
<li>
|
||||
EasyWeChat扩展包的结果有时候可能不需要 return ,有时候却需要,同时要结合自己的框架版本来尝试。
|
||||
</li>
|
||||
<li>
|
||||
类似于支付通知,授权登录跳转的url记得关闭登录验证或token验证之类的限制,否则可能会收不到通知/授权登录失败。
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">示例方法如下,具体可直接查看 WeChatController 控制器源代码</h3>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<table class="table table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>功能</th>
|
||||
<th>方法</th>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td>服务端验证</td>
|
||||
<td><code>server</code></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td>接收 & 回复用户消息</td>
|
||||
<td><code>msg</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>获取用户信息</td>
|
||||
<td><code>user</code></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>发送模版消息</td>
|
||||
<td><code>templateMsg</code></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>拉黑用户</td>
|
||||
<td><code>block</code></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>统一下单</td>
|
||||
<td><code>pay</code></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>根据微信订单号退款</td>
|
||||
<td><code>refundByTransactionId</code></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>根据商户订单号退款</td>
|
||||
<td><code>refundByOutTradeNo</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>发送普通红包</td>
|
||||
<td><code>redPacket</code></td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</section>
|
||||
|
||||
{/block}
|
||||
|
|
@ -0,0 +1,252 @@
|
|||
{extend name="public/base" /}
|
||||
{block name='content'}
|
||||
{include file='public/content_header' /}
|
||||
<style type="text/css">
|
||||
.layui-table-cell {
|
||||
height: auto;
|
||||
white-space: normal;
|
||||
}
|
||||
.layui-card-header.layuiadmin-card-header-auto {
|
||||
padding-top: 15px;
|
||||
padding-bottom: 15px;
|
||||
height: auto;
|
||||
}
|
||||
.layui-form-label{ width:100px; }
|
||||
</style>
|
||||
<!--数据列表页面-->
|
||||
<section class="content">
|
||||
|
||||
<!--顶部搜索筛选-->
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
<div class="box-body">
|
||||
<form class="form-inline searchForm" id="searchForm" action="{:url('lists')}" method="GET">
|
||||
<div class="layui-form layui-card-header layuiadmin-card-header-auto">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">会员信息:</label>
|
||||
<div class="layui-input-inline" style="width: 120px;">
|
||||
<select name="search_key" id="search_key">
|
||||
<option value="user_sn" {if isset($search_key) && $search_key=='user_sn'}selected{/if}>会员编号</option>
|
||||
<option value="nickname" {if isset($search_key) && $search_key=='nickname'}selected{/if}>会员昵称</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-input-inline" style="width: 200px;">
|
||||
<input type="text" id="keyword" name="keyword" value="{$keyword?$keyword:'';}" placeholder="会员信息" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">提现单号:</label>
|
||||
<div class="layui-input-inline" style="width: 120px;">
|
||||
<input type="text" id="withdraw_sn" name="withdraw_sn" value="{$withdraw_sn?$withdraw_sn:'';}" placeholder="提现单号" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">提现方式:</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="type" id="type">
|
||||
<option value="">全部</option>
|
||||
{foreach name="type_list" key="item" item="val"}
|
||||
<option value="{$item}" {if isset($type) && $type==$item}selected{/if}>{$val}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">提现状态:</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="status" id="status">
|
||||
<option value="">全部</option>
|
||||
{foreach name="status_list" key="item" item="val"}
|
||||
<option value="{$item}" {if isset($status) && $status==$item}selected{/if}>{$val}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">提现时间:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" class="layui-input time" id="start_time" name="start_time" value="{$start_time?$start_time:'';}" autocomplete="off">
|
||||
</div>
|
||||
<div class="layui-input-inline" style="margin-right: 5px;width: 10px;">
|
||||
<label class="layui-form-mid">-</label>
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" class="layui-input time" id="end_time" name="end_time" value="{$end_time?$end_time:'';}" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<div class="layui-inline">
|
||||
<button class="btn btn-success btn-sm" type="submit" >查询</button>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button onclick="clearSearchForm()" class="btn btn-sm btn-default" type="button"><i
|
||||
class="fa fa-eraser"></i> 清空查询
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
|
||||
<!--数据列表顶部-->
|
||||
<div class="box-header">
|
||||
<div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body table-responsive">
|
||||
<table class="table table-hover table-bordered datatable" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<tr>
|
||||
<th>
|
||||
<div class="layui-table-cell" style="width:100px;text-align:center;">提现单号</div>
|
||||
</th>
|
||||
<th>
|
||||
<div style="width:380px;text-align:center;">用户信息</div>
|
||||
</th>
|
||||
|
||||
<th>
|
||||
<div class="layui-table-cell" style="width:380px;text-align:center;">收款账户信息</div>
|
||||
</th>
|
||||
<th><div class="layui-table-cell" style="width:380px;text-align:center;">提现金额信息</div></th>
|
||||
<th><div class="layui-table-cell" style="width:100px;text-align:center;">提现状态</div></th>
|
||||
<th><div class="layui-table-cell" style="width:100px;text-align:center;">审核备注</div></th>
|
||||
<th><div class="layui-table-cell" style="width:200px;text-align:center;">创建时间</div></th>
|
||||
<th><div class="layui-table-cell" style="width:200px;text-align:center;">操作</div></th>
|
||||
</tr>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="data" item="item"}
|
||||
<tr>
|
||||
<td>
|
||||
<div class="layui-table-cell" style="width:100px;text-align:center;">{$item.sn}</div>
|
||||
</td>
|
||||
<td class="layui-table-col-special">
|
||||
<div class="layui-table-cell laytable-cell-1-0-2">
|
||||
<img src="{$item.avatar}" style="height:80px;width: 80px;margin-right: 10px;" class="image-show">
|
||||
<div class="layui-input-inline" style="text-align:left;width: 240px;">
|
||||
<p>用户编号:{$item.user_sn}</p>
|
||||
<p>用户昵称:{$item.nickname}</p>
|
||||
<p>用户手机:{$item.mobile}</p>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="layui-table-col-special">
|
||||
<div class="layui-table-cell laytable-cell-1-0-2">
|
||||
<div class="layui-input-inline" style="text-align:left;width: 240px;">
|
||||
<p>提现方式:{$item.type_text}</p>
|
||||
<p>提现姓名:{$item.real_name}</p>
|
||||
<p>提现手机:{$item.real_tel}</p>
|
||||
<p>提现账户:{$item.account}</p>
|
||||
{if $item.type eq 3}
|
||||
<p>提现银行:{$item.bank}</p>
|
||||
<p>提现开户:{$item.subbank}</p>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="layui-table-col-special">
|
||||
<div class="layui-table-cell laytable-cell-1-0-2">
|
||||
<div class="layui-input-inline" style="text-align:left;width: 240px;">
|
||||
<p>用户提现金额:{$item.money}</p>
|
||||
<p>手续费:{$item.poundage}</p>
|
||||
<p>用户到账金额:{$item.left_money}</p>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="layui-table-cell" style="width:100px;text-align:center;">{$item.status_text}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="layui-table-cell" style="width:200px;text-align:center;">{$item.description}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="layui-table-cell" style="width:200px;text-align:center;">{$item.create_time}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="layui-table-cell" style="width:200px;text-align:center;">
|
||||
{if $item.status eq 1}
|
||||
<a href="javascript:;" onclick="status_review({$item.id})" class="btn btn-primary btn-xs" title="审核" data-toggle="tooltip">
|
||||
审核
|
||||
</a>
|
||||
{/if}
|
||||
</div>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据列表底部 -->
|
||||
<div class="box-footer">
|
||||
{$page|raw}
|
||||
<label class="control-label pull-right" style="margin-right: 10px; font-weight: 100;">
|
||||
<small>共{$total}条记录</small>
|
||||
<small>每页显示</small>
|
||||
|
||||
<select class="input-sm" onchange="changePerPage(this)">
|
||||
<option value="10" {if $admin.per_page==10}selected{/if}>10</option>
|
||||
<option value="20" {if $admin.per_page==20}selected{/if}>20</option>
|
||||
<option value="30" {if $admin.per_page==30}selected{/if}>30</option>
|
||||
<option value="50" {if $admin.per_page==50}selected{/if}>50</option>
|
||||
<option value="100" {if $admin.per_page==100}selected{/if}>100</option>
|
||||
</select>
|
||||
|
||||
<small>条记录</small>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<script type="text/javascript">
|
||||
layui.use(['form','table'], function(){
|
||||
var form = layui.form;
|
||||
form.render('select');
|
||||
});
|
||||
//日期时间范围
|
||||
laydate.render({
|
||||
elem: '#start_time'
|
||||
,type: 'datetime'
|
||||
,trigger: 'click'
|
||||
});
|
||||
|
||||
//日期时间范围
|
||||
laydate.render({
|
||||
elem: '#end_time'
|
||||
,type: 'datetime'
|
||||
,trigger: 'click'
|
||||
});
|
||||
|
||||
function status_review(id) {
|
||||
layer.open({
|
||||
type: 2
|
||||
, title: '提现审核'
|
||||
, content: '{:url("withdraw/review")}?id=' + id
|
||||
, area: ['60%', '60%']
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
|
||||
|
|
@ -0,0 +1,118 @@
|
|||
{extend name="layout1" /}
|
||||
{block name='content'}
|
||||
<style>
|
||||
.layui-form-label{ width:120px; }
|
||||
.layui-table-cell { height: auto; }
|
||||
.layui-input-block {
|
||||
line-height: 38px;
|
||||
}
|
||||
</style>
|
||||
<section class="content">
|
||||
<div class="layui-form" style="margin-left: 50px;margin-top: 15px;margin-bottom:30px;">
|
||||
<input type="hidden" name="id" id="id" value="{$id}" />
|
||||
<div class="layui-form-item" style="margin-bottom:0;">
|
||||
<label class="layui-form-label">提现审核:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="review_status" class="review_status" value="1" title="审核通过">
|
||||
<input type="radio" name="review_status" class="review_status" value="0" title="审核拒绝" checked>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" style="margin-bottom:0;">
|
||||
<label class="layui-form-label"></label>
|
||||
<div class=" layui-form-mid layui-word-aux" style="white-space: nowrap">审核拒绝后,提现金额会全部退回佣金账户</div>
|
||||
</div>
|
||||
<div class="layui-form-item" style="margin-bottom:0;">
|
||||
<label class="layui-form-label">审核备注:</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="description" id="description" placeholder="请输入内容" class="layui-textarea" style="width:380px;height:120px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" style="margin-bottom:0;">
|
||||
<label class="layui-form-label"></label>
|
||||
<div class="layui-input-block">
|
||||
<button class="layui-btn layui-btn-sm layuiadmin-btn-withdraw layui-btn-normal" onclick="confirm()">确 认</button>
|
||||
<button class="layui-btn layui-btn-sm layuiadmin-btn-withdraw layui-btn-primary" onclick="cancel()">返 回</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
layui.use(['index','table','like'], function(){
|
||||
var $ = layui.$
|
||||
,form = layui.form
|
||||
,table = layui.table
|
||||
,like = layui.like;
|
||||
|
||||
|
||||
|
||||
// 确认
|
||||
form.on('submit(confirm)', function(data){
|
||||
console.log(data.field)
|
||||
if(data.field.review_status == '0') {
|
||||
// 审核拒绝
|
||||
like.ajax({
|
||||
url:'{:url("withdraw/refuse")}',
|
||||
data:{'id':data.field.id, 'description': data.field.description},
|
||||
type:"post",
|
||||
success:function(res)
|
||||
{
|
||||
if(res.code == 1)
|
||||
{
|
||||
layui.layer.msg(res.msg, {offset: '15px', icon: 1, time: 1000}, function(){
|
||||
parent.location.reload();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}else if(data.field.review_status == '1') {
|
||||
// 审核通过
|
||||
like.ajax({
|
||||
url:'{:url("withdraw/confirm")}',
|
||||
data:{'id':data.field.id, 'description': data.field.description},
|
||||
type:"post",
|
||||
success:function(res)
|
||||
{
|
||||
if(res.code == 1)
|
||||
{
|
||||
layui.layer.msg(res.msg, {offset: '15px', icon: 1, time: 1000}, function(){
|
||||
parent.location.reload();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
|
||||
});
|
||||
});
|
||||
function confirm() {
|
||||
var review_status=$("input[name='review_status']:checked").val();
|
||||
var id=$('#id').val();
|
||||
var description=$('#description').val();
|
||||
if(review_status=='0'){
|
||||
$.post('{:url("withdraw/refuse")}', {id: id,description:description}, function (result) {
|
||||
if(result.code == 1)
|
||||
{
|
||||
layui.layer.msg(result.msg, {offset: '15px', icon: 1, time: 1000}, function(){
|
||||
parent.location.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
}else if(review_status == '1') {
|
||||
$.post('{:url("withdraw/confirm")}', {id: id,description:description}, function (result) {
|
||||
if(result.code == 1)
|
||||
{
|
||||
layui.layer.msg(result.msg, {offset: '15px', icon: 1, time: 1000}, function(){
|
||||
parent.location.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
function cancel() {
|
||||
var index = parent.layer.getFrameIndex(window.name);
|
||||
parent.layer.close(index);
|
||||
return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
|
||||
}
|
||||
</script>
|
||||
</section>
|
||||
{/block}
|
||||
|
|
@ -9,6 +9,8 @@
|
|||
// | Author: 流年 <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
use think\facade\Env;
|
||||
use app\common\model\Order;
|
||||
|
||||
// 应用公共文件
|
||||
|
||||
if (!function_exists('get_middle_str')) {
|
||||
|
|
@ -66,3 +68,54 @@ if (!function_exists('thumbnail_img')) {
|
|||
return $img_slt;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('get_order_sn')) {
|
||||
/**
|
||||
* 获取得到新订单编号
|
||||
*/
|
||||
function get_order_sn()
|
||||
{
|
||||
mt_srand((float) microtime() * 1000000);
|
||||
$order_sn = 'O' . date('Ymd') . str_pad(mt_rand(1, 99999), 5, '0', STR_PAD_LEFT);
|
||||
$where = 'order_no="' . $order_sn . '"';
|
||||
//开始编辑区域
|
||||
$_OrderModel = new Order();
|
||||
$count = $_OrderModel->where($where)->count();
|
||||
//结束编辑区域
|
||||
if ($count == 0) {
|
||||
/* 否则就使用这个订单号 */
|
||||
return $order_sn;
|
||||
}
|
||||
return get_order_sn();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Desc: 用时间生成订单编号
|
||||
* @param $table
|
||||
* @param $field
|
||||
* @param string $prefix
|
||||
* @param int $rand_suffix_length
|
||||
* @param array $pool
|
||||
* @return string
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
function createSn($table, $field, $prefix = '', $rand_suffix_length = 4, $pool = [])
|
||||
{
|
||||
$suffix = '';
|
||||
for ($i = 0; $i < $rand_suffix_length; $i++) {
|
||||
if (empty($pool)) {
|
||||
$suffix .= rand(0, 9);
|
||||
} else {
|
||||
$suffix .= $pool[array_rand($pool)];
|
||||
}
|
||||
}
|
||||
$sn = $prefix . date('YmdHis') . $suffix;
|
||||
if (Db::name($table)->where($field, $sn)->find()) {
|
||||
return createSn($table, $field, $prefix, $rand_suffix_length, $pool);
|
||||
}
|
||||
return $sn;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,66 @@
|
|||
<?php
|
||||
/**
|
||||
* 会员账户流水记录表模型
|
||||
*/
|
||||
|
||||
namespace app\common\model;
|
||||
use app\common\model\User;
|
||||
class AccountLog extends Model
|
||||
{
|
||||
public $softDelete = false;
|
||||
protected $name = 'account_log';
|
||||
protected $autoWriteTimestamp = true;
|
||||
|
||||
//可搜索字段
|
||||
protected $searchField = [];
|
||||
|
||||
//withdraw
|
||||
public $SOURCE_TYPE = [
|
||||
'100' =>'推广收益',
|
||||
'110' =>'个人收益',
|
||||
'120' =>'体验收益',
|
||||
'130' =>'提现退回',
|
||||
];
|
||||
|
||||
public function getSourceTypeTextAttr($value, $data)
|
||||
{
|
||||
return $this->SOURCE_TYPE[$data['source_type']];
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:记录会员账户流水,如果变动类型是成长值,且是增加的,则调用更新会员等级方法。该方法应在添加用户账户后调用
|
||||
* @param int $user_id 用户id
|
||||
* @param float $amount 变动数量
|
||||
* @param int $change_type 变动类型:1-增加;2-减少
|
||||
* @param int $source_type 来源类型
|
||||
* @param string $remark 说明
|
||||
* @param string $source_id 来源id
|
||||
* @param string $source_sn 来源单号
|
||||
* @param string $extra 额外字段说明
|
||||
* @return bool
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public static function AccountRecord($user_id,$amount,$change_type,$source_type,$remark ='',$source_id ='',$source_sn='',$extra=''){
|
||||
$user = User::get($user_id);
|
||||
if(empty($user)){
|
||||
return false;
|
||||
}
|
||||
$account_log = new AccountLog();
|
||||
$account_log->log_sn = createSn('account_log','log_sn','',4);
|
||||
$account_log->user_id = $user_id;
|
||||
$account_log->source_type = $source_type;
|
||||
$account_log->source_id = $source_id;
|
||||
$account_log->source_sn = $source_sn;
|
||||
$account_log->change_amount = $amount;
|
||||
$account_log->left_amount = $user->integral;
|
||||
$account_log->remark = $remark;
|
||||
$account_log->extra = $extra;
|
||||
$account_log->change_type = $change_type;
|
||||
$account_log->create_time = time();
|
||||
$account_log->save();
|
||||
return true;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* 文章管理333333模型
|
||||
*/
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
class Article extends Model
|
||||
{
|
||||
use SoftDelete;
|
||||
public $softDelete = true;
|
||||
protected $name = 'article';
|
||||
protected $autoWriteTimestamp = true;
|
||||
|
||||
//可搜索字段
|
||||
protected $searchField = ['name','description',];
|
||||
|
||||
//是否置顶获取器
|
||||
public function getIsTopTextAttr($value, $data)
|
||||
{
|
||||
return self::BOOLEAN_TEXT[$data['is_top']];
|
||||
}//是否热门获取器
|
||||
public function getIsHotTextAttr($value, $data)
|
||||
{
|
||||
return self::BOOLEAN_TEXT[$data['is_hot']];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* 文章分类模型
|
||||
*/
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
class ArticleCategory extends Model
|
||||
{
|
||||
use SoftDelete;
|
||||
public $softDelete = true;
|
||||
protected $name = 'article_category';
|
||||
protected $autoWriteTimestamp = true;
|
||||
|
||||
//可搜索字段
|
||||
protected $searchField = ['name',];
|
||||
|
||||
//关联文章
|
||||
public function article()
|
||||
{
|
||||
return $this->hasMany(Article::class);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* 文章标签模型
|
||||
*/
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use think\model\Pivot;
|
||||
|
||||
class ArticleTag extends Pivot
|
||||
{
|
||||
protected $name = 'article_tag';
|
||||
|
||||
}
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* 品牌模型
|
||||
*/
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
class Brand extends Model
|
||||
{
|
||||
use SoftDelete;
|
||||
public $softDelete = true;
|
||||
protected $name = 'brand';
|
||||
protected $autoWriteTimestamp = true;
|
||||
|
||||
//可搜索字段
|
||||
protected $searchField = ['name',];
|
||||
|
||||
|
||||
//关联商品
|
||||
public function goods()
|
||||
{
|
||||
return $this->hasMany(Goods::class);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* 收货地址模型
|
||||
*/
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use think\model\concern\SoftDelete;
|
||||
use yupoxiong\region\model\Region;
|
||||
|
||||
class DeliverAddress extends Model
|
||||
{
|
||||
use SoftDelete;
|
||||
public $softDelete = true;
|
||||
protected $name = 'deliver_address';
|
||||
protected $autoWriteTimestamp = true;
|
||||
|
||||
//可搜索字段
|
||||
protected $searchField = ['name', 'mobile',];
|
||||
|
||||
//是否默认获取器
|
||||
public function getIsDefaultTextAttr($value, $data)
|
||||
{
|
||||
return self::BOOLEAN_TEXT[$data['is_default']];
|
||||
}
|
||||
|
||||
//关联用户
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
//关联省
|
||||
public function province()
|
||||
{
|
||||
return $this->belongsTo(Region::class, 'province_id');
|
||||
}
|
||||
|
||||
//关联市
|
||||
public function city()
|
||||
{
|
||||
return $this->belongsTo(Region::class, 'city_id');
|
||||
}
|
||||
|
||||
//关联区县
|
||||
public function district()
|
||||
{
|
||||
return $this->belongsTo(Region::class, 'district_id');
|
||||
}
|
||||
|
||||
//关联街道
|
||||
public function street()
|
||||
{
|
||||
return $this->belongsTo(Region::class, 'street_id');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* 快递模型
|
||||
*/
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
class Express extends Model
|
||||
{
|
||||
use SoftDelete;
|
||||
public $softDelete = true;
|
||||
protected $name = 'express';
|
||||
protected $autoWriteTimestamp = true;
|
||||
|
||||
//可搜索字段
|
||||
protected $searchField = ['name',];
|
||||
|
||||
//关联订单
|
||||
public function orders()
|
||||
{
|
||||
return $this->hasMany(Order::class);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -27,12 +27,5 @@ class Goods extends Model
|
|||
public function goodsCategory()
|
||||
{
|
||||
return $this->belongsTo(GoodsCategory::class);
|
||||
}//关联品牌
|
||||
|
||||
public function brand()
|
||||
{
|
||||
return $this->belongsTo(Brand::class);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,25 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* 商品规格设置模型
|
||||
*/
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
class GoodsAttr extends Model
|
||||
{
|
||||
use SoftDelete;
|
||||
public $softDelete = true;
|
||||
protected $name = 'goods_attr';
|
||||
protected $autoWriteTimestamp = true;
|
||||
|
||||
//可搜索字段
|
||||
protected $searchField = ['name',];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* 商品规格设置模型
|
||||
*/
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
class GoodsAttrCategory extends Model
|
||||
{
|
||||
use SoftDelete;
|
||||
public $softDelete = true;
|
||||
protected $name = 'goods_attr_category';
|
||||
protected $autoWriteTimestamp = true;
|
||||
|
||||
//可搜索字段
|
||||
protected $searchField = ['name',];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,25 +1,16 @@
|
|||
<?php
|
||||
/**
|
||||
* 测试模型
|
||||
* 商品信息表模型
|
||||
*/
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
class Test extends Model
|
||||
class MallImage extends Model
|
||||
{
|
||||
use SoftDelete;
|
||||
public $softDelete = true;
|
||||
protected $name = 'test';
|
||||
protected $name = 'mall_image';
|
||||
protected $autoWriteTimestamp = true;
|
||||
|
||||
//可搜索字段
|
||||
protected $searchField = ['name',];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -12,6 +12,10 @@ class Model extends \think\Model
|
|||
{
|
||||
//是否字段,使用场景:用户的是否冻结,文章是否为热门等等。
|
||||
const BOOLEAN_TEXT = [0 => '否', 1 => '是'];
|
||||
//用户等级
|
||||
const LEVL_TEXT = [1 => '体验会员', 2=> '正式会员'];
|
||||
//订单类型
|
||||
const ORDER_TEXT = [1 => '正式订单', 2=> '体验订单'];
|
||||
|
||||
//是否为软删除
|
||||
public $softDelete = true;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* 订单模型
|
||||
*/
|
||||
*/
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use think\model\concern\SoftDelete;
|
||||
use yupoxiong\region\model\Region;
|
||||
|
||||
class Order extends Model
|
||||
{
|
||||
|
|
@ -15,113 +14,26 @@ class Order extends Model
|
|||
protected $name = 'order';
|
||||
protected $autoWriteTimestamp = true;
|
||||
|
||||
const PAY_STATUS = [
|
||||
0 => '未支付',
|
||||
1 => '已支付',
|
||||
];
|
||||
|
||||
const DELIVER_STATUS = [
|
||||
0 => '未发货',
|
||||
1 => '运输中',
|
||||
2 => '已收货',
|
||||
];
|
||||
|
||||
const PAY_CHANNEL_TEXT = [
|
||||
1 => '支付宝',
|
||||
2 => '微信',
|
||||
];
|
||||
|
||||
|
||||
//可搜索字段
|
||||
protected $searchField = ['order_no', 'mobile',];
|
||||
protected $searchField = [];
|
||||
|
||||
//付款时间获取器
|
||||
public function getPayTimeAttr($value)
|
||||
//结束时间获取器
|
||||
public function getEndTimeAttr($value)
|
||||
{
|
||||
return date('Y-m-d H:i:s', $value);
|
||||
return date('Y-m-d H:i:s',$value);
|
||||
}
|
||||
|
||||
//付款时间修改器
|
||||
public function setPayTimeAttr($value)
|
||||
{
|
||||
return strtotime($value);
|
||||
}//发货时间获取器
|
||||
|
||||
public function getDeliverTimeAttr($value)
|
||||
{
|
||||
return date('Y-m-d H:i:s', $value);
|
||||
}
|
||||
|
||||
//发货时间修改器
|
||||
public function setDeliverTimeAttr($value)
|
||||
{
|
||||
return strtotime($value);
|
||||
}//收货时间获取器
|
||||
|
||||
public function getReceiveTimeAttr($value)
|
||||
{
|
||||
return date('Y-m-d H:i:s', $value);
|
||||
}
|
||||
|
||||
//收货时间修改器
|
||||
public function setReceiveTimeAttr($value)
|
||||
//结束时间修改器
|
||||
public function setEndTimeAttr($value)
|
||||
{
|
||||
return strtotime($value);
|
||||
}
|
||||
|
||||
//关联用户
|
||||
public function user()
|
||||
//订单类型
|
||||
public function getOrderTypeTextAttr($value, $data)
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}//关联快递
|
||||
|
||||
public function express()
|
||||
{
|
||||
return $this->belongsTo(Express::class);
|
||||
return self::ORDER_TEXT[$data['order_type']];
|
||||
}
|
||||
|
||||
public function getPayStatusTextAttr($value, $data)
|
||||
{
|
||||
return self::PAY_STATUS[$data['pay_status']];
|
||||
}
|
||||
|
||||
public function getDeliverStatusTextAttr($value, $data)
|
||||
{
|
||||
return self::DELIVER_STATUS[$data['deliver_status']];
|
||||
}
|
||||
|
||||
public function getPayChannelTextAttr($value, $data)
|
||||
{
|
||||
return self::PAY_CHANNEL_TEXT[$data['pay_channel']];
|
||||
}
|
||||
|
||||
public function orderGoods()
|
||||
{
|
||||
return $this->hasMany(OrderGoods::class);
|
||||
}
|
||||
|
||||
//关联省
|
||||
public function province()
|
||||
{
|
||||
return $this->belongsTo(Region::class, 'province_id');
|
||||
}
|
||||
|
||||
//关联市
|
||||
public function city()
|
||||
{
|
||||
return $this->belongsTo(Region::class, 'city_id');
|
||||
}
|
||||
|
||||
//关联区县
|
||||
public function district()
|
||||
{
|
||||
return $this->belongsTo(Region::class, 'district_id');
|
||||
}
|
||||
|
||||
//关联街道
|
||||
public function street()
|
||||
{
|
||||
return $this->belongsTo(Region::class, 'street_id');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,26 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* 订单商品模型
|
||||
*/
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
class OrderGoods extends Model
|
||||
{
|
||||
use SoftDelete;
|
||||
public $softDelete = true;
|
||||
protected $name = 'order_goods';
|
||||
protected $autoWriteTimestamp = true;
|
||||
|
||||
//可搜索字段
|
||||
protected $searchField = [];
|
||||
|
||||
public function goods()
|
||||
{
|
||||
return $this->belongsTo(Goods::class);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
<?php
|
||||
/**
|
||||
* 配置表模型
|
||||
*/
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
class ShopConfig extends Model
|
||||
{
|
||||
protected $name = 'shop_config';
|
||||
protected $autoWriteTimestamp = true;
|
||||
|
||||
//可搜索字段
|
||||
protected $searchField = ['name',];
|
||||
|
||||
/**
|
||||
* Desc: 设置配置值
|
||||
* @param $type
|
||||
* @param $name
|
||||
* @param $value
|
||||
*/
|
||||
public static function set($type, $name, $value)
|
||||
{
|
||||
$original = $value;
|
||||
$update_time = time();
|
||||
if (is_array($value)) {
|
||||
$value = json_encode($value, true);
|
||||
}
|
||||
$data = self::where(['type' => $type, 'name' => $name])
|
||||
->find();
|
||||
if (empty($data)) {
|
||||
self::insert(['type' => $type, 'name' => $name, 'value' => $value]);
|
||||
} else {
|
||||
self::where(['type' => $type, 'name' => $name])
|
||||
->update(['value' => $value, 'update_time' => $update_time]);
|
||||
}
|
||||
return $original;
|
||||
}
|
||||
|
||||
/**
|
||||
* Desc: 获取配置值
|
||||
* @param $type
|
||||
* @param $name
|
||||
* @param string $default_value
|
||||
* @return mixed|string
|
||||
*/
|
||||
public static function get($type, $name = '', $default_value = null)
|
||||
{
|
||||
$value = self::where(['type' => $type, 'name' => $name])->value('value');
|
||||
$json = json_decode($value, true);
|
||||
if (json_last_error() === JSON_ERROR_NONE) {
|
||||
$value = $json;
|
||||
}
|
||||
if ($value) {
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -19,7 +19,6 @@ class Slide extends Model
|
|||
|
||||
public $jumpType = [
|
||||
['id' => 1, 'name' => '商品'],
|
||||
['id' => 2, 'name' => '文章'],
|
||||
['id' => 3, 'name' => '网址'],
|
||||
];
|
||||
|
||||
|
|
@ -44,9 +43,6 @@ class Slide extends Model
|
|||
case 1:
|
||||
$result = Goods::where('id', $data['jump_target'])->value('name');
|
||||
break;
|
||||
case 2:
|
||||
$result = Article::where('id', $data['jump_target'])->value('name');
|
||||
break;
|
||||
case 3:
|
||||
$result = $data['jump_target'];
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1,26 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* 标签模型
|
||||
*/
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
class Tag extends Model
|
||||
{
|
||||
use SoftDelete;
|
||||
public $softDelete = true;
|
||||
protected $name = 'tag';
|
||||
protected $autoWriteTimestamp = true;
|
||||
|
||||
//可搜索字段
|
||||
protected $searchField = ['name',];
|
||||
|
||||
public function article()
|
||||
{
|
||||
return $this->belongsToMany(Article::class, ArticleTag::class);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -23,12 +23,27 @@ class User extends Model
|
|||
return self::BOOLEAN_TEXT[$data['status']];
|
||||
}
|
||||
|
||||
//用户等级
|
||||
public function getUserLevelIdTextAttr($value, $data)
|
||||
{
|
||||
return self::LEVL_TEXT[$data['user_level_id']];
|
||||
}
|
||||
|
||||
//关联用户等级
|
||||
public function userLevel()
|
||||
{
|
||||
return $this->belongsTo(UserLevel::class);
|
||||
}
|
||||
|
||||
public static function getUserInfo($userId)
|
||||
{
|
||||
$user = self::field('id,sn,nickname,avatar,mobile')->findOrEmpty($userId)->toArray();
|
||||
if (empty($user)) {
|
||||
return '系统';
|
||||
}
|
||||
return $user;
|
||||
}
|
||||
|
||||
|
||||
//用户登录
|
||||
public static function login($param)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,70 @@
|
|||
<?php
|
||||
/**
|
||||
* 提现申请记录表模型
|
||||
*/
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
class WithdrawApply extends Model
|
||||
{
|
||||
protected $name = 'withdraw_apply';
|
||||
protected $autoWriteTimestamp = true;
|
||||
|
||||
//可搜索字段
|
||||
protected $searchField = ['description',];
|
||||
|
||||
//withdraw
|
||||
public $WITHDRAW_TYPE = [
|
||||
'1' =>'支付宝',
|
||||
'2' =>'微信',
|
||||
'3' =>'银行卡',
|
||||
];
|
||||
|
||||
public $STATUS_TYPE = [
|
||||
'1' =>'待提现',
|
||||
'2' =>'提现成功',
|
||||
'3' =>'提现失败',
|
||||
];
|
||||
|
||||
public function getTypeTextAttr($value, $data)
|
||||
{
|
||||
return $this->WITHDRAW_TYPE[$data['type']];
|
||||
}
|
||||
//状态:1-待提现2-提现中3-提现成功4-提现失败获取器
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
return $this->STATUS_TYPE[$data['status']];
|
||||
}//支付时间获取器
|
||||
public function getPaymentTimeAttr($value)
|
||||
{
|
||||
return date('Y-m-d H:i:s',$value);
|
||||
}
|
||||
|
||||
//支付时间修改器
|
||||
public function setPaymentTimeAttr($value)
|
||||
{
|
||||
return strtotime($value);
|
||||
}//转账时间获取器
|
||||
public function getTransferTimeAttr($value)
|
||||
{
|
||||
return date('Y-m-d H:i:s',$value);
|
||||
}
|
||||
|
||||
//转账时间修改器
|
||||
public function setTransferTimeAttr($value)
|
||||
{
|
||||
return strtotime($value);
|
||||
}//重新支付时间获取器
|
||||
public function getRepayTimeAttr($value)
|
||||
{
|
||||
return date('Y-m-d H:i:s',$value);
|
||||
}
|
||||
|
||||
//重新支付时间修改器
|
||||
public function setRepayTimeAttr($value)
|
||||
{
|
||||
return strtotime($value);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
/**
|
||||
* 会员账户流水记录表验证器
|
||||
*/
|
||||
|
||||
namespace app\common\validate;
|
||||
|
||||
class AccountLogValidate extends Validate
|
||||
{
|
||||
protected $rule = [
|
||||
'log_sn|流水单号(20位)' => 'require',
|
||||
'user_id|用户id' => 'require',
|
||||
'source_type|来源类型' => 'require',
|
||||
'source_id|来源id' => 'require',
|
||||
'source_sn|来源单号' => 'require',
|
||||
'change_amount|变动总数' => 'require',
|
||||
'left_amount|剩余总数' => 'require',
|
||||
'remark|说明' => 'require',
|
||||
'extra|额外的字段说明' => 'require',
|
||||
'change_type|1-增加;2-减少' => 'require',
|
||||
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'log_sn.require' => '流水单号(20位)不能为空',
|
||||
'user_id.require' => '用户id不能为空',
|
||||
'source_type.require' => '来源类型不能为空',
|
||||
'source_id.require' => '来源id不能为空',
|
||||
'source_sn.require' => '来源单号不能为空',
|
||||
'change_amount.require' => '变动总数不能为空',
|
||||
'left_amount.require' => '剩余总数不能为空',
|
||||
'remark.require' => '说明不能为空',
|
||||
'extra.require' => '额外的字段说明不能为空',
|
||||
'change_type.require' => '1-增加;2-减少不能为空',
|
||||
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['log_sn','user_id','source_type','source_id','source_sn','change_amount','left_amount','remark','extra','change_type',],
|
||||
'edit' => ['log_sn','user_id','source_type','source_id','source_sn','change_amount','left_amount','remark','extra','change_type',],
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -11,20 +11,12 @@ class OrderValidate extends Validate
|
|||
'order_no|订单编号' => 'require',
|
||||
'user_id|下单用户' => 'require',
|
||||
'order_price|订单金额' => 'require',
|
||||
'pay_price|支付金额' => 'require',
|
||||
'goods_price|商品总额' => 'require',
|
||||
'express_price|运费' => 'require',
|
||||
'name|姓名' => 'require',
|
||||
'mobile|手机号' => 'require',
|
||||
'address|收货地址' => 'require',
|
||||
'express_id|快递公司' => 'require',
|
||||
'express_no|快递单号' => 'require',
|
||||
'pay_channel|支付渠道' => 'require',
|
||||
'pay_status|支付状态' => 'require',
|
||||
'pay_time|付款时间' => 'require',
|
||||
'deliver_status|发货状态' => 'require',
|
||||
'deliver_time|发货时间' => 'require',
|
||||
'receive_time|收货时间' => 'require',
|
||||
'end_time|结束时间' => 'require',
|
||||
'goods_id|商品id' => 'require',
|
||||
'goods_name|商品名称' => 'require',
|
||||
'attr|规格' => 'require',
|
||||
'number|数量' => 'require',
|
||||
'profit|产生收益' => 'require',
|
||||
|
||||
];
|
||||
|
||||
|
|
@ -32,28 +24,21 @@ class OrderValidate extends Validate
|
|||
'order_no.require' => '订单编号不能为空',
|
||||
'user_id.require' => '下单用户不能为空',
|
||||
'order_price.require' => '订单金额不能为空',
|
||||
'pay_price.require' => '支付金额不能为空',
|
||||
'goods_price.require' => '商品总额不能为空',
|
||||
'express_price.require' => '运费不能为空',
|
||||
'name.require' => '姓名不能为空',
|
||||
'mobile.require' => '手机号不能为空',
|
||||
'address.require' => '收货地址不能为空',
|
||||
'express_id.require' => '快递公司不能为空',
|
||||
'express_no.require' => '快递单号不能为空',
|
||||
'pay_channel.require' => '支付渠道不能为空',
|
||||
'pay_status.require' => '支付状态不能为空',
|
||||
'pay_time.require' => '付款时间不能为空',
|
||||
'deliver_status.require' => '发货状态不能为空',
|
||||
'deliver_time.require' => '发货时间不能为空',
|
||||
'receive_time.require' => '收货时间不能为空',
|
||||
'end_time.require' => '结束时间不能为空',
|
||||
'goods_id.require' => '商品id不能为空',
|
||||
'goods_name.require' => '商品名称不能为空',
|
||||
'attr.require' => '规格不能为空',
|
||||
'number.require' => '数量不能为空',
|
||||
'profit.require' => '产生收益不能为空',
|
||||
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['order_no', 'user_id', 'order_price', 'pay_price', 'goods_price', 'express_price', 'name', 'mobile', 'address', 'express_id', 'express_no', 'pay_channel', 'pay_status', 'pay_time', 'deliver_status', 'deliver_time', 'receive_time',],
|
||||
'edit' => ['order_no', 'user_id', 'order_price', 'pay_price', 'goods_price', 'express_price', 'name', 'mobile', 'address', 'express_id', 'express_no', 'pay_channel', 'pay_status', 'pay_time', 'deliver_status', 'deliver_time', 'receive_time',],
|
||||
'add' => ['order_no','user_id','order_price','end_time','goods_id','goods_name','attr','number','profit',],
|
||||
'edit' => ['order_no','user_id','order_price','end_time','goods_id','goods_name','attr','number','profit',],
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* 配置表验证器
|
||||
*/
|
||||
|
||||
namespace app\common\validate;
|
||||
|
||||
class ShopConfigValidate extends Validate
|
||||
{
|
||||
protected $rule = [
|
||||
'type|类型' => 'require',
|
||||
'name|名称' => 'require',
|
||||
'value|值' => 'require',
|
||||
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'type.require' => '类型不能为空',
|
||||
'name.require' => '名称不能为空',
|
||||
'value.require' => '值不能为空',
|
||||
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['type','name','value',],
|
||||
'edit' => ['type','name','value',],
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
<?php
|
||||
/**
|
||||
* 提现申请记录表验证器
|
||||
*/
|
||||
|
||||
namespace app\common\validate;
|
||||
|
||||
class WithdrawApplyValidate extends Validate
|
||||
{
|
||||
protected $rule = [
|
||||
'sn|提现单号' => 'require',
|
||||
'user_id|用户id' => 'require',
|
||||
'real_name|真实姓名' => 'require',
|
||||
'account|账号' => 'require',
|
||||
'type|类型:1-提现到钱包余额;2-提现到微信零钱;3-提现到微信收款码;4-提现到支付宝收款码' => 'require',
|
||||
'money|提现金额' => 'require',
|
||||
'left_money|用户可得的金额(扣除手续费后)' => 'require',
|
||||
'money_qr_code|收款二维码' => 'require',
|
||||
'poundage|手续费' => 'require',
|
||||
'remark|提现申请备注' => 'require',
|
||||
'status|状态:1-待提现2-提现中3-提现成功4-提现失败' => 'require',
|
||||
'pay_desc|微信零钱支付信息' => 'require',
|
||||
'payment_no|支付单号' => 'require',
|
||||
'payment_time|支付时间' => 'require',
|
||||
'description|审核备注' => 'require',
|
||||
'transfer_voucher|转账凭证' => 'require',
|
||||
'transfer_time|转账时间' => 'require',
|
||||
'pay_search_desc|微信零钱支付查询结果' => 'require',
|
||||
'transfer_description|转账备注' => 'require',
|
||||
'repay_time|重新支付时间' => 'require',
|
||||
'bank|提现银行' => 'require',
|
||||
'subbank|提现银行支行' => 'require',
|
||||
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'sn.require' => '提现单号不能为空',
|
||||
'user_id.require' => '用户id不能为空',
|
||||
'real_name.require' => '真实姓名不能为空',
|
||||
'account.require' => '账号不能为空',
|
||||
'type.require' => '类型:1-提现到钱包余额;2-提现到微信零钱;3-提现到微信收款码;4-提现到支付宝收款码不能为空',
|
||||
'money.require' => '提现金额不能为空',
|
||||
'left_money.require' => '用户可得的金额(扣除手续费后)不能为空',
|
||||
'money_qr_code.require' => '收款二维码不能为空',
|
||||
'poundage.require' => '手续费不能为空',
|
||||
'remark.require' => '提现申请备注不能为空',
|
||||
'status.require' => '状态:1-待提现2-提现中3-提现成功4-提现失败不能为空',
|
||||
'pay_desc.require' => '微信零钱支付信息不能为空',
|
||||
'payment_no.require' => '支付单号不能为空',
|
||||
'payment_time.require' => '支付时间不能为空',
|
||||
'description.require' => '审核备注不能为空',
|
||||
'transfer_voucher.require' => '转账凭证不能为空',
|
||||
'transfer_time.require' => '转账时间不能为空',
|
||||
'pay_search_desc.require' => '微信零钱支付查询结果不能为空',
|
||||
'transfer_description.require' => '转账备注不能为空',
|
||||
'repay_time.require' => '重新支付时间不能为空',
|
||||
'bank.require' => '提现银行不能为空',
|
||||
'subbank.require' => '提现银行支行不能为空',
|
||||
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['sn','user_id','real_name','account','type','money','left_money','money_qr_code','poundage','remark','status','pay_desc','payment_no','payment_time','description','transfer_voucher','transfer_time','pay_search_desc','transfer_description','repay_time','bank','subbank',],
|
||||
'edit' => ['sn','user_id','real_name','account','type','money','left_money','money_qr_code','poundage','remark','status','pay_desc','payment_no','payment_time','description','transfer_voucher','transfer_time','pay_search_desc','transfer_description','repay_time','bank','subbank',],
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -15,7 +15,8 @@ class IndexController extends Controller
|
|||
//前台模块首页
|
||||
public function index()
|
||||
{
|
||||
|
||||
header("Location: /admin");
|
||||
exit;
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ return [
|
|||
//后台名称简称
|
||||
'short_name' => '后台',
|
||||
//后台作者
|
||||
'author' => '成都小杏子科技有限公司',
|
||||
'author' => '沐亦云储',
|
||||
//后台版本
|
||||
'version' => '0.1',
|
||||
//超级管理员默认密码警告
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ return [
|
|||
// 应用调试模式
|
||||
'app_debug' => true,
|
||||
// 应用Trace
|
||||
'app_trace' => true,
|
||||
'app_trace' => false,
|
||||
// 是否支持多模块
|
||||
'app_multi_module' => true,
|
||||
// 入口自动绑定模块
|
||||
|
|
|
|||
0
public/uploads/attachment/20211124/07871258bf9fd02febf83570d9bb18f5.png
Normal file → Executable file
|
Before Width: | Height: | Size: 101 KiB After Width: | Height: | Size: 101 KiB |
0
public/uploads/attachment/20211124/07871258bf9fd02febf83570d9bb18f5_750_461.png
Normal file → Executable file
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 85 KiB |
|
After Width: | Height: | Size: 119 KiB |
|
After Width: | Height: | Size: 18 KiB |
0
public/uploads/attachment/20211124/4a0604cbfc29e2104a8ea02838f74f99.png
Normal file → Executable file
|
Before Width: | Height: | Size: 101 KiB After Width: | Height: | Size: 101 KiB |
0
public/uploads/attachment/20211124/4a0604cbfc29e2104a8ea02838f74f99_750_461.png
Normal file → Executable file
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 85 KiB |
|
After Width: | Height: | Size: 101 KiB |