将售后申请设置为商家手动允许售后
This commit is contained in:
parent
dda4187357
commit
7f81ee073b
@ -25,6 +25,8 @@ use app\admin\logic\LoginLogic;
|
||||
use app\admin\validate\LoginValidate;
|
||||
use app\common\basics\AdminBase;
|
||||
use app\common\server\JsonServer;
|
||||
use app\common\server\WeChatServer;
|
||||
use EasyWeChat\Factory;
|
||||
|
||||
class Login extends AdminBase
|
||||
{
|
||||
@ -36,6 +38,22 @@ class Login extends AdminBase
|
||||
*/
|
||||
public function login()
|
||||
{
|
||||
// $this->config = WeChatServer::getOaConfig();
|
||||
// $this->app = Factory::officialAccount($this->config);
|
||||
// $this->app->template_message->sendSubscription([
|
||||
// 'touser' => 'user-openid',
|
||||
// 'template_id' => 'template-id',
|
||||
// 'url' => 'https://easywechat.com',
|
||||
// 'scene' => 1000,
|
||||
// 'data' => [
|
||||
// 'key1' => 'VALUE',
|
||||
// 'key2' => 'VALUE2',
|
||||
// ...
|
||||
// ],
|
||||
// ]);
|
||||
// dump($this->config);
|
||||
// dump($this->app);
|
||||
// die;
|
||||
if ($this->request->isAjax()) {
|
||||
$post = request()->post();
|
||||
(new LoginValidate())->goCheck();
|
||||
|
||||
@ -56,7 +56,7 @@ class AfterSaleLogic extends Logic
|
||||
$where[] = ['o.order_status', 'in', [Order::STATUS_WAIT_RECEIVE, Order::STATUS_FINISH]];
|
||||
$order = new Order();
|
||||
$count = $order->alias('o')
|
||||
->field('o.id,o.confirm_take_time,o.order_status,o.create_time,s.id as sid,s.name as shop_name,s.type as shop_type')
|
||||
->field('o.id,o.confirm_take_time,o.order_status,o.create_time, o.allow_after_sale, s.id as sid,s.name as shop_name,s.type as shop_type')
|
||||
->join('order_goods g', 'g.order_id = o.id')
|
||||
->join('shop s', 'o.shop_id = s.id')
|
||||
->with(['order_goods' => function ($query) {
|
||||
@ -69,7 +69,7 @@ class AfterSaleLogic extends Logic
|
||||
|
||||
$lists = $order
|
||||
->alias('o')
|
||||
->field('o.id,o.confirm_take_time,o.order_status,o.order_sn,o.create_time,s.id as sid,s.name as shop_name,s.logo as shop_logo,s.type as shop_type')
|
||||
->field('o.id,o.confirm_take_time,o.order_status,o.order_sn,o.create_time, o.allow_after_sale,s.id as sid,s.name as shop_name,s.logo as shop_logo,s.type as shop_type')
|
||||
->join('order_goods g', 'g.order_id = o.id')
|
||||
->join('shop s', 'o.shop_id = s.id')
|
||||
->with(['order_goods' => function ($query) {
|
||||
@ -115,6 +115,7 @@ class AfterSaleLogic extends Logic
|
||||
$result['order_goods'] = $order_goods;
|
||||
$result['order_sn'] = $item['order_sn'];
|
||||
$result['create_time'] = $item['create_time'];
|
||||
$result['allow_after_sale'] = $item['allow_after_sale'];
|
||||
$result['after_sale']['desc'] = '';
|
||||
$result['after_sale']['able_apply'] = 1;
|
||||
$result['after_sale']['sn'] = '';
|
||||
@ -132,6 +133,7 @@ class AfterSaleLogic extends Logic
|
||||
$result['time'] = $time;
|
||||
$data[] = $result;
|
||||
}
|
||||
|
||||
$list = ['list' => $data, 'page' => $page, 'size' => $size, 'count' => $count, 'more' => is_more($count, $page, $size)];
|
||||
return $list;
|
||||
break;
|
||||
|
||||
@ -349,4 +349,16 @@ class Order extends ShopBase
|
||||
}
|
||||
}
|
||||
|
||||
// 允许售后申请
|
||||
public function allowAfterSale()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$params = $this->request->post();
|
||||
if (OrderLogic::allowAfterSale($params)) {
|
||||
return JsonServer::success('操作成功');
|
||||
}
|
||||
|
||||
return JsonServer::error('操作失败');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1090,4 +1090,14 @@ class OrderLogic extends Logic
|
||||
}
|
||||
}
|
||||
|
||||
// 允许售后申请
|
||||
public static function allowAfterSale($params)
|
||||
{
|
||||
$type = 1;
|
||||
if ($params['type'] == 1) {
|
||||
$type = 0;
|
||||
}
|
||||
|
||||
return Order::where('id', $params['id'])->update(['allow_after_sale' => $type, 'update_time' => time()]);
|
||||
}
|
||||
}
|
||||
@ -3,22 +3,27 @@
|
||||
.layui-table-cell {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.goods-content > div:not(:last-of-type) {
|
||||
border-bottom: 1px solid #DCDCDC;
|
||||
}
|
||||
|
||||
.goods-data::after {
|
||||
display: block;
|
||||
content: '';
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.goods_name_hide {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.operation-btn {
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
.table-operate {
|
||||
text-align: left;
|
||||
font-size: 14px;
|
||||
@ -40,7 +45,8 @@
|
||||
<div class="layui-colla-content layui-show">
|
||||
<p>*会员商城下单列表。</p>
|
||||
<p>*订单状态有待付款,待发货,待收货,已完成,已关闭。</p>
|
||||
<p>*待付款订单取消后则为已关闭。待付款订单支付后则为待发货。待发货订单发货后则为待收货。待收货订单收货后则为已完成。</p>
|
||||
<p>
|
||||
*待付款订单取消后则为已关闭。待付款订单支付后则为待发货。待发货订单发货后则为待收货。待收货订单收货后则为已完成。</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -183,17 +189,21 @@
|
||||
{{# } }}
|
||||
|
||||
{{# if(d.order_status <= 1){ }}
|
||||
<a class="layui-btn layui-btn-danger layui-btn-sm operation-btn" lay-event="cancel">取消订单</a>
|
||||
<a class="layui-btn layui-btn-danger layui-btn-sm operation-btn"
|
||||
lay-event="cancel">取消订单</a>
|
||||
{{# } }}
|
||||
|
||||
{{# if(d.order_status == 1 && d.order_type != 2){ }}
|
||||
{{# if(d.delivery_type != 2){ }}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn" lay-event="delivery">发货</a>
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn"
|
||||
lay-event="delivery">发货</a>
|
||||
{{# } }}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn" lay-event="change_address">修改地址</a>
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn"
|
||||
lay-event="change_address">修改地址</a>
|
||||
{{# } else { }}
|
||||
{{# if(d.order_status == 1 && d.is_team_success){ }}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn" lay-event="delivery">发货</a>
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn"
|
||||
lay-event="delivery">发货</a>
|
||||
{{# } }}
|
||||
{{# } }}
|
||||
|
||||
@ -208,7 +218,8 @@
|
||||
|
||||
<!--提货核销-->
|
||||
{{# if(d.verification_btn){ }}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn" lay-event="verification">订单核销</a>
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn"
|
||||
lay-event="verification">订单核销</a>
|
||||
{{# } }}
|
||||
|
||||
{{# if(d.order_status == 3 && d.delivery_type == 0){ }}
|
||||
@ -216,11 +227,18 @@
|
||||
{{# } }}
|
||||
|
||||
{{# if(d.order_status == 4){ }}
|
||||
<a class="layui-btn layui-btn-danger layui-btn-sm operation-btn" lay-event="del">删除订单</a>
|
||||
<a class="layui-btn layui-btn-danger layui-btn-sm operation-btn"
|
||||
lay-event="del">删除订单</a>
|
||||
{{# } }}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn" lay-event="print">小票打印</a>
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn" lay-event="remarks">备注</a>
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn"
|
||||
lay-event="print">小票打印</a>
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn"
|
||||
lay-event="remarks">备注</a>
|
||||
|
||||
{{# if(d.order_status > 1 && d.allow_after_sale == 0){ }}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn"
|
||||
lay-event="allow">允许售后</a>
|
||||
{{# } }}
|
||||
</div>
|
||||
</script>
|
||||
|
||||
@ -250,7 +268,8 @@
|
||||
<img src="{{d.user.avatar}}" style="height:80px;width: 80px" class="image-show">
|
||||
<div class="layui-input-inline" style="text-align: left;">
|
||||
<p>会员编号:{{d.user.sn}}</p>
|
||||
<p style="width: 180px;text-overflow:ellipsis;overflow: hidden">会员昵称:{{d.user.nickname}}</p>
|
||||
<p style="width: 180px;text-overflow:ellipsis;overflow: hidden">
|
||||
会员昵称:{{d.user.nickname}}</p>
|
||||
<p>会员等级:{{d.user_level}}</p>
|
||||
</div>
|
||||
</script>
|
||||
@ -281,7 +300,8 @@
|
||||
<div class="goods-content">
|
||||
{{# layui.each(d.order_goods, function(index, item){ }}
|
||||
<div style="text-align: left;" class="goods-data">
|
||||
<img src="{{ item.image }}" style="height:80px;width: 80px" class="image-show layui-col-md4">
|
||||
<img src="{{ item.image }}" style="height:80px;width: 80px"
|
||||
class="image-show layui-col-md4">
|
||||
<div class="layui-input-inline layui-col-md8">
|
||||
<span class="layui-col-md7 goods_name_hide">{{ item.goods_name }}</span>
|
||||
<span class="layui-col-md5">¥{{ item.goods_price }}</span>
|
||||
@ -525,7 +545,6 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
//发货
|
||||
if (obj.event === 'delivery') {
|
||||
layer.open({
|
||||
@ -601,7 +620,11 @@
|
||||
, type: 'get'
|
||||
, success: function (res) {
|
||||
if (res.code === 1) {
|
||||
layer.prompt({title: '备注信息', formType: 2, value: res.data[0].order_remarks}, function(value, index){
|
||||
layer.prompt({
|
||||
title: '备注信息',
|
||||
formType: 2,
|
||||
value: res.data[0].order_remarks
|
||||
}, function (value, index) {
|
||||
layer.close(index);
|
||||
like.ajax({
|
||||
url: '{:url("order.order/remarks")}'
|
||||
@ -625,6 +648,33 @@
|
||||
|
||||
}
|
||||
|
||||
//允许售后
|
||||
if (obj.event === 'allow') {
|
||||
let msg = '是否开启售后?';
|
||||
if (obj.data.allow_after_sale == 1) {
|
||||
msg = '是否关闭售后'
|
||||
}
|
||||
layer.confirm(msg, function (index) {
|
||||
like.ajax({
|
||||
url: '{:url("order.order/allowAfterSale")}',
|
||||
data: {id: id, type: obj.data.allow_after_sale},
|
||||
type: "post",
|
||||
success: function (res) {
|
||||
if (res.code == 1) {
|
||||
layui.layer.msg(res.msg, {
|
||||
offset: '15px'
|
||||
, icon: 1
|
||||
, time: 1000
|
||||
});
|
||||
layer.close(index); //关闭弹层
|
||||
table.reload('order-lists');
|
||||
}
|
||||
}
|
||||
});
|
||||
layer.close(index);
|
||||
})
|
||||
}
|
||||
|
||||
//打印
|
||||
if (obj.event === 'print') {
|
||||
layer.confirm('确定要打印订单吗?', function (index) {
|
||||
@ -632,10 +682,8 @@
|
||||
url: '{:url("order.order/orderPrint")}',
|
||||
data: {id: id},
|
||||
type: "post",
|
||||
success:function(res)
|
||||
{
|
||||
if(res.code == 1)
|
||||
{
|
||||
success: function (res) {
|
||||
if (res.code == 1) {
|
||||
layui.layer.msg(res.msg, {
|
||||
offset: '15px'
|
||||
, icon: 1
|
||||
@ -647,10 +695,7 @@
|
||||
}
|
||||
});
|
||||
layer.close(index);
|
||||
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
if (obj.event === 'verification') {
|
||||
@ -701,7 +746,5 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user