This commit is contained in:
lisong 2021-12-28 20:10:21 +08:00
parent 31943f4c53
commit d0338419b0
125 changed files with 8397 additions and 3764 deletions

View File

@ -1,438 +0,0 @@
<?php
/**
* 寄卖订单控制器
*/
namespace app\admin\controller;
use think\Request;
use app\common\model\Goods;
use app\common\model\ConsignmentOrder;
use app\common\model\ConsignmentOrderGoods;
use app\common\model\ConsignmentOrderLog;
use app\common\model\Notice;
use app\common\model\MallImage;
use app\common\validate\OrderValidate;
use app\common\validate\ConsignmentOrderValidate;
class ConsignmentOrderController extends Controller
{
//列表
public function index(Request $request, ConsignmentOrder $model)
{
$param = $request->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;
}
}
//商品名称
if (isset($param['goods_name']) && $param['goods_name'] != '') {
$where[] = ['g.goods_name', 'like', '%' . $param['goods_name'] . '%'];
}
//订单类型
if (isset($param['order_type']) && $param['order_type'] != '') {
$where[] = ['o.order_status', '=', $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')
->join('consignment_order_goods g', 'g.order_id = o.id')
->with(['consignment_order_goods'])
->append(['delivery_address'])
->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());
$this->assign([
'data' => $data,
'page' => $data->render(),
'total' => $data->total(),
]);
return $this->fetch();
}
/**
* Desc: 订单详情
*/
public function detail($id, Request $request, ConsignmentOrder $model, MallImage $mimodel)
{
$order = new ConsignmentOrder();
$data = $order
->with(['user', 'consignment_order_goods','logs'])
->where('id', $id)
->find();
foreach ($data['consignment_order_goods'] as &$consignment_order_goods){
$mi_list=$mimodel->where(array('union_id'=>$consignment_order_goods['id'],'type'=>2))->select();
$consignment_order_goods['img_list']=$mi_list;
}
$this->assign([
'detail' => $data,
]);
return $this->fetch();
}
/**
* Desc: 订单审核
*/
public function examine($id, Request $request, ConsignmentOrder $model, MallImage $mimodel)
{
$order = new ConsignmentOrder();
$data = $order
->with(['user', 'consignment_order_goods','logs'])
->where('id', $id)
->find();
foreach ($data['consignment_order_goods'] as &$consignment_order_goods){
$mi_list=$mimodel->where(array('union_id'=>$consignment_order_goods['id'],'type'=>2))->select();
$consignment_order_goods['img_list']=$mi_list;
}
$this->assign([
'detail' => $data,
]);
return $this->fetch();
}
/**
* Desc: 同意
*/
public function agree(Request $request)
{
if ($this->request->isAjax()) {
$param = $request->param();
// 启动事务
ConsignmentOrderGoods::startTrans();
try{
$order_goods = ConsignmentOrderGoods::get(['id' => $param['id']]);
$order_goods->refund_status = 1;
$order_goods->evaluation_price =$param['evaluation_price'];
$order_goods->save();
$goods_count=ConsignmentOrderGoods::where(array('order_id'=>$order_goods['order_id'],'refund_status'=>0))->count();
$quanbu=0;
if($goods_count==0){
$order = ConsignmentOrder::get(['id' =>$order_goods['order_id']]);
$order->order_status = 3;
$order->total_amount =$order['total_amount']+$param['evaluation_price'];
$order->update_time = time();
$order->save();
//记录日志
ConsignmentOrderLog::record(
$order['id'],
'平台已估价'
);
$data_info=[
'user_id' => $order['user_id'],
'jm_order_id' => $order['id'],
'scene' =>102,
'time' => date('Y-m-d H:i:s')
];
Notice::noticeByScene($order['user_id'],$data_info);
$quanbu=1;
}
// 提交事务
ConsignmentOrderGoods::commit();
}catch(\Exception $e){
// 回滚事务
ConsignmentOrderGoods::rollback();
return error($e->getMessage());
}
return success('操作成功','',$quanbu);
}
}
/**
* Desc: 拒绝
*/
public function refuse(Request $request, ConsignmentOrder $model)
{
if ($this->request->isAjax()) {
$param = $request->param();
// 启动事务
ConsignmentOrderGoods::startTrans();
try{
$order_goods = ConsignmentOrderGoods::get(['id' => $param['id']]);
$order_goods->refund_status = 2;
$order_goods->refund_remarks =$param['remark'];
$order_goods->save();
$goods_count=ConsignmentOrderGoods::where(array('order_id'=>$order_goods['order_id'],'refund_status'=>0))->count();
$quanbu=0;
if($goods_count==0){
$order = ConsignmentOrder::get(['id' =>$order_goods['order_id']]);
$order->order_status = 1;
$order->update_time = time();
$order->save();
//记录日志
ConsignmentOrderLog::record(
$order['id'],
'平台已估价'
);
$data_info=[
'user_id' => $order['user_id'],
'jm_order_id' => $order['id'],
'scene' =>102,
'time' => date('Y-m-d H:i:s')
];
Notice::noticeByScene($order['user_id'],$data_info);
$quanbu=1;
}
// 提交事务
ConsignmentOrderGoods::commit();
}catch(\Exception $e){
// 回滚事务
ConsignmentOrderGoods::rollback();
return error($e->getMessage());
}
return success('操作成功','',$quanbu);
}
}
/**
* Desc: 订单取货
*/
public function pickup($id, Request $request, ConsignmentOrder $model, MallImage $mimodel)
{
$order = new ConsignmentOrder();
$data = $order
->with(['user', 'consignment_order_goods','logs'])
->where('id', $id)
->find();
foreach ($data['consignment_order_goods'] as &$consignment_order_goods){
$mi_list=$mimodel->where(array('union_id'=>$consignment_order_goods['id'],'type'=>2))->select();
$consignment_order_goods['img_list']=$mi_list;
}
$this->assign([
'detail' => $data,
]);
return $this->fetch();
}
/**
* Desc: 取货操作
*/
public function pickuphandle(Request $request, ConsignmentOrder $model, OrderValidate $validate)
{
if ($request->isAjax()) {
$param = $request->param();
$validate_result = $validate->scene('hansle')->check($param);
if (!$validate_result) {
return error($validate->getError());
}
$order_id = $param['order_id'];
$order = ConsignmentOrder::get(['id' => $order_id]);
if ($order['order_status']!='4'){
return error('该订单状态下,无法进行取货操作');
}
// 启动事务
ConsignmentOrder::startTrans();
try{
//更新订单下商品的发货状态
$order->update_time = time();
$order->order_status = 5;
$order->save();
//记录日志
ConsignmentOrderLog::record(
$order['id'],
'平台安排取货',
'物流公司:'.$param['invoice_name'].',物流单号:'.$param['invoice_no']
);
$data_info=[
'user_id' => $order['user_id'],
'jm_order_id' => $order['id'],
'scene' =>103,
'shipping_name' => $param['invoice_name'],
'invoice_no' => $param['invoice_no'],
'time' => date('Y-m-d H:i:s')
];
Notice::noticeByScene($order['user_id'],$data_info);
// 提交事务
ConsignmentOrder::commit();
}catch(\Exception $e){
// 回滚事务
ConsignmentOrder::rollback();
return error($e->getMessage());
}
return success('操作成功');
}
}
/**
* Desc: 订单商品退回
*/
public function return($id, Request $request, ConsignmentOrder $model, MallImage $mimodel)
{
$order = new ConsignmentOrder();
$data = $order
->with(['user', 'consignment_order_goods','logs'])
->where('id', $id)
->find();
foreach ($data['consignment_order_goods'] as &$consignment_order_goods){
$mi_list=$mimodel->where(array('union_id'=>$consignment_order_goods['id'],'type'=>2))->select();
$consignment_order_goods['img_list']=$mi_list;
}
$this->assign([
'detail' => $data,
]);
return $this->fetch();
}
/**
* Desc: 退回操作
*/
public function returnhandle(Request $request)
{
if ($this->request->isAjax()) {
$param = $request->param();
// 启动事务
ConsignmentOrderGoods::startTrans();
try{
$order_goods = ConsignmentOrderGoods::get(['id' => $param['id']]);
$order_goods->refund_status = 3;
$order_goods->refund_remarks ='物流公司:'.$param['invoice_name'].',物流单号:'.$param['invoice_no'];
$order_goods->save();
$goods_count=ConsignmentOrderGoods::where(array('order_id'=>$order_goods['order_id'],'refund_status'=>1))->count();
$order = ConsignmentOrder::get(['id' =>$order_goods['order_id']]);
$order->order_status = 6;
$quanbu=0;
if($goods_count==0){
$quanbu=1;
$order->order_status = 7;
}
$order->total_amount =$order['total_amount']-$order_goods['evaluation_price'];
$order->update_time = time();
$order->save();
//记录日志
ConsignmentOrderLog::record(
$order['id'],
'平台退回商品',
'商品名称:'.$order_goods['goods_name'].',物流公司:'.$param['invoice_name'].',物流单号:'.$param['invoice_no']
);
$data_info=[
'user_id' => $order['user_id'],
'jm_order_id' => $order['id'],
'scene' =>104,
'shipping_name' => $param['invoice_name'],
'invoice_no' => $param['invoice_no'],
'time' => date('Y-m-d H:i:s')
];
Notice::noticeByScene($order['user_id'],$data_info);
// 提交事务
ConsignmentOrderGoods::commit();
}catch(\Exception $e){
// 回滚事务
ConsignmentOrderGoods::rollback();
return error($e->getMessage());
}
return success('操作成功','',$quanbu);
}
}
/**
* Desc: 订单商品上架
*/
public function shelves($id, Request $request, ConsignmentOrder $model, MallImage $mimodel)
{
$order = new ConsignmentOrder();
$data = $order
->with(['user', 'consignment_order_goods','logs'])
->where('id', $id)
->find();
foreach ($data['consignment_order_goods'] as &$consignment_order_goods){
$mi_list=$mimodel->where(array('union_id'=>$consignment_order_goods['id'],'type'=>2))->select();
$consignment_order_goods['img_list']=$mi_list;
}
$this->assign([
'detail' => $data,
]);
return $this->fetch();
}
/**
* Desc: 上架操作
*/
public function shelveshandle(Request $request)
{
if ($this->request->isAjax()) {
$param = $request->param();
$order_goods = ConsignmentOrderGoods::get(['id' => $param['id']]);
$goods = Goods::get(['code' =>$param['goods_sn']]);
if(!$goods){
return error('该商品未上架,无法找到给商品信息');
}
$goods_l_count=ConsignmentOrderGoods::where(array('goods_id'=>$goods['id']))->count();
if($goods_l_count>0){
return error('该商品已上架,无需重复上架该商品');
}
// 启动事务
ConsignmentOrderGoods::startTrans();
try{
$order_goods->refund_status = 4;
$order_goods->goods_id =$goods['id'];
$order_goods->save();
$goods_count=ConsignmentOrderGoods::where(array('order_id'=>$order_goods['order_id'],'refund_status'=>1))->count();
$order = ConsignmentOrder::get(['id' =>$order_goods['order_id']]);
$quanbu=0;
if($goods_count==0){
$quanbu=1;
$order->order_status = 2;
$order->update_time = time();
$order->save();
}
//记录日志
ConsignmentOrderLog::record(
$order['id'],
'平台上架商品',
'商品名称:'.$order_goods['goods_name']
);
$data_info=[
'user_id' => $order['user_id'],
'jm_order_id' => $order['id'],
'scene' =>105,
'time' => date('Y-m-d H:i:s')
];
Notice::noticeByScene($order['user_id'],$data_info);
// 提交事务
ConsignmentOrderGoods::commit();
}catch(\Exception $e){
// 回滚事务
ConsignmentOrderGoods::rollback();
return error($e->getMessage());
}
return success('操作成功','',$quanbu);
}
}
}

