作者 Cool
1 个管道 的构建 通过 耗费 1 秒

Merge remote-tracking branch 'origin/master'

... ... @@ -186,6 +186,21 @@ class Order extends Backend
}
//投诉详情
public function complaint($ids)
{
$data = Db::name('complaint')
->where('order_id',$ids)
->find();
if(empty($data)){
$this->error('暂无评价','index');
}else{
$data['createtime'] = date('Y-m-d H:i:s',$data['createtime']);
$this->assign('data',$data);
return $this->view->fetch();
}
}
//老师总结、
public function summary($ids)
{
... ...
... ... @@ -16,6 +16,7 @@ return [
'Content' => '问题描述',
'Createtime' => '创建时间',
'Finish_status' => '订单完成状态',
'is_complaint' => '是否投诉',
'Order_status' =>'订单审核状态',
'Paytime' => '支付时间',
'Expirationtime' => '到期时间',
... ...
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">投诉理由:</label>
<div class="col-xs-12 col-sm-8">
{$data.content}
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">手机号:</label>
<div class="col-xs-12 col-sm-8">
{$data.phone}
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">微信号:</label>
<div class="col-xs-12 col-sm-8">
{$data.wxnum}
</div>
</div>
</form>
... ...
... ... @@ -86,31 +86,31 @@ class Coupon extends Api
*
*
* @ApiReturn({
"code": 1,
"msg": "成功",
"time": "1571492001",
"data": {
"attention_id"://关注ID
"id": //老师id,
"user_id"://老师的用户ID
"name"://老师名字
"sex"://性别
"birth"://出生日期
"idcard"://身份证号
"before"://身份证正面照
"behind"://身份证反面照
"phone"://手机号
"thumbnail"://头像
"address"://常住地
"honor"://头衔
"content"://个人履历
"show"://展示在最前
"desc"://个人简历
"online"://在线时段
"territory_id"://擅长领域ID
"help_num"://帮助人数
"level"://星级
"createtime"://创建时间
"code": 1,
"msg": "成功",
"time": "1571492001",
"data": {
"attention_id"://关注ID
"id": //老师id,
"user_id"://老师的用户ID
"name"://老师名字
"sex"://性别
"birth"://出生日期
"idcard"://身份证号
"before"://身份证正面照
"behind"://身份证反面照
"phone"://手机号
"thumbnail"://头像
"address"://常住地
"honor"://头衔
"content"://个人履历
"show"://展示在最前
"desc"://个人简历
"online"://在线时段
"territory_id"://擅长领域ID
"help_num"://帮助人数
"level"://星级
"createtime"://创建时间
}
})
*/
... ... @@ -156,11 +156,13 @@ class Coupon extends Api
$v['thumbnail'] = $http.$v['thumbnail'];
$v['territory_id'] = explode(',',$v['territory_id']);
foreach ($v['territory_id'] as &$val){
$val = Db::name('territory')
$a = Db::name('territory')
->alias('a')
->join('contype b','a.contype_id = b.id')
->where('a.id',$val)
->column('b.title');
->field('b.title')
->find();
$val = $a['title'];
}
}
$this->success('success',$data);
... ...
... ... @@ -451,6 +451,59 @@ class Order extends Api
}
/**
* @ApiTitle (学生身份全部订单列表)
* @ApiSummary (学生身份订单列表)
* @ApiMethod (POST)
* @ApiRoute (/api/order/quan)
*
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
*
*
* @ApiReturn({
"code": 1,
"msg": "成功",
"time": "1571492001",
"data": {
"id": //订单id,
"num"://订单号,
"content"://问题描述
"expirationtime"://到期时间
"teacher_id"://老师ID
"name"://老师名称
"thumbnail"://头像
"finish_status"://完成状态(1进行中2已完成3售后
"is_summarize"://是否总结过(1是2否
"is_complaint"://是否被投诉(1是2否3已处理
"is_comment"://是否评价过(1是2否
"right_status"://学生售后订单中的状态(1已处理2未处理
"chat_id"://房间id
"user"用户:{
"id"://融云id
"token"://融云token
},
"teacher"老师:{
"id"://融云id
"token"://融云token
}
}
})
*/
public function quan(){
$user_id = $this->getUserId();
$data = Db::name('order')
->alias('a')
->join('teacher b','a.teacher_id = b.id')
->where('a.user_id',$user_id)
->field('a.*,b.name,b.thumbnail')
->order('id desc')
->select();
if(empty($data)){
$this->error('暂无数据');
}
$this->success('success',$data);
}
/**
* @ApiTitle (查看总结)
* @ApiSummary (查看总结)
* @ApiMethod (POST)
... ...
... ... @@ -508,13 +508,38 @@ class Teacher extends Api
if(empty($id)){
$this->error('缺少必要参数');
}
$data = Db::name('territory')
$res = Db::name('territory')
->where('id',$id)
->delete();
if(empty($data)){
$this->error('sql运行失败');
->find();
if($res['is_check'] == 1){
$data = Db::name('teacher')->where('user_id',$user_id)->find();
$territory_id = explode(',',$data['territory_id']);
foreach ($territory_id as $k =>$v){
if($v == $id){
unset($territory_id[$k]);
}
}
$upd_territory = implode(',',$territory_id);
$upd_teacher = Db::name('teacher')
->where('user_id',$user_id)
->update(['territory_id'=>$upd_territory]);
$data = Db::name('territory')
->where('id',$id)
->delete();
if(empty($upd_teacher) && empty($data)){
$this->error('sql运行失败');
}else{
$this->success('success');
}
}else{
$this->success('success');
$data = Db::name('territory')
->where('id',$id)
->delete();
if(empty($data)){
$this->error('sql运行失败');
}else{
$this->success('success');
}
}
}
... ...
... ... @@ -362,6 +362,43 @@ class User extends Api
$this->success('success',$data);
}
/**
* @ApiTitle (用户订单数量)
* @ApiSummary (用户订单数量)
* @ApiMethod (POST)
* @ApiRoute (/api/user/count)
*
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
*
* @ApiReturn({
"code": 1,
"msg": "成功",
"time": "1571492001",
"data": {
"underway"://进行中的订单数
"finish"://已完成的订单数
"after"://售后的订单数
}
})
*/
public function count()
{
$user_id = $this->userId;
$data['underway'] = Db::name('order')
->where('user_id',$user_id)
->where('finish_status',1)
->count();
$data['finish'] = Db::name('order')
->where('user_id',$user_id)
->where('finish_status',2)
->count();
$data['after'] = Db::name('order')
->where('user_id',$user_id)
->where('finish_status',3)
->count();
$this->success('success',$data);
}
/**
... ...
此 diff 太大无法显示。
... ... @@ -40,9 +40,24 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'content', title: __('Content'), operate:false},
{field: 'commission', title: __('佣金比例(单位%)'), operate:false},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'finish_status', title: __('Finish_status'),formatter: Table.api.formatter.label,searchList:{'1': '进行中','2':'已完成','3':'售后'}},
{field: 'is_complaint', title: __('Is_complaint'),formatter: Table.api.formatter.label,searchList:{'1': '是','2':'否','3':'已处理'}},
{field: 'id', title: __('按钮组'), table: table, events: Table.api.events.operate, buttons:
[
{
text: '投诉详情',
title: '投诉详情',
icon: 'fa fa-list',
classname: 'btn btn-xs btn-primary btn-dialog',
url: 'order/complaint',
// extend: 'data-area=\'["80%","80%"]\'',
hidden:function(row){
if(row.is_complaint != 1){
return true;
}
},
},
{
text: '聊天记录',
title: '聊天记录',
icon: 'fa fa-list',
... ... @@ -81,7 +96,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
}
], operate:false, formatter: Table.api.formatter.buttons
},
{field: 'finish_status', title: __('Finish_status'),formatter: Table.api.formatter.label,searchList:{'1': '进行中','2':'已完成','3':'售后'}},
{field: 'order_status', title: __('Order_status'),formatter: Table.api.formatter.label,searchList:{'1': '通过','2':'未通过'}},
{field: 'paytime', title: __('Paytime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'expirationtime', title: __('Expirationtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
... ...