View File

@ -1,107 +0,0 @@
<?php
/**
* 商品品牌控制器
*/
namespace app\admin\controller;
use think\Request;
use app\common\model\GoodsBrand;
use app\common\validate\GoodsBrandValidate;
class GoodsBrandController extends Controller
{
//列表
public function index(Request $request, GoodsBrand $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, GoodsBrand $model, GoodsBrandValidate $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([
'capital' => range('A','Z'),
]);
return $this->fetch();
}
//修改
public function edit($id, Request $request, GoodsBrand $model, GoodsBrandValidate $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,
'capital' => range('A','Z'),
]);
return $this->fetch('add');
}
//删除
public function del($id, GoodsBrand $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();
}
}

View File

@ -46,15 +46,6 @@ class GoodsController extends Controller
if (!$validate_result) {
return error($validate->getError());
}
$goods_ids=$param['goods_ids'];
$field_data = array();
foreach ($goods_ids as $key => $value) {
if($param['goods_ids'][$key][0]){
$field_data[] =$param['goods_ids'][$key][0];
}
}
$param['collocation_goods']=json_encode(array_unique($field_data));
// 启动事务
$model->startTrans();
try{
@ -77,20 +68,11 @@ class GoodsController extends Controller
return success('添加成功',$url);
}
$size_list=ShopConfig::get('website', 'size');
$size_list=explode(',',$size_list);
foreach ($size_list as $key => $value) {
$size[$key]['size']=$value;
$size[$key]['num']=0;
}
$this->assign([
'goods_category_list' => $this->getSelectList(new GoodsCategory),
'brand_list' =>GoodsBrand::all(),
'imgurl_list'=>array(),
'number'=>0,
'collocation_goods'=>array(),
'size_list' =>$size,
'goods_list' => Goods::all()
'size_list' =>array(),
]);
return $this->fetch();
}
@ -106,14 +88,6 @@ class GoodsController extends Controller
if (!$validate_result) {
return error($validate->getError());
}
$goods_ids=$param['goods_ids'];
$field_data = array();
foreach ($goods_ids as $key => $value) {
if($param['goods_ids'][$key][0]){
$field_data[] =$param['goods_ids'][$key][0];
}
}
$param['collocation_goods']=json_encode(array_unique($field_data));
// 启动事务
$model->startTrans();
try{
@ -140,30 +114,15 @@ class GoodsController extends Controller
$thumb_img = $v['thumb_image'];
}
}
$collocation_goods=json_decode($data['collocation_goods']);
$goods_item_list=GoodsItem::where(array('goods_id'=>$id))->select();
$goods_item=array();
foreach ($goods_item_list as $key => $value) {
$goods_item[$value['spec_value']]=$value['stock'];
}
$size_list=ShopConfig::get('website', 'size');
$size_list=explode(',',$size_list);
foreach ($size_list as $key => $value) {
$size[$key]['size']=$value;
$num=$goods_item[$value]??'0';
$size[$key]['num']=$num;
}
$this->assign([
'data' => $data,
'goods_category_list' => $this->getSelectList(new GoodsCategory, $data->goods_category_id),
'brand_list' =>GoodsBrand::all(),
'ori_img'=>$ori_img,
'thumb_img'=>$thumb_img,
'imgurl_list'=>$imgurl_list,
'number'=>count($collocation_goods),
'collocation_goods'=>$collocation_goods,
'size_list' =>$size,
'goods_list' => Goods::all()
'number'=>count($goods_item_list),
'size_list' =>$goods_item_list,
]);
return $this->fetch('add');

View File

@ -1,131 +0,0 @@
<?php
/**
* 首页栏目商品控制器
*/
namespace app\admin\controller;
use think\Request;
use app\common\model\GoodsIndex;
use app\common\model\Goods;
use app\common\validate\GoodsIndexValidate;
class GoodsIndexController extends Controller
{
//列表
public function index(Request $request, GoodsIndex $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, GoodsIndex $model, GoodsIndexValidate $validate)
{
if ($request->isPost()) {
$param = $request->param();
$validate_result = $validate->scene('add')->check($param);
if (!$validate_result) {
return error($validate->getError());
}
$goods_ids=$param['goods_id'];
$field_data = array();
foreach ($goods_ids as $key => $value) {
if($param['goods_id'][$key][0]){
$field_data[] =$param['goods_id'][$key][0];
}
}
if(count($field_data)=='0'){
return error('请选择商品');
}
$param['goods_ids']=json_encode(array_unique($field_data));
$result = $model::create($param);
$url = URL_BACK;
if(isset($param['_create']) && $param['_create']==1){
$url = URL_RELOAD;
}
return $result ? success('添加成功',$url) : error();
}
$this->assign([
'goods_list' => Goods::all(),
'number'=>0,
'goods_ids'=>array()
]);
return $this->fetch();
}
//修改
public function edit($id, Request $request, GoodsIndex $model, GoodsIndexValidate $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());
}
$goods_ids=$param['goods_id'];
$field_data = array();
foreach ($goods_ids as $key => $value) {
if($param['goods_id'][$key][0]){
$field_data[] =$param['goods_id'][$key][0];
}
}
if(count($field_data)=='0'){
return error('请选择商品');
}
$param['goods_ids']=json_encode(array_unique($field_data));
$result = $data->save($param);
return $result ? success() : error();
}
$goods_ids=json_decode($data['goods_ids']);
$this->assign([
'data' => $data,
'number'=>count($goods_ids),
'goods_list' => Goods::all(),
'goods_ids'=>$goods_ids
]);
return $this->fetch('add');
}
//删除
public function del($id, GoodsIndex $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();
}
}

View File

@ -1,106 +0,0 @@
<?php
/**
* 品相配置控制器
*/
namespace app\admin\controller;
use think\Request;
use app\common\model\PhaseConfig;
use app\common\validate\PhaseConfigValidate;
class PhaseConfigController extends Controller
{
//列表
public function index(Request $request, PhaseConfig $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, PhaseConfig $model, PhaseConfigValidate $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, PhaseConfig $model, PhaseConfigValidate $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, PhaseConfig $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();
}
}

View File

@ -1,272 +0,0 @@
{extend name="layout1" /}
{block name='content'}
<style>
.layui-form-label{
width:180px;
}
.div-flex {
display: flex;
align-items: center;
justify-content: left;
}
.width-160 {
width: 200px;
float: left;
display: block;
padding: 9px 15px;
font-weight: 400;
}
.layui-table th {
text-align: center;
}
.table-margin{
margin-left: 50px;
margin-right: 50px;
text-align: center;
}
.image{
height:50px;
width: 50px;
}
.mt50{
margin-left: 50px;
}
</style>
<div class="layui-card-body" >
<!--基本信息-->
<div class="layui-form" lay-filter="layuiadmin-form-order" id="layuiadmin-form-order" >
<input type="hidden" class="order_id" name="order_id" value="{$detail.id}">
<div class="layui-form-item">
<fieldset class="layui-elem-field layui-field-title">
<legend>订单信息</legend>
</fieldset>
</div>
<div class="layui-form-item div-flex">
<label class="layui-form-label ">订单编号:</label>
<div class="width-160">{$detail.order_sn}</div>
<label class="layui-form-label ">订单状态:</label>
<div class="width-160">{$detail.order_status_text}</div>
<label class="layui-form-label ">下单时间:</label>
<div class="width-160">{$detail.create_time}</div>
</div>
<div class="layui-form-item">
<fieldset class="layui-elem-field layui-field-title">
<legend>会员信息</legend>
</fieldset>
</div>
<div class="layui-form-item div-flex">
<label class="layui-form-label ">会员编号:</label>
<div class="width-160">{$detail.user.sn}</div>
<label class="layui-form-label ">会员昵称:</label>
<div class="width-160">{$detail.user.nickname}</div>
<label class="layui-form-label ">手机号码:</label>
<div class="width-160">{$detail.user.mobile}</div>
<label class="layui-form-label ">注册时间:</label>
<div class="width-160">{$detail.user.create_time}</div>
</div>
<div class="layui-form-item">
<fieldset class="layui-elem-field layui-field-title">
<legend>取货信息</legend>
</fieldset>
</div>
<div class="layui-form-item div-flex">
<label class="layui-form-label ">取货人:</label>
<div class="width-160">{$detail.consignee}</div>
<label class="layui-form-label ">手机号:</label>
<div class="width-160">{$detail.mobile}</div>
<label class="layui-form-label ">取货地址:</label>
<div class="width-160">{$detail.address}</div>
<label class="layui-form-label ">取货时间:</label>
<div class="width-160">{$detail.takeparts_time}</div>
</div>
<div class="layui-form-item">
<fieldset class="layui-elem-field layui-field-title">
<legend>退货信息</legend>
</fieldset>
</div>
{eq name="$detail.is_return" value="1"}
<div class="layui-form-item div-flex">
<label class="layui-form-label ">退货人:</label>
<div class="width-160">{$detail.consignee}</div>
<label class="layui-form-label ">手机号:</label>
<div class="width-160">{$detail.mobile}</div>
<label class="layui-form-label ">退货地址:</label>
<div class="width-160">{$detail.address}</div>
</div>
{else/}
<div class="layui-form-item div-flex">
<label class="layui-form-label"></label>
<div class="width-160">无需退回</div>
</div>
{/eq}
<div class="layui-form-item">
<fieldset class="layui-elem-field layui-field-title">
<legend>商品信息</legend>
</fieldset>
</div>
<div class="layui-form-item table-margin">
<table class="layui-table">
<colgroup>
<col width="250">
<col width="200">
<col width="200">
<col width="100">
<col width="200">
<col width="100">
</colgroup>
<thead>
<tr>
<th>图片</th>
<th>商品名称</th>
<th>商品信息</th>
<th>估计</th>
<th>备注</th>
<th>状态</th>
</tr>
</thead>
<tbody>
{foreach $detail.consignment_order_goods as $k => $goods}
<tr>
<td>
<div style="text-align: left">
{foreach $goods.img_list as $k1 => $img}
<div style="float:left; margin-right: 10px;">
<img src="{$img.ori_image}" class="image-show image" >
</div>
{/foreach}
</div>
</td>
<td>
<div style="text-align: left">
{$goods.goods_name}
</div>
</td>
<td>
<div style="text-align: left">
<div class="layui-col-md9">
<p style="margin-top: 10px">购买价格:{$goods.goods_price}</p>
<p>尺寸:{$goods.item_value}</p>
<p>品牌:{$goods.brand_name}</p>
<p>品类:{$goods.class_name}</p>
<p>品相:{$goods.phase_name}</p>
<p>购买渠道:{$goods.channel_name}</p>
</div>
</div>
</td>
<td>
<div style="text-align: left">
¥{$goods.evaluation_price}
</div>
</td>
<td>
<div style="text-align: left">
{$goods.refund_remarks}
</div>
</td>
<td>
<div style="text-align: left">
{$goods.refund_status_text}
</div>
</td>
</tr>
{/foreach}
<tr>
<td colspan="6" style="text-align: right;">
<p>商品总估计金额:¥{$detail.total_amount}</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="layui-form-item">
<fieldset class="layui-elem-field layui-field-title">
<legend>订单操作</legend>
</fieldset>
</div>
<div class="layui-form-item div-flex ">
<div class="layui-input-block ">
{eq name="$detail.order_status" value="0"}
<button type="submit" class="layui-btn layui-btn-sm layui-btn-normal width_160 " id="examine">审核</button>
{/eq}
<button type="button" class="layui-btn layui-btn-sm layui-btn-primary width_160 " id="back">返回</button>
</div>
</div>
<div class="layui-form-item">
<fieldset class="layui-elem-field layui-field-title">
<legend>订单流程</legend>
</fieldset>
</div>
<div class="layui-form-item div-flex">
<div class="layui-input-block ">
<ul class="layui-timeline">
{volist name="$detail.logs" id="vo"}
<li class="layui-timeline-item">
<i class="layui-icon layui-timeline-axis"></i>
<div class="layui-timeline-content layui-text">
<h3 class="layui-timeline-title">{$vo.remark}({$vo.create_time})</h3>
<!--日志备注-->
{notempty name="$vo.extra"}
<h4>{$vo.extra}</h4>
{/notempty}
</div>
</li>
{/volist}
</ul>
</div>
</div>
</div>
</div>
<script type="text/javascript">
//注意:选项卡 依赖 element 模块,否则无法进行功能性操作
layui.config({
version:"2.6.6.20211117",
base: '/static/layui-admin/dist/layuiadmin/' //静态资源所在路径
}).extend({
index: 'lib/index' //主入口模块
}).use(['index', 'element', 'jquery', 'like'], function () {
var $ = layui.$;
var like = layui.like;
//主图放大
$(document).on('click', '.image-show', function () {
var src = $(this).attr('src');
like.showImg(src,400);
});
$('#back').click(function () {
var index=parent.layer.getFrameIndex(window.name); //获取当前窗口的name
parent.layer.close(index);
parent.layui.table.reload('order-lists');
return true;
});
//发货
$('#examine').click(function () {
var id = $('.order_id').val();
layer.open({
type: 2
,title: '订单审核'
,content: '{:url("consignment_order/examine")}?id='+id
,area: ['90%', '90%']
,yes: function(index, layero){
}
})
});
});
</script>
{/block}

View File

@ -1,246 +0,0 @@
{extend name="layout1" /}
{block name='content'}
<style>
.layui-form-label{
width:180px;
}
.div-flex {
display: flex;
align-items: center;
justify-content: left;
}
.width-160 {
width: 200px;
float: left;
display: block;
padding: 9px 15px;
font-weight: 400;
}
.layui-table th {
text-align: center;
}
.table-margin{
margin-left: 50px;
margin-right: 50px;
text-align: center;
}
.image{
height:50px;
width: 50px;
}
.mt50{
margin-left: 50px;
}
</style>
<div class="layui-card-body" >
<!--基本信息-->
<div class="layui-form" lay-filter="layuiadmin-form-order" id="layuiadmin-form-order" >
<input type="hidden" class="order_id" name="order_id" value="{$detail.id}">
<div class="layui-form-item">
<fieldset class="layui-elem-field layui-field-title">
<legend>取货信息</legend>
</fieldset>
</div>
<div class="layui-form-item div-flex">
<label class="layui-form-label ">取货人:</label>
<div class="width-160">{$detail.consignee}</div>
<label class="layui-form-label ">手机号:</label>
<div class="width-160">{$detail.mobile}</div>
<label class="layui-form-label ">取货地址:</label>
<div class="width-160">{$detail.address}</div>
<label class="layui-form-label ">取货时间:</label>
<div class="width-160">{$detail.takeparts_time}</div>
</div>
<div class="layui-form-item">
<fieldset class="layui-elem-field layui-field-title">
<legend>退货信息</legend>
</fieldset>
</div>
{eq name="$detail.is_return" value="1"}
<div class="layui-form-item div-flex">
<label class="layui-form-label ">退货人:</label>
<div class="width-160">{$detail.consignee}</div>
<label class="layui-form-label ">手机号:</label>
<div class="width-160">{$detail.mobile}</div>
<label class="layui-form-label ">退货地址:</label>
<div class="width-160">{$detail.address}</div>
</div>
{else/}
<div class="layui-form-item div-flex">
<label class="layui-form-label"></label>
<div class="width-160">无需退回</div>
</div>
{/eq}
<div class="layui-form-item">
<fieldset class="layui-elem-field layui-field-title">
<legend>商品信息</legend>
</fieldset>
</div>
<div class="layui-form-item table-margin">
<table class="layui-table">
<colgroup>
<col width="250">
<col width="200">
<col width="200">
<col width="100">
</colgroup>
<thead>
<tr>
<th>图片</th>
<th>商品名称</th>
<th>商品信息</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{foreach $detail.consignment_order_goods as $k => $goods}
<tr>
<td>
<div style="text-align: left">
{foreach $goods.img_list as $k1 => $img}
<div style="float:left; margin-right: 10px;">
<img src="{$img.ori_image}" class="image-show image" >
</div>
{/foreach}
</div>
</td>
<td>
<div style="text-align: left">
{$goods.goods_name}
</div>
</td>
<td>
<div style="text-align: left">
<div class="layui-col-md9">
<p style="margin-top: 10px">购买价格:{$goods.goods_price}</p>
<p>尺寸:{$goods.item_value}</p>
<p>品牌:{$goods.brand_name}</p>
<p>品类:{$goods.class_name}</p>
<p>品相:{$goods.phase_name}</p>
<p>购买渠道:{$goods.channel_name}</p>
</div>
</div>
</td>
<td>
{if condition="$goods.refund_status=='0' && $goods.is_confirm=='1'"}
<button type="submit" class="layui-btn layui-btn-sm layui-btn-normal width_160 agree" goods_id="{$goods.id}">同意</button>
<button type="submit" class="layui-btn layui-btn-sm layui-btn-danger width_160 refuse" goods_id="{$goods.id}">拒绝</button>
{/if}
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
</div>
</div>
<script type="text/javascript">
//注意:选项卡 依赖 element 模块,否则无法进行功能性操作
layui.config({
version:"2.6.6.20211117",
base: '/static/layui-admin/dist/layuiadmin/' //静态资源所在路径
}).extend({
index: 'lib/index' //主入口模块
}).use(['index', 'element', 'jquery', 'like'], function () {
var $ = layui.$;
var like = layui.like;
//主图放大
$(document).on('click', '.image-show', function () {
var src = $(this).attr('src');
like.showImg(src,400);
});
//商家同意
$('.agree').click(function () {
var id=$(this).attr('goods_id');
layer.confirm(
"商品估价:"+"<input type=text name=evaluation_price id='evaluation_price' placeholder='请输入估价' autocomplete=off class=layui-input style='height:40px'>", {
btn: ['确认','取消'] //按钮
}, function(){
var evaluation_price = $('#evaluation_price').val();
if (evaluation_price == null || evaluation_price == undefined || evaluation_price == ''){
layer.msg('请填写估价!');
return false;
}
like.ajax({
url: '{:url("consignment_order/agree")}'
, data: {'id': id,'evaluation_price':evaluation_price}
, type: 'post'
, success: function (res) {
if (res.code == 1) {
layui.layer.msg(res.msg, {
offset: '15px'
, icon: 1
, time: 1000
},function () {
if(res.data==1){
var index = parent.layer.getFrameIndex(window.name);
parent.location.reload();
parent.layer.close(index);
}else{
location.reload();
}
});
}else{
layui.layer.msg(res.msg, {
offset: '15px'
, icon: 2
, time: 1000
})
}
}
});
return false;
});
});
//商家拒绝
$('.refuse').click(function () {
var id=$(this).attr('goods_id');
layer.confirm(
"拒绝原因:"+"<textarea id='remark' name='remark' class='layui-textarea' type='text' style='height:100px'></textarea>", {
btn: ['确认','取消'] //按钮
}, function(){
var remark = $('#remark').val();
if (remark == null || remark == undefined || remark == ''){
layer.msg('请填写拒绝原因!');
return false;
}
like.ajax({
url: '{:url("consignment_order/refuse")}'
, data: {'id': id,'remark':remark}
, type: 'post'
, success: function (res) {
if (res.code == 1) {
layui.layer.msg(res.msg, {
offset: '15px'
, icon: 1
, time: 1000
},function () {
if(res.data==1){
var index = parent.layer.getFrameIndex(window.name);
parent.location.reload();
parent.layer.close(index);
}else{
location.reload();
}
});
}else{
layui.layer.msg(res.msg, {
offset: '15px'
, icon: 2
, time: 1000
})
}
}
});
return false;
});
});
});
</script>
{/block}

View File

@ -1,335 +0,0 @@
{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('index')}" method="GET">
<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>
<div class="layui-inline">
<input type="text" name="keyword" id="keyword" value="{$keyword?$keyword:'';}" placeholder="请输入搜索内容"
autocomplete="off" class="layui-input">
</div>
<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="0" {if isset($order_type) && $order_type=='0'}selected{/if}>审核中</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>
<option value="3" {if isset($order_type) && $order_type=='3'}selected{/if}>待客户确认</option>
<option value="4" {if isset($order_type) && $order_type=='4'}selected{/if}>客户已确认</option>
<option value="5" {if isset($order_type) && $order_type=='5'}selected{/if}>已取货</option>
<option value="6" {if isset($order_type) && $order_type=='6'}selected{/if}>部分退回</option>
<option value="7" {if isset($order_type) && $order_type=='7'}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 class="row">
<div class="col-md-12">
<div class="box">
<div class="box-body table-responsive">
<table class="table table-hover table-bordered datatable" width="100%">
<thead>
<tr>
<th>
<div class="layui-table-cell" style="width:240px;text-align:center;">订单信息</div>
</th>
<th>
<div style="width:400px;text-align:center;">用户信息</div>
</th>
<th>
<div style="width:300px;text-align:center;">商品信息</div>
</th>
<th>
<div style="width:200px;text-align:center;">取货信息</div>
</th>
<th>
<div style="width:200px;text-align:center;">退货信息</div>
</th>
<th><div class="layui-table-cell" style="width:280px;text-align:center;">操作</div></th>
</tr>
</thead>
<tbody>
{foreach name="data" item="item"}
<tr>
<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_sn}</p>
<p>订单状态:{$item.order_status_text}</p>
<p>订单金额:{$item.total_amount}</p>
<p>下单时间:{$item.create_time}</p>
</div>
</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.sn}</p>
<p>用户昵称:{$item.nickname}</p>
<p>用户手机:{$item.mobile}</p>
</div>
</div>
</td>
<td class="layui-table-col-special">
{foreach name="item.consignment_order_goods" item="item1"}
<div style="text-align: left; width:300px" class="goods-data">
<div class="layui-input-inline layui-col-md8">
<span class="layui-col-md7 goods_name_hide">{$item1.goods_name}</span>
<span class="layui-col-md5">¥{$item1.goods_price}</span>
<br>
<span class="layui-col-md7 goods_name_hide">{$item1.item_value}</span>
</div>
</div>
{/foreach}
</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: 200px;">
<p>取货人:{$item.consignee}</p>
<p>手机号码:{$item.mobile}</p>
<p>取货地址:{$item.address}</p>
</div>
</div>
</td>
<td class="layui-table-col-special">
{eq name="$item.is_return" value="1"}
<div class="layui-table-cell laytable-cell-1-0-2">
<div class="layui-input-inline" style="text-align:left;width: 200px;">
<p>退货人:{$item.th_consignee}</p>
<p>手机号码:{$item.th_mobile}</p>
<p>退货地址:{$item.th_address}</p>
</div>
</div>
{else}
无需退回
{/eq}
</td>
<td>
<div class="layui-table-cell" style="width: 280px;">
<button type="submit" class="layui-btn layui-btn-sm layui-btn-primary width_160 detail" order_id="{$item.id}">查看详情</button>
{eq name="$item.order_status" value="0"}
<button type="submit" class="layui-btn layui-btn-sm layui-btn-normal width_160 examine" order_id="{$item.id}">审核</button>
{/eq}
{if condition="$item.order_status=='4'"}
<button type="submit" class="layui-btn layui-btn-sm layui-btn-normal width_160 pickup" order_id="{$item.id}">取货</button>
{/if}
{if condition="($item.order_status=='5' || $item.order_status=='6') && $item.is_return=='1'"}
<button type="submit" class="layui-btn layui-btn-sm layui-btn-normal width_160 return" order_id="{$item.id}">退回</button>
{/if}
{if condition="$item.order_status=='5' || $item.order_status=='6'"}
<button type="submit" class="layui-btn layui-btn-sm layui-btn-normal width_160 shelves" order_id="{$item.id}">上架</button>
{/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>&nbsp;
<small>每页显示</small>
&nbsp;
<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>
&nbsp;
<small>条记录</small>
</label>
</div>
</div>
</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'
});
//注意:选项卡 依赖 element 模块,否则无法进行功能性操作
layui.config({
version:"2.6.6.20211117",
base: '/static/layui-admin/dist/layuiadmin/' //静态资源所在路径
}).extend({
index: 'lib/index' //主入口模块
}).use(['index', 'element', 'jquery', 'like'], function () {
var $ = layui.$;
var like = layui.like;
//主图放大
$(document).on('click', '.image-show', function () {
var src = $(this).attr('src');
like.showImg(src,600);
});
//查看详情
$('.detail').click(function () {
var id = $(this).attr('order_id');
layer.open({
type: 2
,title: '订单详情'
,content: '{:url("consignment_order/detail")}?id='+id
,area: ['90%', '90%']
,yes: function(index, layero){
}
})
});
//审核
$('.examine').click(function () {
var id = $(this).attr('order_id');
layer.open({
type: 2
,title: '订单审核'
,content: '{:url("consignment_order/examine")}?id='+id
,area: ['90%', '90%']
,yes: function(index, layero){
}
})
});
//取货
$('.pickup').click(function () {
var id = $(this).attr('order_id');
layer.open({
type: 2
,title: '订单取货'
,content: '{:url("consignment_order/pickup")}?id='+id
,area: ['90%', '90%']
,yes: function(index, layero){
}
})
});
//退回
$('.return').click(function () {
var id = $(this).attr('order_id');
layer.open({
type: 2
,title: '订单商品退回'
,content: '{:url("consignment_order/return")}?id='+id
,area: ['90%', '90%']
,yes: function(index, layero){
}
})
});
//上架
$('.shelves').click(function () {
var id = $(this).attr('order_id');
layer.open({
type: 2
,title: '订单商品上架'
,content: '{:url("consignment_order/shelves")}?id='+id
,area: ['90%', '90%']
,yes: function(index, layero){
}
})
});
});
</script>
{/block}

View File

@ -1,244 +0,0 @@
{extend name="layout1" /}
{block name='content'}
<style>
.layui-form-label{
width:180px;
}
.div-flex {
display: flex;
align-items: center;
justify-content: left;
}
.width-160 {
width: 200px;
float: left;
display: block;
padding: 9px 15px;
font-weight: 400;
}
.layui-table th {
text-align: center;
}
.table-margin{
margin-left: 50px;
margin-right: 50px;
text-align: center;
}
.image{
height:50px;
width: 50px;
}
.mt50{
margin-left: 50px;
}
</style>
<div class="layui-card-body" >
<!--基本信息-->
<div class="layui-form" lay-filter="layuiadmin-form-express" id="layuiadmin-form-express" >
<input type="hidden" class="order_id" name="order_id" value="{$detail.id}">
<div class="layui-form-item">
<fieldset class="layui-elem-field layui-field-title">
<legend>取货信息</legend>
</fieldset>
</div>
<div class="layui-form-item div-flex">
<label class="layui-form-label ">取货人:</label>
<div class="width-160">{$detail.consignee}</div>
<label class="layui-form-label ">手机号:</label>
<div class="width-160">{$detail.mobile}</div>
<label class="layui-form-label ">取货地址:</label>
<div class="width-160">{$detail.address}</div>
<label class="layui-form-label ">取货时间:</label>
<div class="width-160">{$detail.takeparts_time}</div>
</div>
<div class="layui-form-item">
<fieldset class="layui-elem-field layui-field-title">
<legend>退货信息</legend>
</fieldset>
</div>
{eq name="$detail.is_return" value="1"}
<div class="layui-form-item div-flex">
<label class="layui-form-label ">退货人:</label>
<div class="width-160">{$detail.consignee}</div>
<label class="layui-form-label ">手机号:</label>
<div class="width-160">{$detail.mobile}</div>
<label class="layui-form-label ">退货地址:</label>
<div class="width-160">{$detail.address}</div>
</div>
{else/}
<div class="layui-form-item div-flex">
<label class="layui-form-label"></label>
<div class="width-160">无需退回</div>
</div>
{/eq}
<div class="layui-form-item">
<fieldset class="layui-elem-field layui-field-title">
<legend>商品信息</legend>
</fieldset>
</div>
<div class="layui-form-item table-margin">
<table class="layui-table">
<colgroup>
<col width="250">
<col width="200">
<col width="200">
<col width="100">
<col width="100">
</colgroup>
<thead>
<tr>
<th>图片</th>
<th>商品名称</th>
<th>商品信息</th>
<th>估价</th>
<th>状态</th>
</tr>
</thead>
<tbody>
{foreach $detail.consignment_order_goods as $k => $goods}
<tr>
<td>
<div style="text-align: left">
{foreach $goods.img_list as $k1 => $img}
<div style="float:left; margin-right: 10px;">
<img src="{$img.ori_image}" class="image-show image" >
</div>
{/foreach}
</div>
</td>
<td>
<div style="text-align: left">
{$goods.goods_name}
</div>
</td>
<td>
<div style="text-align: left">
<div class="layui-col-md9">
<p style="margin-top: 10px">购买价格:{$goods.goods_price}</p>
<p>尺寸:{$goods.item_value}</p>
<p>品牌:{$goods.brand_name}</p>
<p>品类:{$goods.class_name}</p>
<p>品相:{$goods.phase_name}</p>
<p>购买渠道:{$goods.channel_name}</p>
</div>
</div>
</td>
<th>
<div style="text-align: left">
{$goods.evaluation_price}
</div>
</th>
<td>
{if condition="$goods.is_confirm=='1'"}
<div style="text-align: left">
已同意估价
</div>
{elseif condition="$goods.is_confirm=='0'"/}
<div style="text-align: left">
未同意估价
</div>
{else condition="$goods.refund_status=='2'"/}
<div style="text-align: left">
{$goods.refund_remarks}
</div>
{/if}
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
<div class="layui-form-item">
<fieldset class="layui-elem-field layui-field-title">
<legend>取货物流</legend>
</fieldset>
</div>
<div class="layui-form-item div-flex select-express">
<label class="layui-form-label ">快递公司:</label>
<div>
<input type="text" name="invoice_name" placeholder="请输入快递公司" autocomplete="off"
class="layui-input">
</div>
</div>
<div class="layui-form-item div-flex select-express" >
<label class="layui-form-label ">快递单号:</label>
<div>
<input type="text" name="invoice_no" placeholder="请输入快递单号" autocomplete="off"
class="layui-input">
</div>
</div>
<div class="layui-form-item div-flex ">
<div class="layui-input-block ">
<input type="button" class="layui-btn layui-btn-sm layui-btn-normal width_160" lay-submit lay-filter="send" id="send" value="取货">
<button type="button" class="layui-btn layui-btn-sm layui-btn-primary width_160 " id="back">返回</button>
</div>
</div>
</div>
</div>
<script type="text/javascript">
//注意:选项卡 依赖 element 模块,否则无法进行功能性操作
layui.config({
version:"2.6.6.20211117",
base: '/static/layui-admin/dist/layuiadmin/' //静态资源所在路径
}).extend({
index: 'lib/index' //主入口模块
}).use(['index', 'element', 'jquery', 'like', 'form'], function () {
var $ = layui.$
, form = layui.form;
var like = layui.like;
//主图放大
$(document).on('click', '.image-show', function () {
var src = $(this).attr('src');
like.showImg(src,600);
});
$('#back').click(function () {
var index=parent.layer.getFrameIndex(window.name); //获取当前窗口的name
parent.layer.close(index);
parent.layui.table.reload('order-lists');
return true;
});
//发货
form.on('submit(send)', function (data) {
var field = data.field;
like.ajax({
url: '{:url("consignment_order/pickuphandle")}'
, data: field
, type: 'post'
, success: function (res) {
if (res.code == 1) {
layui.layer.msg(res.msg, {
offset: '15px'
, icon: 1
, time: 1000
},function () {
var index = parent.layer.getFrameIndex(window.name);
parent.location.reload();
parent.layer.close(index);
});
}else{
layui.layer.msg(res.msg, {
offset: '15px'
, icon: 2
, time: 1000
});
}
},
});
})
});
</script>
{/block}

View File

@ -1,208 +0,0 @@
{extend name="layout1" /}
{block name='content'}
<style>
.layui-form-label{
width:180px;
}
.div-flex {
display: flex;
align-items: center;
justify-content: left;
}
.width-160 {
width: 200px;
float: left;
display: block;
padding: 9px 15px;
font-weight: 400;
}
.layui-table th {
text-align: center;
}
.table-margin{
margin-left: 50px;
margin-right: 50px;
text-align: center;
}
.image{
height:50px;
width: 50px;
}
.mt50{
margin-left: 50px;
}
</style>
<div class="layui-card-body" >
<!--基本信息-->
<div class="layui-form" lay-filter="layuiadmin-form-order" id="layuiadmin-form-order" >
<input type="hidden" class="order_id" name="order_id" value="{$detail.id}">
<div class="layui-form-item">
<fieldset class="layui-elem-field layui-field-title">
<legend>取货信息</legend>
</fieldset>
</div>
<div class="layui-form-item div-flex">
<label class="layui-form-label ">取货人:</label>
<div class="width-160">{$detail.consignee}</div>
<label class="layui-form-label ">手机号:</label>
<div class="width-160">{$detail.mobile}</div>
<label class="layui-form-label ">取货地址:</label>
<div class="width-160">{$detail.address}</div>
<label class="layui-form-label ">取货时间:</label>
<div class="width-160">{$detail.takeparts_time}</div>
</div>
<div class="layui-form-item">
<fieldset class="layui-elem-field layui-field-title">
<legend>退货信息</legend>
</fieldset>
</div>
{eq name="$detail.is_return" value="1"}
<div class="layui-form-item div-flex">
<label class="layui-form-label ">退货人:</label>
<div class="width-160">{$detail.consignee}</div>
<label class="layui-form-label ">手机号:</label>
<div class="width-160">{$detail.mobile}</div>
<label class="layui-form-label ">退货地址:</label>
<div class="width-160">{$detail.address}</div>
</div>
{else/}
<div class="layui-form-item div-flex">
<label class="layui-form-label"></label>
<div class="width-160">无需退回</div>
</div>
{/eq}
<div class="layui-form-item">
<fieldset class="layui-elem-field layui-field-title">
<legend>商品信息</legend>
</fieldset>
</div>
<div class="layui-form-item table-margin">
<table class="layui-table">
<colgroup>
<col width="250">
<col width="200">
<col width="200">
<col width="100">
</colgroup>
<thead>
<tr>
<th>图片</th>
<th>商品名称</th>
<th>商品信息</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{foreach $detail.consignment_order_goods as $k => $goods}
<tr>
<td>
<div style="text-align: left">
{foreach $goods.img_list as $k1 => $img}
<div style="float:left; margin-right: 10px;">
<img src="{$img.ori_image}" class="image-show image" >
</div>
{/foreach}
</div>
</td>
<td>
<div style="text-align: left">
{$goods.goods_name}
</div>
</td>
<td>
<div style="text-align: left">
<div class="layui-col-md9">
<p style="margin-top: 10px">购买价格:{$goods.goods_price}</p>
<p>尺寸:{$goods.item_value}</p>
<p>品牌:{$goods.brand_name}</p>
<p>品类:{$goods.class_name}</p>
<p>品相:{$goods.phase_name}</p>
<p>购买渠道:{$goods.channel_name}</p>
</div>
</div>
</td>
<td>
{if condition="$goods.refund_status=='1'"}
<button type="submit" class="layui-btn layui-btn-sm layui-btn-normal width_160 return" goods_id="{$goods.id}">退回</button>
{/if}
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
</div>
</div>
<script type="text/javascript">
//注意:选项卡 依赖 element 模块,否则无法进行功能性操作
layui.config({
version:"2.6.6.20211117",
base: '/static/layui-admin/dist/layuiadmin/' //静态资源所在路径
}).extend({
index: 'lib/index' //主入口模块
}).use(['index', 'element', 'jquery', 'like'], function () {
var $ = layui.$;
var like = layui.like;
//主图放大
$(document).on('click', '.image-show', function () {
var src = $(this).attr('src');
like.showImg(src,400);
});
//退回
$('.return').click(function () {
var id=$(this).attr('goods_id');
layer.confirm(
"物流公司:"+"<input type=text name=invoice_name id='invoice_name' placeholder='请输入物流公司' autocomplete=off class=layui-input style='height:30px'><br><br>"+
"物流单号:"+"<input type=text name=invoice_no id='invoice_no' placeholder='请输入物流单号' autocomplete=off class=layui-input style='height:30px'>", {
btn: ['确认','取消'] //按钮
}, function(){
var invoice_name = $('#invoice_name').val();
if (invoice_name == null || invoice_name == undefined || invoice_name == ''){
layer.msg('请填写物流公司!');
return false;
}
var invoice_no = $('#invoice_no').val();
if (invoice_no == null || invoice_no == undefined || invoice_no == ''){
layer.msg('请填写物流单号!');
return false;
}
like.ajax({
url: '{:url("consignment_order/returnhandle")}'
, data: {'id': id,'invoice_name':invoice_name,'invoice_no':invoice_no}
, type: 'post'
, success: function (res) {
if (res.code == 1) {
layui.layer.msg(res.msg, {
offset: '15px'
, icon: 1
, time: 1000
},function () {
if(res.data==1){
var index = parent.layer.getFrameIndex(window.name);
parent.location.reload();
parent.layer.close(index);
}else{
location.reload();
}
});
}else{
layui.layer.msg(res.msg, {
offset: '15px'
, icon: 2
, time: 1000
})
}
}
});
return false;
});
});
});
</script>
{/block}

View File

@ -1,167 +0,0 @@
{extend name="layout1" /}
{block name='content'}
<style>
.layui-form-label{
width:180px;
}
.div-flex {
display: flex;
align-items: center;
justify-content: left;
}
.width-160 {
width: 200px;
float: left;
display: block;
padding: 9px 15px;
font-weight: 400;
}
.layui-table th {
text-align: center;
}
.table-margin{
margin-left: 50px;
margin-right: 50px;
text-align: center;
}
.image{
height:50px;
width: 50px;
}
.mt50{
margin-left: 50px;
}
</style>
<div class="layui-card-body" >
<!--基本信息-->
<div class="layui-form" lay-filter="layuiadmin-form-order" id="layuiadmin-form-order" >
<input type="hidden" class="order_id" name="order_id" value="{$detail.id}">
<div class="layui-form-item">
<fieldset class="layui-elem-field layui-field-title">
<legend>商品信息</legend>
</fieldset>
</div>
<div class="layui-form-item table-margin">
<table class="layui-table">
<colgroup>
<col width="250">
<col width="200">
<col width="200">
<col width="100">
</colgroup>
<thead>
<tr>
<th>图片</th>
<th>商品名称</th>
<th>商品信息</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{foreach $detail.consignment_order_goods as $k => $goods}
<tr>
<td>
<div style="text-align: left">
{foreach $goods.img_list as $k1 => $img}
<div style="float:left; margin-right: 10px;">
<img src="{$img.ori_image}" class="image-show image" >
</div>
{/foreach}
</div>
</td>
<td>
<div style="text-align: left">
{$goods.goods_name}
</div>
</td>
<td>
<div style="text-align: left">
<div class="layui-col-md9">
<p style="margin-top: 10px">购买价格:{$goods.goods_price}</p>
<p>尺寸:{$goods.item_value}</p>
<p>品牌:{$goods.brand_name}</p>
<p>品类:{$goods.class_name}</p>
<p>品相:{$goods.phase_name}</p>
<p>购买渠道:{$goods.channel_name}</p>
</div>
</div>
</td>
<td>
{if condition="$goods.refund_status=='1'"}
<button type="submit" class="layui-btn layui-btn-sm layui-btn-normal width_160 shelves" goods_id="{$goods.id}">上架</button>
{/if}
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
</div>
</div>
<script type="text/javascript">
//注意:选项卡 依赖 element 模块,否则无法进行功能性操作
layui.config({
version:"2.6.6.20211117",
base: '/static/layui-admin/dist/layuiadmin/' //静态资源所在路径
}).extend({
index: 'lib/index' //主入口模块
}).use(['index', 'element', 'jquery', 'like'], function () {
var $ = layui.$;
var like = layui.like;
//主图放大
$(document).on('click', '.image-show', function () {
var src = $(this).attr('src');
like.showImg(src,400);
});
//上架
$('.shelves').click(function () {
var id=$(this).attr('goods_id');
layer.confirm(
"商品编号:"+"<input type=text name='goods_sn' id='goods_sn' placeholder='请输入商品编号' autocomplete=off class=layui-input style='height:30px'>", {
btn: ['确认','取消'] //按钮
}, function(){
var goods_sn = $('#goods_sn').val();
if (goods_sn == null || goods_sn == undefined || goods_sn == ''){
layer.msg('请填写商品编号!');
return false;
}
like.ajax({
url: '{:url("consignment_order/shelveshandle")}'
, data: {'id': id,'goods_sn':goods_sn}
, type: 'post'
, success: function (res) {
if (res.code == 1) {
layui.layer.msg(res.msg, {
offset: '15px'
, icon: 1
, time: 1000
},function () {
if(res.data==1){
var index = parent.layer.getFrameIndex(window.name);
parent.location.reload();
parent.layer.close(index);
}else{
location.reload();
}
});
}else{
layui.layer.msg(res.msg, {
offset: '15px'
, icon: 2
, time: 1000
})
}
}
});
return false;
});
});
});
</script>
{/block}

View File

@ -76,9 +76,8 @@ ul.albums li a.btn-fm_z{
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
<ul class="layui-tab-title">
<li class="layui-this">基本设置</li>
<li>尺码库存</li>
<li>规格库存</li>
<li>商品详情</li>
<li>精品搭配</li>
</ul>
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">
@ -107,24 +106,6 @@ ul.albums li a.btn-fm_z{
<script>
$('#goods_category_id').select2();
</script>
<div class="form-group">
<label for="brand_id" class="col-sm-2 control-label">所属品牌</label>
<div class="col-sm-10 col-md-4">
<select name="brand_id" id="brand_id"
class="form-control field-select" data-placeholder="请选择所属分类">
<option value=""></option>
{foreach name='brand_list' id='item'}
<option value="{$item.id}" {if isset($data.brand_id) &&
$data.brand_id==$item.id}selected{/if}>
{$item.name}
</option>
{/foreach}
</select>
</div>
</div>
<script>
$('#brand_id').select2();
</script>
<div class="form-group">
<label for="img" class="col-sm-2 control-label">上传图片</label>
<ul class="albums" id="albums">
@ -153,7 +134,7 @@ ul.albums li a.btn-fm_z{
upload.render({
elem: '#nophoto' //绑定元素
,url: "{:url('file/icon')}" //接口url
,data:{type:1,width:370,heigh:478}
,data:{type:1,width:305,heigh:357}
,field:'image'
,multiple: true
,done: function(res){
@ -236,6 +217,26 @@ ul.albums li a.btn-fm_z{
}
});
</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="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="sort_number" class="col-sm-2 control-label">排序(升序)</label>
<div class="col-sm-10 col-md-4">
@ -252,94 +253,59 @@ ul.albums li a.btn-fm_z{
});
</script>
</div>
<div class="layui-tab-item">
<div class="form-group">
<div class="col-sm-10">
<table class="table table-hover table-bordered datatable" width="100%">
<thead>
<tr class="input-type">
<th>尺码</th>
<th>库存</th>
</tr>
</thead>
<tbody>
{foreach name='size_list' key='k' id='item1'}
<tr>
<td>
<label>
<input class="form-control field-type" value="{$item1.size}" name="size[{$k}][]" placeholder="请输入数量" readonly="readonly">
</label>
</td>
<td>
<label>
<input class="form-control field-type" value="{$item1.num}" name="number[{$k}][]" placeholder="请输入数量">
</label>
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
</div>
</div>
<div class="layui-tab-item">
<div class="form-group">
<label for="detail" class="col-sm-2 control-label">单品信息</label>
<div class="col-sm-10 col-md-4">
<textarea id="detail" name="detail" class="form-control" rows="3" placeholder="请输入描述">{$data.detail|default=''}</textarea>
</div>
</div>
<div class="form-group">
<label for="model" class="col-sm-2 control-label">模特信息</label>
<div class="col-sm-10 col-md-4">
<input id="model" name="model" value="{$data.model|default=''}"
placeholder="请输入模特信息" type="text" class="form-control field-number">
</div>
</div>
<div class="form-group">
<label for="goods_size" class="col-sm-2 control-label">尺码信息</label>
<div class="col-sm-10 col-md-4">
<textarea id="goods_size" name="goods_size" class="form-control" rows="3" placeholder="请输入尺码信息">{$data.goods_size|default=''}</textarea>
</div>
</div>
</div>
<div class="layui-tab-item">
<div class="form-group">
<div class="col-sm-10">
<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">
{foreach name='collocation_goods' key='k' id='item1'}
{foreach name='size_list' key='k' id='item1'}
<tr>
<td>
<label>
<select style="min-width: 380px;width: 420px;" name="goods_ids[{$k}][]" class="select2" data-live-search="true" tabindex="-98">
{foreach name='goods_list' id='item'}
<option value="{$item.id}" {if isset($item1) &&
$item1==$item.id}selected{/if}>
{$item.name}
</option>
{/foreach}
</select>
<input class="form-control field-type" value="{$item1.spec_value}" name="item_name[{$k}][]" placeholder="请输入规格名称">
</label>
</td>
<td>
<label>
<input class="form-control field-type" value="{$item1.stock}" name="number[{$k}][]" placeholder="请输入库存">
</label>
</td>
<td>
<!-- <a class="btn btn-xs btn-primary" onclick="addNewField(this,1)">插入</a> -->
<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>
</tr>
<input type="hidden" name="item_id[{$k}][]" value="{$item1.id}">
{/foreach}
</tbody>
</table>
</div>
</div>
</div>
<div class="layui-tab-item">
<div class="form-group">
<label for="detail" class="col-sm-2 control-label">商品详情</label>
<div class="col-sm-8">
<script id="detail" name="detail" type="text/plain">{$data.detail|raw|default=''}</script>
</div>
</div>
<script>
UE.delEditor('detail');
var ue = UE.getEditor('detail',{
serverUrl :UEServer,
});
ue.ready(function() {
ue.setHeight(400); //设置高度
});
</script>
</div>
</div>
</div>
</div>
@ -378,14 +344,13 @@ ul.albums li a.btn-fm_z{
<tr>
<td>
<label>
<select name="goods_idsFORM_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>
<input class="form-control field-type" value="" name="item_nameFORM_INDEX[]" placeholder="请输入规格名称">
<input type="hidden" name="item_idFORM_INDEX[]" value="">
</label>
</td>
<td>
<label>
<input class="form-control field-type" value="" name="numberFORM_INDEX[]" placeholder="请输入库存">
</label>
</td>
<td>

View File

@ -1,134 +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="initial" class="col-sm-2 control-label">品牌首字母</label>
<div class="col-sm-10 col-md-4">
<select name="initial" id="initial" class="form-control field-select" data-placeholder="请选择品牌首字母">
<option value=""></option>
{foreach name='capital' id='item'}
<option value="{$item}" {if isset($data) &&
$data.initial==$item}selected{/if}>{$item}
</option>
{/foreach}
</select>
</div>
</div>
<script>
$('#initial').select2();
</script>
<div class="form-group">
<label for="is_show" class="col-sm-2 control-label">是否显示</label>
<div class="col-sm-10 col-md-4">
<input class="input-switch" id="is_show" value="1" {if(!isset($data) ||$data.is_show==1)}checked{/if} type="checkbox" />
<input class="switch field-switch" placeholder="是否显示:1-是.0-否" name="is_show" value="{$data.is_show|default='1'}" hidden />
</div>
</div>
<script>
$('#is_show').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" class="col-sm-2 control-label">排序</label>
<div class="col-sm-10 col-md-4">
<input id="sort" name="sort" value="{$data.sort|default='0'}" 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,
},
'initial': {
required: true,
},
'is_show': {
required: true,
},
'sort': {
required: true,
},
},
messages: {
'name': {
required: "品牌名称不能为空",
},
'initial': {
required: "品牌首字母不能为空",
},
'is_show': {
required: "是否显示:1-是.0-否不能为空",
},
'sort': {
required: "排序不能为空",
},
}
});
</script>
{/block}

View File

@ -1,126 +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>
<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.name}</td>
<td>{$item.initial}</td>
<td>{$item.is_show_text}</td>
<td>{$item.sort}</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>&nbsp;
<small>每页显示</small>
&nbsp;
<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>
&nbsp;
<small>条记录</small>
</label>
</div>
</div>
</div>
</div>
</section>
{/block}

View File

@ -1,227 +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="type" class="col-sm-2 control-label">显示模式</label>
<div class="col-sm-10 col-md-4 layui-form">
<input type="radio" name="type" value="1" title="模式一" {if isset($data.type) && $data.type=='1'}checked{/if}>
<input type="radio" name="type" value="2" title="模式二" {if isset($data.type) && $data.type=='2'}checked{/if}>
<input type="radio" name="type" value="3" title="模式三" {if isset($data.type) && $data.type=='3'}checked{/if}>
</div>
</div>
<div class="form-group">
<label for="goods_ids" class="col-sm-2 control-label">商品列表</label>
<div class="col-sm-10">
<table id="dataList" class="table table-hover table-bordered datatable" width="100%">
<thead>
<tr class="input-type">
<th>商品名称</th>
<th>操作</th>
</tr>
</thead>
<tbody id="dataBody">
{foreach name='goods_ids' key='k' id='item1'}
<tr>
<td>
<label>
<select style="min-width: 380px;width: 420px;" name="goods_id[{$k}][]" class="select2" data-live-search="true" tabindex="-98">
{foreach name='goods_list' id='item'}
<option value="{$item.id}" {if isset($item1) &&
$item1==$item.id}selected{/if}>
{$item.name}
</option>
{/foreach}
</select>
</label>
</td>
<td>
<!-- <a class="btn btn-xs btn-primary" onclick="addNewField(this,1)">插入</a> -->
<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>
</tr>
{/foreach}
</tbody>
</table>
</div>
</div>
<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="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>
<table>
<tbody id="data-template" style="display: none">
<tr>
<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>
<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>
</tr>
</tbody>
</table>
<script>
/** 表单验证 **/
$('#dataForm').validate({
rules: {
'name': {
required: true,
},
'sort_number': {
required: true,
},
'status': {
required: true,
},
},
messages: {
'name': {
required: "栏目名称不能为空",
},
'sort_number': {
required: "排序(升序)不能为空",
},
'status': {
required: "是否上架不能为空",
},
}
});
//表单索引
var formIndex ='{$number}';
//添加新的字段
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 () {
//默认添加一行空的字段
if(formIndex==0){
addNewField(null, 1);
}else{
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();
}
layui.use('form', function(){
var form = layui.form;
form.render();
});
</script>
{/block}

View File

@ -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>栏目名称</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.name}</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">
<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>&nbsp;
<small>每页显示</small>
&nbsp;
<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>
&nbsp;
<small>条记录</small>
</label>
</div>
</div>
</div>
</div>
</section>
{/block}

View File

@ -1,88 +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="describe" class="col-sm-2 control-label">描述</label>
<div class="col-sm-10 col-md-4">
<textarea id="describe" name="describe" class="form-control" rows="3" placeholder="请输入描述">{$data.describe|default=''}</textarea>
</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,
},
'describe': {
required: true,
},
},
messages: {
'name': {
required: "名称不能为空",
},
'describe': {
required: "描述不能为空",
},
}
});
</script>
{/block}

View File

@ -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>名称</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.name}</td>
<td>{$item.describe}</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>&nbsp;
<small>每页显示</small>
&nbsp;
<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>
&nbsp;
<small>条记录</small>
</label>
</div>
</div>
</div>
</div>
</section>
{/block}

View File

@ -131,9 +131,6 @@
<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>

View File

@ -1,241 +0,0 @@
<?php
/**
* 寄卖订单模型
*/
namespace app\common\model;
use think\model\concern\SoftDelete;
use think\db;
class ConsignmentOrder extends Model
{
use SoftDelete;
public $softDelete = true;
protected $name = 'consignment_order';
protected $autoWriteTimestamp = true;
//可搜索字段
protected $searchField = ['mobile',];
//订单状态
public function getOrderStatusTextAttr($value, $data)
{
return self::JMORDER_TEXT[$data['order_status']];
}
//是否退回获取器
public function getIsReturnTextAttr($value, $data)
{
return self::BOOLEAN_TEXT[$data['is_return']];
}//订单取消时间获取器
public function getCancelTimeAttr($value)
{
return date('Y-m-d H:i:s',$value);
}
//订单取消时间修改器
public function setCancelTimeAttr($value)
{
return strtotime($value);
}
//订单关联商品
public function consignmentOrderGoods()
{
return $this->hasMany('consignment_order_goods', 'order_id', 'id');
}
//订单用户
public function user()
{
return $this->hasOne('user', 'id', 'user_id')
->field('id,sn,nickname,avatar,mobile,create_time');
}
//订单流程
public function logs()
{
return $this->hasMany('consignment_order_log', 'order_id', 'id')->order('id desc');
}
/**
* Notes: 结算详情
* @param $json_value
* @param $user_id
* @return array
*/
public static function info($json_value, $user_id)
{
try{
$goods_lists = array();
$total_num = 0;//商品总数量
foreach ($json_value as $good) {
$goods_lists[] = $good;
//订单汇总信息
$total_num ++;
}
if (empty($goods_lists)) {
$data=[
'code' =>0,
'msg' =>'无商品',
'data' =>'',
];
return $data;
}
//寄卖数量限制
$jmnum =ShopConfig::get('website', 'jmnum');
if($jmnum>$total_num){
$data=[
'code' =>0,
'msg' =>'寄卖满'.$jmnum.'件才可下单',
'data' =>'',
];
return $data;
}
$result = [
'goods_lists' => array_values($goods_lists),
];
$data=[
'code' =>1,
'msg' =>'',
'data' =>$result,
];
return $data;
} catch (Exception $e) {
$data=[
'code' =>0,
'msg' =>$e->getMessage(),
'data' =>'',
];
return $data;
}
}
/**
* Notes: 添加订单
* @param $user_id
* @param $data
* @param $post
*/
public static function add($user_id, $data)
{
Db::startTrans();
try {
$goods_lists = $data['goods_lists'];
if (empty($data['goods_lists'])) {
$data=[
'code' =>0,
'msg' =>'无商品',
'data' =>'',
];
return $data;
}
$order = self::addOrder($user_id, $data);
$order_id = $order['order_id'];
$addOrderGoods=self::addOrderGoods($order_id, $goods_lists);
if($addOrderGoods['code']==0){
return $addOrderGoods;
}
self::addOrderAfter($order_id, $user_id, $data);
Db::commit();
$data=[
'code' =>1,
'msg' =>'',
'data' =>$order,
];
return $data;
} catch (Exception $e) {
Db::rollback();
$data=[
'code' =>0,
'msg' =>$e->getMessage(),
'data' =>'',
];
return $data;
}
}
/**
* Notes: 添加订单记录
* @param $user_id
* @param $data
* @param $user_address
* @param array $extra
*/
public static function addOrder($user_id, $data)
{
$order_data = [
'order_sn' => createSn('order', 'order_sn', '', 4),
'user_id' => $user_id,
'order_status' =>0,
'create_time' => time(),
];
$order_id = Db::name('consignment_order')->insertGetId($order_data);
return [
'order_id' => $order_id,
'order_sn' => $order_data['order_sn'],
];
}
/**
* Notes: 添加订单商品记录
* @param $order_id
* @param $goods_lists
*/
public static function addOrderGoods($order_id, $goods_lists)
{
foreach ($goods_lists as $k1 => $good) {
$goods_data = [
'order_id' => $order_id,
'item_value' => $good['item_value'],
'goods_name' => $good['goods_name'],
'item_value' => $good['item_value'],
'goods_price' => $good['goods_price'],
'goods_img' => $good['img'][0],
'brand_name' => $good['brand_name'],
'phase_name' => $good['phase_name'],
'class_name' => $good['class_name'],
'channel_name' => $good['channel_name'],
'create_time' => time(),
];
$goods_id = Db::name('consignment_order_goods')->insertGetId($goods_data);
foreach ($good['img'] as $key => $value) {
$goods_img[] = [
'type' =>2,
'union_id' => $goods_id,
'thumb_image' => $value,
'ori_image' => $value,
'create_time' => time(),
];
}
}
Db::name('mall_image')->insertAll($goods_img);
$data=[
'code' =>1,
'msg' =>'',
'data' =>'',
];
return $data;
}
/**
* Notes: 下单后操作
* @param $order_id
* @param $user_id
* @param $type
* @param $data
*/
public static function addOrderAfter($order_id, $user_id, $data)
{
//记录日志
ConsignmentOrderLog::record(
$order_id,
'寄卖下单成功',
'24小时内平台估价'
);
}
}

View File

@ -1,29 +0,0 @@
<?php
/**
* 订单商品表模型
*/
namespace app\common\model;
use think\model\concern\SoftDelete;
class ConsignmentOrderGoods extends Model
{
use SoftDelete;
public $softDelete = true;
protected $name = 'consignment_order_goods';
protected $autoWriteTimestamp = true;
//可搜索字段
protected $searchField = [];
//商品订单状态
public function getRefundStatusTextAttr($value, $data)
{
return self::JMORDER_GOODS_TEXT[$data['refund_status']];
}
}

View File

@ -1,32 +0,0 @@
<?php
/**
* 订单流程表模型
*/
namespace app\common\model;
use think\model\concern\SoftDelete;
class ConsignmentOrderLog extends Model
{
protected $name = 'consignment_order_log';
protected $autoWriteTimestamp = true;
//可搜索字段
protected $searchField = [];
//写入订单流程日志
public static function record($order_id, $remark, $extra = '')
{
if (empty($remark)) {
return true;
}
$log = new ConsignmentOrderLog();
$log->order_id = $order_id;
$log->remark = $remark;
$log->extra = $extra;
$log->create_time = time();
$log->save();
}
}

View File

@ -1,35 +0,0 @@
<?php
/**
* 商品品牌模型
*/
namespace app\common\model;
use think\model\concern\SoftDelete;
class GoodsBrand extends Model
{
use SoftDelete;
public $softDelete = true;
protected $name = 'goods_brand';
protected $autoWriteTimestamp = true;
//可搜索字段
protected $searchField = ['name',];
//是否显示:1-是.0-否获取器
public function getIsShowTextAttr($value, $data)
{
return self::BOOLEAN_TEXT[$data['is_show']];
}//删除时间获取器
public function getDeleteTimeAttr($value)
{
return date('Y-m-d H:i:s',$value);
}
//删除时间修改器
public function setDeleteTimeAttr($value)
{
return strtotime($value);
}
}

View File

@ -1,29 +0,0 @@
<?php
/**
* 首页栏目商品模型
*/
namespace app\common\model;
use think\model\concern\SoftDelete;
class GoodsIndex extends Model
{
use SoftDelete;
public $softDelete = true;
protected $name = 'goods_index';
protected $autoWriteTimestamp = true;
//可搜索字段
protected $searchField = ['name',];
//是否上架获取器
public function getStatusTextAttr($value, $data)
{
return self::BOOLEAN_TEXT[$data['status']];
}
}

View File

@ -18,16 +18,27 @@ class GoodsItem extends Model
*/
public static function goods_item_upload($goods_id, $param)
{
$size=$param['size'];
$new_item_id = [];
$all_item_id = self::where('goods_id', $goods_id)->column('id');
$name=$param['item_name'];
$field_data = array();
foreach ($size as $key => $value) {
$data = self::where(['spec_value' => $param['size'][$key][0], 'goods_id' => $goods_id])->find();
if (empty($data)) {
self::insert(['spec_value' => $param['size'][$key][0], 'goods_id' => $goods_id, 'stock' => $param['number'][$key][0]]);
} else {
self::where(['spec_value' => $param['size'][$key][0], 'goods_id' => $goods_id])
->update(['stock' =>$param['number'][$key][0]]);
}
foreach ($name as $key => $value) {
$item_id = $param['item_id'][$key][0];
if ($item_id) {
self::where(['id' => $item_id])
->update(['stock' =>$param['number'][$key][0],'spec_value' => $param['item_name'][$key][0]]);
$new_item_id[] = $item_id;
} else {
$new_item_id[] = self::insertGetId(['spec_value' => $param['item_name'][$key][0], 'goods_id' => $goods_id, 'stock' => $param['number'][$key][0]]);
}
}
$del_item_ids = array_diff($all_item_id, $new_item_id);
if (!empty($del_item_ids)) {
//删除规格值
self::where('goods_id', $goods_id)
->where('id', 'in', $del_item_ids)
->delete();
}
}
}

View File

@ -1,25 +0,0 @@
<?php
/**
* 品相配置模型
*/
namespace app\common\model;
use think\model\concern\SoftDelete;
class PhaseConfig extends Model
{
use SoftDelete;
public $softDelete = true;
protected $name = 'phase_config';
protected $autoWriteTimestamp = true;
//可搜索字段
protected $searchField = ['name','describe',];
}

View File

@ -1,48 +0,0 @@
<?php
/**
* 寄卖订单验证器
*/
namespace app\common\validate;
class ConsignmentOrderValidate extends Validate
{
protected $rule = [
'order_sn|订单编号' => 'require',
'user_id|用户id' => 'require',
'order_status|订单状态;0-审核中;1-待上架;2-已上架;3-已取消' => 'require',
'is_return|是否退回' => 'require',
'consignee|收货人' => 'require',
'address|地址' => 'require',
'mobile|手机' => 'require',
'th_consignee|退回收货人' => 'require',
'th_address|退回地址' => 'require',
'th_mobile|退回电话' => 'require',
'goods_price|订单商品总价' => 'require',
];
protected $message = [
'order_sn.require' => '订单编号不能为空',
'user_id.require' => '用户id不能为空',
'order_status.require' => '订单状态;0-审核中;1-待上架;2-已上架;3-已取消不能为空',
'is_return.require' => '是否退回不能为空',
'consignee.require' => '收货人不能为空',
'address.require' => '地址不能为空',
'mobile.require' => '手机不能为空',
'th_consignee.require' => '退回收货人不能为空',
'th_address.require' => '退回地址不能为空',
'th_mobile.require' => '退回电话不能为空',
'goods_price.require' => '订单商品总价不能为空',
];
protected $scene = [
'add' => ['order_sn','user_id','order_status','is_return','consignee','address','mobile','th_consignee','th_address','th_mobile','goods_price',],
'edit' => ['order_sn','user_id','order_status','is_return','consignee','address','mobile','th_consignee','th_address','th_mobile','goods_price',],
];
}

View File

@ -1,34 +0,0 @@
<?php
/**
* 商品品牌验证器
*/
namespace app\common\validate;
class GoodsBrandValidate extends Validate
{
protected $rule = [
'name|品牌名称' => 'require',
'initial|品牌首字母' => 'require',
'is_show|是否显示:1-是.0-否' => 'require',
'sort|排序' => 'require',
];
protected $message = [
'name.require' => '品牌名称不能为空',
'initial.require' => '品牌首字母不能为空',
'is_show.require' => '是否显示:1-是.0-否不能为空',
'sort.require' => '排序不能为空',
];
protected $scene = [
'add' => ['name','initial','is_show','sort',],
'edit' => ['name','initial','is_show','sort',],
];
}

View File

@ -1,34 +0,0 @@
<?php
/**
* 首页栏目商品验证器
*/
namespace app\common\validate;
class GoodsIndexValidate extends Validate
{
protected $rule = [
'name|栏目名称' => 'require',
'goods_ids|商品id组' => 'require',
'sort_number|排序(升序)' => 'require',
'status|是否上架' => 'require',
];
protected $message = [
'name.require' => '栏目名称不能为空',
'goods_ids.require' => '商品id组不能为空',
'sort_number.require' => '排序(升序)不能为空',
'status.require' => '是否上架不能为空',
];
protected $scene = [
'add' => ['name','sort_number','status',],
'edit' => ['name','sort_number','status',],
];
}

View File

@ -34,8 +34,8 @@ class GoodsValidate extends Validate
];
protected $scene = [
'add' => ['goods_category_id', 'name','code', 'price', 'brand_id', 'detail', 'sort_number', 'status',],
'edit' => ['goods_category_id', 'name','code', 'price', 'brand_id', 'detail', 'sort_number', 'status',],
'add' => ['goods_category_id', 'name','code', 'price', 'detail', 'sort_number', 'status',],
'edit' => ['goods_category_id', 'name','code', 'price', 'detail', 'sort_number', 'status',],
];

View File

@ -1,30 +0,0 @@
<?php
/**
* 品相配置验证器
*/
namespace app\common\validate;
class PhaseConfigValidate extends Validate
{
protected $rule = [
'name|名称' => 'require',
'describe|描述' => 'require',
];
protected $message = [
'name.require' => '名称不能为空',
'describe.require' => '描述不能为空',
];
protected $scene = [
'add' => ['name','describe',],
'edit' => ['name','describe',],
];
}

View File

@ -15,11 +15,11 @@ return [
// 服务器地址
'hostname' => '114.215.82.135',
// 数据库名
'database' => 'dgg_jimai',
'database' => 'dgg_yanguang',
// 用户名
'username' => 'dgg_jimai',
'username' => 'dgg_yanguang',
// 密码
'password' => 'dgg_jimai@028',
'password' => 'dggyanguang@028',
// 端口
'hostport' => '3306',
// 连接dsn

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 237 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 237 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 237 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 KiB

Some files were not shown because too many files have changed in this diff Show More