作者 郭盛
1 个管道 的构建 通过 耗费 8 秒

编写后台订单管理,提现管理等等

正在显示 50 个修改的文件 包含 2229 行增加137 行删除
<?php
namespace app\admin\controller;
use app\common\controller\Backend;
/**
* 允许结算的最低金额
*
* @icon fa fa-circle-o
*/
class Allow extends Backend
{
/**
* Allow模型对象
* @var \app\admin\model\Allow
*/
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = new \app\admin\model\Allow;
}
/**
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
*/
}
... ...
<?php
namespace app\admin\controller;
use app\common\controller\Backend;
/**
* 佣金比例
*
* @icon fa fa-circle-o
*/
class Commission extends Backend
{
/**
* Commission模型对象
* @var \app\admin\model\Commission
*/
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = new \app\admin\model\Commission;
}
/**
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
*/
}
... ...
<?php
namespace app\admin\controller;
use app\common\controller\Backend;
use think\Db;
/**
* 订单管理
*
* @icon fa fa-circle-o
*/
class Order extends Backend
{
/**
* Order模型对象
* @var \app\admin\model\Order
*/
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = new \app\admin\model\Order;
}
/**
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
*/
/**
* 查看
*/
public function index()
{
//当前是否为关联查询
$this->relationSearch = true;
//设置过滤方法
$this->request->filter(['strip_tags', 'trim']);
if ($this->request->isAjax())
{
//如果发送的来源是Selectpage,则转发到Selectpage
if ($this->request->request('keyField'))
{
return $this->selectpage();
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$total = $this->model
->with(['user','teacher'])
->where($where)
->order($sort, $order)
->count();
$list = $this->model
->with(['user','teacher'])
->where($where)
->order($sort, $order)
->limit($offset, $limit)
->select();
foreach ($list as $row) {
$contype = Db::name('territory')
->alias('a')
->join('contype b','a.contype_id = b.id')
->where('a.id',$row['territory_id'])
->find();
if($contype['type'] == 1){
$type = '经营管理';
}else{
$type = '职业发展';
}
$row['territory_id'] = $type.':'.$contype['title'];
$row->getRelation('user')->visible(['nickname']);
$row->getRelation('teacher')->visible(['name','thumbnail']);
}
$list = collection($list)->toArray();
$result = array("total" => $total, "rows" => $list);
return json($result);
}
return $this->view->fetch();
}
/**
* 编辑
*/
public function edit($ids = null)
{
$row = $this->model->get($ids);
if (!$row) {
$this->error(__('No Results were found'));
}
$adminIds = $this->getDataLimitAdminIds();
if (is_array($adminIds)) {
if (!in_array($row[$this->dataLimitField], $adminIds)) {
$this->error(__('You have no permission'));
}
}
if ($this->request->isPost()) {
$params = $this->request->post("row/a");
if ($params) {
$params = $this->preExcludeFields($params);
$result = false;
if($params['order_status'] == 1){
//查出该项目老师设定的金额 以及该订单的佣金比例
$money = Db::name('order')
->alias('a')
->join('territory b','a.territory_id = b.id')
->field('a.teacher_id,a.commission,b.money')
->where('a.id',$ids)
->find();
//查出老师现在有的余额
$teacher = Db::name('teacher')
->where('id',$money['teacher_id'])
->field('id,balance')
->find();
$gold = $teacher['balance'] + ($money['money'] - $money['money'] * ($money['commission']/100));
Db::name('teacher')->where('id',$money['teacher_id'])->update(['balance'=>$gold]);
}
Db::startTrans();
try {
//是否采用模型验证
if ($this->modelValidate) {
$name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
$validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate;
$row->validateFailException(true)->validate($validate);
}
$result = $row->allowField(true)->save($params);
Db::commit();
} catch (ValidateException $e) {
Db::rollback();
$this->error($e->getMessage());
} catch (PDOException $e) {
Db::rollback();
$this->error($e->getMessage());
} catch (Exception $e) {
Db::rollback();
$this->error($e->getMessage());
}
if ($result !== false) {
$this->success();
} else {
$this->error(__('No rows were updated'));
}
}
$this->error(__('Parameter %s can not be empty', ''));
}
$this->view->assign("row", $row);
return $this->view->fetch();
}
//学生评价
public function detail($ids)
{
$data = Db::name('comment')
->alias('a')
->join('user b','a.user_id = b.id')
->where('a.order_id',$ids)
->field('a.*,b.nickname')
->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)
{
$data = Db::name('summarize')
->where('order_id',$ids)
->find();
$name = Db::name('order')
->alias('a')
->join('teacher b','a.teacher_id = b.id')
->where('a.id',$ids)
->field('b.name')
->find();
$data['teacher_name'] = $name['name'];
if(empty($data)){
$this->error('暂无总结');
}else{
$data['createtime'] = date('Y-m-d H:i:s',$data['createtime']);
$this->assign('data',$data);
return $this->view->fetch();
}
}
}
... ...
... ... @@ -103,8 +103,15 @@ class Teacher extends Backend
$params = $this->preExcludeFields($params);
$params['level'] = ($params['help_num'] * 5)/$params['help_num'];
if($params['is_recommend'] == 1){
$teacher_list = Db::name('teacher')
->where('status',1)
->where('is_recommend',1)
->count();
if($teacher_list >= 3){
$this->error('已有三个推荐老师,请重新选择');
}
}
$result = false;
Db::startTrans();
try {
... ...
<?php
namespace app\admin\controller;
use app\common\controller\Backend;
/**
* 新赠擅长领域
*
* @icon fa fa-circle-o
*/
class Territory extends Backend
{
/**
* Territory模型对象
* @var \app\admin\model\Territory
*/
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = new \app\admin\model\Territory;
}
/**
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
*/
/**
* 查看
*/
public function index()
{
//当前是否为关联查询
$this->relationSearch = true;
//设置过滤方法
$this->request->filter(['strip_tags', 'trim']);
if ($this->request->isAjax())
{
//如果发送的来源是Selectpage,则转发到Selectpage
if ($this->request->request('keyField'))
{
return $this->selectpage();
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$total = $this->model
->with(['contype','user','teacher'])
->where($where)
->order($sort, $order)
->count();
$list = $this->model
->with(['contype','user','teacher'])
->where($where)
->order($sort, $order)
->limit($offset, $limit)
->select();
foreach ($list as $row) {
$row->getRelation('contype')->visible(['title','type']);
$row->getRelation('user')->visible(['nickname']);
}
$list = collection($list)->toArray();
$result = array("total" => $total, "rows" => $list);
return json($result);
}
return $this->view->fetch();
}
}
... ...
<?php
namespace app\admin\controller;
use app\common\controller\Backend;
/**
* 提现管理
*
* @icon fa fa-circle-o
*/
class Withdraw extends Backend
{
/**
* Withdraw模型对象
* @var \app\admin\model\Withdraw
*/
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = new \app\admin\model\Withdraw;
}
/**
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
*/
/**
* 查看
*/
public function index()
{
//当前是否为关联查询
$this->relationSearch = true;
//设置过滤方法
$this->request->filter(['strip_tags', 'trim']);
if ($this->request->isAjax())
{
//如果发送的来源是Selectpage,则转发到Selectpage
if ($this->request->request('keyField'))
{
return $this->selectpage();
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$total = $this->model
->with(['teacher'])
->where($where)
->order($sort, $order)
->count();
$list = $this->model
->with(['teacher'])
->where($where)
->order($sort, $order)
->limit($offset, $limit)
->select();
foreach ($list as $row) {
$row->getRelation('teacher')->visible(['name']);
}
$list = collection($list)->toArray();
$result = array("total" => $total, "rows" => $list);
return json($result);
}
return $this->view->fetch();
}
}
... ...
<?php
return [
'Id' => 'ID',
'Money' => '结算金额',
'Createtime' => '创建时间',
'Updatetime' => '修改时间'
];
... ...
<?php
return [
'Id' => 'ID',
'Proportion' => '比例(单位%)',
'Createtime' => '创建时间',
'Updatetime' => '修改时间'
];
... ...
<?php
return [
'Id' => '订单ID',
'User_id' => '用户ID',
'Teacher_id' => '老师ID',
'Territory_id' => '购买咨询领域',
'Is_use' => '是否使用优惠劵',
'Money' => '金额',
'Status' => '支付状态',
'Num' => '订单号',
'Business' => '所属行业',
'Address' => '经营地区/职能类别',
'Product' => '产品/职位等级',
'Scale' => '公司规模/下属人数',
'Content' => '问题描述',
'Createtime' => '创建时间',
'Finish_status' => '订单完成状态',
'Order_status' =>'订单审核状态',
'Paytime' => '支付时间',
'Expirationtime' => '到期时间',
'User.nickname' => '用户昵称',
'Teacher.name' => '真实姓名',
'Teacher.thumbnail' => '头像'
];
... ...
... ... @@ -19,7 +19,7 @@ return [
'Online' => '在线时段',
'Status' => '状态',
'Is_recommend' =>'是否推荐',
'Territory_id' => '擅长领域ID',
'Territory_id' => '擅长领域',
'Help_num' => '帮助人数',
'Level' => '星级',
'Createtime' => '创建时间',
... ...
<?php
return [
'Id' => 'ID',
'User_id' => '用户ID',
'Teacher.name' =>'老师真实姓名',
'Teacher.thumbnail'=>'老师头像',
'Contype_id' => '咨询分类ID',
'Money' => '咨询价格',
'Content' => '领域优势',
'Createtime' => '创建时间',
'Updatetime' => '修改时间',
'Contype.title' => '标题',
'Contype.type' => '所属分类',
'User.nickname' => '昵称'
];
... ...
<?php
return [
'Id' => 'ID',
'User_id' => '用户ID',
'Teacher_id' => '老师ID',
'Money' => '提现金额',
'Status' => '状态',
'Card' => '卡号',
'Bank' => '开户行',
'Name' => '真实姓名',
'Phone' => '手机号',
'Createtime' => '创建时间',
'Updatetime' => '修改时间',
'Teacher.name' => '真实姓名'
];
... ...
<?php
namespace app\admin\model;
use think\Model;
class Allow extends Model
{
// 表名
protected $name = 'allow';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = false;
// 追加属性
protected $append = [
];
}
... ...
<?php
namespace app\admin\model;
use think\Model;
class Commission extends Model
{
// 表名
protected $name = 'commission';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = false;
// 追加属性
protected $append = [
];
}
... ...
<?php
namespace app\admin\model;
use think\Model;
class Order extends Model
{
// 表名
protected $name = 'order';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = false;
protected $deleteTime = false;
// 追加属性
protected $append = [
'paytime_text',
'expirationtime_text'
];
public function getPaytimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['paytime']) ? $data['paytime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getExpirationtimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['expirationtime']) ? $data['expirationtime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
protected function setPaytimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setExpirationtimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
public function user()
{
return $this->belongsTo('User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function teacher()
{
return $this->belongsTo('Teacher', 'teacher_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}
... ...
<?php
namespace app\admin\model;
use think\Model;
class Territory extends Model
{
// 表名
protected $name = 'territory';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = false;
// 追加属性
protected $append = [
];
public function contype()
{
return $this->belongsTo('Contype', 'contype_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function user()
{
return $this->belongsTo('User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function teacher()
{
return $this->belongsTo('Teacher', 'user_id', 'user_id', [], 'LEFT')->setEagerlyType(0);
}
}
... ...
<?php
namespace app\admin\model;
use think\Model;
class Withdraw extends Model
{
// 表名
protected $name = 'withdraw';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = false;
// 追加属性
protected $append = [
];
public function teacher()
{
return $this->belongsTo('Teacher', 'teacher_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}
... ...
<?php
namespace app\admin\validate;
use think\Validate;
class Allow extends Validate
{
/**
* 验证规则
*/
protected $rule = [
];
/**
* 提示消息
*/
protected $message = [
];
/**
* 验证场景
*/
protected $scene = [
'add' => [],
'edit' => [],
];
}
... ...
<?php
namespace app\admin\validate;
use think\Validate;
class Commission extends Validate
{
/**
* 验证规则
*/
protected $rule = [
];
/**
* 提示消息
*/
protected $message = [
];
/**
* 验证场景
*/
protected $scene = [
'add' => [],
'edit' => [],
];
}
... ...
<?php
namespace app\admin\validate;
use think\Validate;
class Order extends Validate
{
/**
* 验证规则
*/
protected $rule = [
];
/**
* 提示消息
*/
protected $message = [
];
/**
* 验证场景
*/
protected $scene = [
'add' => [],
'edit' => [],
];
}
... ...
<?php
namespace app\admin\validate;
use think\Validate;
class Territory extends Validate
{
/**
* 验证规则
*/
protected $rule = [
];
/**
* 提示消息
*/
protected $message = [
];
/**
* 验证场景
*/
protected $scene = [
'add' => [],
'edit' => [],
];
}
... ...
<?php
namespace app\admin\validate;
use think\Validate;
class Withdraw extends Validate
{
/**
* 验证规则
*/
protected $rule = [
];
/**
* 提示消息
*/
protected $message = [
];
/**
* 验证场景
*/
protected $scene = [
'add' => [],
'edit' => [],
];
}
... ...
<form id="add-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">{:__('Money')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-money" class="form-control" step="0.01" name="row[money]" type="number">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>
... ...
<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">{:__('Money')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-money" class="form-control" step="0.01" name="row[money]" type="number" value="{$row.money|htmlentities}">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>
... ...
<div class="panel panel-default panel-intro">
{:build_heading()}
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
<!--<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('allow/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>-->
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('allow/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
<!--<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('allow/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>-->
<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('allow/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>
<div class="dropdown btn-group {:$auth->check('allow/multi')?'':'hide'}">
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
<ul class="dropdown-menu text-left" role="menu">
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
</ul>
</div>
</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
data-operate-edit="{:$auth->check('allow/edit')}"
data-operate-del="{:$auth->check('allow/del')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>
... ...
<form id="add-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">{:__('Proportion')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-proportion" class="form-control" name="row[proportion]" type="number">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>
... ...
<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">{:__('Proportion')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-proportion" class="form-control" name="row[proportion]" type="number" value="{$row.proportion|htmlentities}">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>
... ...
<div class="panel panel-default panel-intro">
{:build_heading()}
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
<!--<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('commission/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>-->
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('commission/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
<!--<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('commission/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>-->
<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('commission/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>
<div class="dropdown btn-group {:$auth->check('commission/multi')?'':'hide'}">
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
<ul class="dropdown-menu text-left" role="menu">
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
</ul>
</div>
</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
data-operate-edit="{:$auth->check('commission/edit')}"
data-operate-del="{:$auth->check('commission/del')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>
... ...
<form id="add-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">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Teacher_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-teacher_id" data-rule="required" data-source="teacher/index" class="form-control selectpage" name="row[teacher_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Territory_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-territory_id" data-rule="required" data-source="territory/index" class="form-control selectpage" name="row[territory_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Is_use')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-is_use" class="form-control" name="row[is_use]" type="number" value="0">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Money')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-money" class="form-control" step="0.01" name="row[money]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-status" class="form-control" name="row[status]" type="number" value="1">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Num')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-num" class="form-control" name="row[num]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Business')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-business" class="form-control" name="row[business]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Address')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-address" class="form-control" name="row[address]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Product')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-product" class="form-control" name="row[product]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Scale')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-scale" class="form-control" name="row[scale]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-content" class="form-control" name="row[content]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Finish_status')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-finish_status" class="form-control" name="row[finish_status]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Paytime')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-paytime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[paytime]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Expirationtime')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-expirationtime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[expirationtime]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>
... ...
<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.nickname}
</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.service} 颗星
</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.ability} 颗星
</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.effect} 颗星
</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.level} 颗星
</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.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.desc}
</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.createtime}
</div>
</div>
</form>
... ...
<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">{:__('User_id')}:</label>-->
<!--<div class="col-xs-12 col-sm-8">-->
<!--<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-xs-12 col-sm-2">{:__('Teacher_id')}:</label>-->
<!--<div class="col-xs-12 col-sm-8">-->
<!--<input id="c-teacher_id" data-rule="required" data-source="teacher/index" class="form-control selectpage" name="row[teacher_id]" type="text" value="{$row.teacher_id|htmlentities}">-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-xs-12 col-sm-2">{:__('Territory_id')}:</label>-->
<!--<div class="col-xs-12 col-sm-8">-->
<!--<input id="c-territory_id" data-rule="required" data-source="territory/index" class="form-control selectpage" name="row[territory_id]" type="text" value="{$row.territory_id|htmlentities}">-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-xs-12 col-sm-2">{:__('Is_use')}:</label>-->
<!--<div class="col-xs-12 col-sm-8">-->
<!--<input id="c-is_use" class="form-control" name="row[is_use]" type="number" value="{$row.is_use|htmlentities}">-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-xs-12 col-sm-2">{:__('Money')}:</label>-->
<!--<div class="col-xs-12 col-sm-8">-->
<!--<input id="c-money" class="form-control" step="0.01" name="row[money]" type="number" value="{$row.money|htmlentities}">-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>-->
<!--<div class="col-xs-12 col-sm-8">-->
<!--<input id="c-status" class="form-control" name="row[status]" type="number" value="{$row.status|htmlentities}">-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-xs-12 col-sm-2">{:__('Num')}:</label>-->
<!--<div class="col-xs-12 col-sm-8">-->
<!--<input id="c-num" class="form-control" name="row[num]" type="text" value="{$row.num|htmlentities}">-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-xs-12 col-sm-2">{:__('Business')}:</label>-->
<!--<div class="col-xs-12 col-sm-8">-->
<!--<input id="c-business" class="form-control" name="row[business]" type="text" value="{$row.business|htmlentities}">-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-xs-12 col-sm-2">{:__('Address')}:</label>-->
<!--<div class="col-xs-12 col-sm-8">-->
<!--<input id="c-address" class="form-control" name="row[address]" type="text" value="{$row.address|htmlentities}">-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-xs-12 col-sm-2">{:__('Product')}:</label>-->
<!--<div class="col-xs-12 col-sm-8">-->
<!--<input id="c-product" class="form-control" name="row[product]" type="text" value="{$row.product|htmlentities}">-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-xs-12 col-sm-2">{:__('Scale')}:</label>-->
<!--<div class="col-xs-12 col-sm-8">-->
<!--<input id="c-scale" class="form-control" name="row[scale]" type="text" value="{$row.scale|htmlentities}">-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>-->
<!--<div class="col-xs-12 col-sm-8">-->
<!--<input id="c-content" class="form-control" name="row[content]" type="text" value="{$row.content|htmlentities}">-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-xs-12 col-sm-2">{:__('Finish_status')}:</label>-->
<!--<div class="col-xs-12 col-sm-8">-->
<!--<input id="c-finish_status" class="form-control" name="row[finish_status]" type="number" value="{$row.finish_status|htmlentities}">-->
<!--</div>-->
<!--</div>-->
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Order_status')}:</label>
<div class="col-xs-12 col-sm-8">
{:build_radios('row[order_status]', ['1'=>__('通过'),'2'=>__('未通过')], $row['order_status'])}
</div>
</div>
<!--<div class="form-group">-->
<!--<label class="control-label col-xs-12 col-sm-2">{:__('Paytime')}:</label>-->
<!--<div class="col-xs-12 col-sm-8">-->
<!--<input id="c-paytime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[paytime]" type="text" value="{:$row.paytime?datetime($row.paytime):''}">-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-xs-12 col-sm-2">{:__('Expirationtime')}:</label>-->
<!--<div class="col-xs-12 col-sm-8">-->
<!--<input id="c-expirationtime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[expirationtime]" type="text" value="{:$row.expirationtime?datetime($row.expirationtime):''}">-->
<!--</div>-->
<!--</div>-->
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>
... ...
<div class="panel panel-default panel-intro">
{:build_heading()}
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
<!--<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('order/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>-->
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('order/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('order/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('order/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>
<div class="dropdown btn-group {:$auth->check('order/multi')?'':'hide'}">
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
<ul class="dropdown-menu text-left" role="menu">
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
</ul>
</div>
</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
data-operate-edit="{:$auth->check('order/edit')}"
data-operate-del="{:$auth->check('order/del')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>
... ...
<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.teacher_name}
</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.background}
</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.questions}
</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.Research}
</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.analyze}
</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.conclusion}
</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.plana}
</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.planb}
</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.planc}
</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.createtime}
</div>
</div>
</form>
... ...
<form id="add-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">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Contype_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-contype_id" data-rule="required" data-source="contype/index" class="form-control selectpage" name="row[contype_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Money')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-money" class="form-control" name="row[money]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-content" class="form-control" name="row[content]" type="text">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>
... ...
<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">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Contype_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-contype_id" data-rule="required" data-source="contype/index" class="form-control selectpage" name="row[contype_id]" type="text" value="{$row.contype_id|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Money')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-money" class="form-control" name="row[money]" type="text" value="{$row.money|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-content" class="form-control" name="row[content]" type="text" value="{$row.content|htmlentities}">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>
... ...
<div class="panel panel-default panel-intro">
{:build_heading()}
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
<!--<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('territory/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>-->
<!--<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('territory/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>-->
<!--<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('territory/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>-->
<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('territory/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>
<div class="dropdown btn-group {:$auth->check('territory/multi')?'':'hide'}">
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
<ul class="dropdown-menu text-left" role="menu">
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
</ul>
</div>
</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
data-operate-edit="{:$auth->check('territory/edit')}"
data-operate-del="{:$auth->check('territory/del')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>
... ...
<form id="add-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">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Teacher_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-teacher_id" data-rule="required" data-source="teacher/index" class="form-control selectpage" name="row[teacher_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Money')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-money" class="form-control" step="0.01" name="row[money]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-status" class="form-control" name="row[status]" type="number" value="0">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Card')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-card" class="form-control" name="row[card]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Bank')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-bank" class="form-control" name="row[bank]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-name" class="form-control" name="row[name]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Phone')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-phone" class="form-control" name="row[phone]" type="text">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>
... ...
<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">{:__('User_id')}:</label>-->
<!--<div class="col-xs-12 col-sm-8">-->
<!--<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-xs-12 col-sm-2">{:__('Teacher_id')}:</label>-->
<!--<div class="col-xs-12 col-sm-8">-->
<!--<input id="c-teacher_id" data-rule="required" data-source="teacher/index" class="form-control selectpage" name="row[teacher_id]" type="text" value="{$row.teacher_id|htmlentities}">-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-xs-12 col-sm-2">{:__('Money')}:</label>-->
<!--<div class="col-xs-12 col-sm-8">-->
<!--<input id="c-money" class="form-control" step="0.01" name="row[money]" type="number" value="{$row.money|htmlentities}">-->
<!--</div>-->
<!--</div>-->
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
{:build_radios('row[status]', ['0'=>__('未处理'),'1'=>__('已处理')], $row['status'])}
</div>
</div>
<!--<div class="form-group">-->
<!--<label class="control-label col-xs-12 col-sm-2">{:__('Card')}:</label>-->
<!--<div class="col-xs-12 col-sm-8">-->
<!--<input id="c-card" class="form-control" name="row[card]" type="text" value="{$row.card|htmlentities}">-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-xs-12 col-sm-2">{:__('Bank')}:</label>-->
<!--<div class="col-xs-12 col-sm-8">-->
<!--<input id="c-bank" class="form-control" name="row[bank]" type="text" value="{$row.bank|htmlentities}">-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>-->
<!--<div class="col-xs-12 col-sm-8">-->
<!--<input id="c-name" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-xs-12 col-sm-2">{:__('Phone')}:</label>-->
<!--<div class="col-xs-12 col-sm-8">-->
<!--<input id="c-phone" class="form-control" name="row[phone]" type="text" value="{$row.phone|htmlentities}">-->
<!--</div>-->
<!--</div>-->
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>
... ...
<div class="panel panel-default panel-intro">
{:build_heading()}
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
<!--<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('withdraw/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>-->
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('withdraw/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
<!--<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('withdraw/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>-->
<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('withdraw/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>
<div class="dropdown btn-group {:$auth->check('withdraw/multi')?'':'hide'}">
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
<ul class="dropdown-menu text-left" role="menu">
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
</ul>
</div>
</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
data-operate-edit="{:$auth->check('withdraw/edit')}"
data-operate-del="{:$auth->check('withdraw/del')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>
... ...
<?php
namespace app\api\controller;
use app\common\controller\Api;
use app\common\library\Ems as Emslib;
use app\common\model\User;
/**
* 邮箱验证码接口
*/
class Ems extends Api
{
protected $noNeedLogin = '*';
protected $noNeedRight = '*';
public function _initialize()
{
parent::_initialize();
\think\Hook::add('ems_send', function ($params) {
$obj = \app\common\library\Email::instance();
$result = $obj
->to($params->email)
->subject('验证码')
->message("你的验证码是:" . $params->code)
->send();
return $result;
});
}
/**
* 发送验证码
*
* @param string $email 邮箱
* @param string $event 事件名称
*/
public function send()
{
$email = $this->request->request("email");
$event = $this->request->request("event");
$event = $event ? $event : 'register';
$last = Emslib::get($email, $event);
if ($last && time() - $last['createtime'] < 60) {
$this->error(__('发送频繁'));
}
if ($event) {
$userinfo = User::getByEmail($email);
if ($event == 'register' && $userinfo) {
//已被注册
$this->error(__('已被注册'));
} elseif (in_array($event, ['changeemail']) && $userinfo) {
//被占用
$this->error(__('已被占用'));
} elseif (in_array($event, ['changepwd', 'resetpwd']) && !$userinfo) {
//未注册
$this->error(__('未注册'));
}
}
$ret = Emslib::send($email, null, $event);
if ($ret) {
$this->success(__('发送成功'));
} else {
$this->error(__('发送失败'));
}
}
/**
* 检测验证码
*
* @param string $email 邮箱
* @param string $event 事件名称
* @param string $captcha 验证码
*/
public function check()
{
$email = $this->request->request("email");
$event = $this->request->request("event");
$event = $event ? $event : 'register';
$captcha = $this->request->request("captcha");
if ($event) {
$userinfo = User::getByEmail($email);
if ($event == 'register' && $userinfo) {
//已被注册
$this->error(__('已被注册'));
} elseif (in_array($event, ['changeemail']) && $userinfo) {
//被占用
$this->error(__('已被占用'));
} elseif (in_array($event, ['changepwd', 'resetpwd']) && !$userinfo) {
//未注册
$this->error(__('未注册'));
}
}
$ret = Emslib::check($email, $captcha, $event);
if ($ret) {
$this->success(__('成功'));
} else {
$this->error(__('验证码不正确'));
}
}
}
... ... @@ -62,6 +62,10 @@ class Order extends Api
if (!$validate->check($param)) {
$this->error($validate->getError());
}
$yong = Db::name('commission')
->where('id',1)
->find();
$param['commission'] = $yong['proportion'];
$param['createtime'] = time();
$param['num'] = get_order_sn();
$data = Db::name('order')->insertGetId($param);
... ... @@ -100,8 +104,8 @@ class Order extends Api
}
/**
* @ApiTitle (我的订单列表)
* @ApiSummary (我的订单列表)
* @ApiTitle (学生身份我的订单列表)
* @ApiSummary (学生身份订单列表)
* @ApiMethod (POST)
* @ApiRoute (/api/order/orderList)
*
... ... @@ -122,6 +126,9 @@ class Order extends Api
"name"://老师名称
"thumbnail"://头像
"finish_status"://完成状态(1进行中2已完成3售后)
"is_summarize"://是否总结过(1是2否)
"is_complaint"://是否被投诉(1是2否3已处理)
"is_comment"://是否评价过(1是2否)
}
})
*/
... ... @@ -157,50 +164,174 @@ class Order extends Api
$this->error('类型有误');
}
foreach ($data as &$v){
$is_have = Db::name('comment')
->where('order_id',$v['id'])
->find();
if(empty($is_have)){
$v['is_comment'] = 2;
}else{
$v['is_comment'] = 1;
}
$v['expirationtime'] = date('Y-m-d H:i',$v['expirationtime']);
}
$this->success('success',$data);
}
/**
* @ApiTitle (投诉详情)
* @ApiSummary (投诉详情)
* @ApiTitle (老师身份我的订单列表)
* @ApiSummary (老师身份订单列表)
* @ApiMethod (POST)
* @ApiRoute (/api/order/detail)
* @ApiRoute (/api/order/teacherorder)
*
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
*
* @ApiParams (name="order_id", type="int", required=true, description="订单ID")
* @ApiParams (name="type", type="int", required=false, description="类型(如果为空或者为1是进行中2待总结3是结算中4已完成5退款/投诉)")
*
* @ApiReturn({
"code": 1,
"msg": "成功",
"time": "1571492001",
"data": {
"id": //投诉id,
"user_id"://用户ID
"id": //订单id,
"num"://订单号,
"content"://问题描述
"expirationtime"://到期时间
"teacher_id"://老师ID
"order_id"://订单ID
"wxnum"://微信号
"createtime"://创建时间
"content"://投诉理由
"phone"://手机号
"name"://老师名称
"thumbnail"://头像
"finish_status"://完成状态(1进行中2已完成3售后)
"is_summarize"://是否总结过(1是2否)
"is_complaint"://是否被投诉(1是2否3已处理)
"is_comment"://是否评价过(1是2否)
}
})
*/
public function detail()
*/
public function teacherorder()
{
$user_id = $this->getUserId();
$order_id = $this->request->param('order_id');
if(empty($order_id)){
$this->error('缺少必要参数');
$type = $this->request->param('type');
if($type == '' || $type == 1){
$data = Db::name('order')
->alias('a')
->join('teacher b','a.teacher_id = b.id')
->where('a.user_id',$user_id)
->where('a.finish_status',1)
->field('a.*,b.name,b.thumbnail')
->select();
}elseif ($type == 2){
$data = Db::name('order')
->alias('a')
->join('teacher b','a.teacher_id = b.id')
->where('a.finish_status',2)
->where('a.is_summarize',2)
->where('a.user_id',$user_id)
->field('a.*,b.name,b.thumbnail')
->select();
}elseif ($type == 3){
$data = Db::name('order')
->alias('a')
->join('teacher b','a.teacher_id = b.id')
->where('a.finish_status',2)
->where('a.is_summarize',1)
->where('a.user_id',$user_id)
->field('a.*,b.name,b.thumbnail')
->select();
}elseif ($type == 4){
$data = Db::name('order')
->alias('a')
->join('teacher b','a.teacher_id = b.id')
->where('a.finish_status',2)
->where('a.order_status',1)
->where('a.user_id',$user_id)
->field('a.*,b.name,b.thumbnail')
->select();
}elseif ($type == 5 ){
$data = Db::name('order')
->alias('a')
->join('teacher b','a.teacher_id = b.id')
->where('a.finish_status',3)
->where('a.user_id',$user_id)
->field('a.*,b.name,b.thumbnail')
->select();
}else{
$this->error('类型有误');
}
foreach ($data as &$v){
$is_have = Db::name('comment')
->where('order_id',$v['id'])
->find();
if(empty($is_have)){
$v['is_comment'] = 2;
}else{
$v['is_comment'] = 1;
}
$v['expirationtime'] = date('Y-m-d H:i',$v['expirationtime']);
}
$data = Db::name('complaint')
->where('order_id',$order_id)
->where('user_id',$user_id)
->find();
$this->success('success',$data);
}
/**
* @ApiTitle (提现)
* @ApiSummary (提现)
* @ApiMethod (POST)
* @ApiRoute (/api/order/withdraw)
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
*
* @ApiParams (name="teacher_id", type="int", required=true, description="老师ID")
* @ApiParams (name="money", type="int", required=true, description="提现金额")
* @ApiParams (name="card", type="string", required=true, description="卡号")
* @ApiParams (name="bank", type="string", required=true, description="开户行")
* @ApiParams (name="name", type="string", required=true, description="真实姓名")
* @ApiParams (name="phone", type="string", required=true, description="手机号")
* @ApiReturn({
"code": 1,
"msg": "SUCCESS",
"time": "1553839125",
"data": {
"id"://id
}
})
*/
public function withdraw()
{
$param = $this->request->param();
$param['user_id'] = $this->getUserId();
$validate = new Validate([
'teacher_id' => 'require',
'money'=>'require',
'card' => 'require',
'bank' => 'require',
'name' => 'require',
'phone'=>'require',
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
//查询提现金额是否满足后台设置允许提现额度
$money = Db::name('allow')
->where('id',1)
->find();
//查询老师余额是否跟提现的金额匹配
$teacher = Db::name('teacher')
->where('id',$param['teacher_id'])
->field('id,balance')
->find();
if($param['money'] < $money['money'] || $param['money'] > $teacher['balance']){
$this->error('提现金额有误,请重新选择');
}
$param['createtime'] = time();
Db::startTrans();
$data = Db::name('withdraw')
->insertGetId($param);
//提现成功将对应的老师余额修改
$res = Db::name('teacher')->where('id',$param['teacher_id'])->update(['balance'=>$teacher['balance']-$param['money']]);
if($data && $res){
Db::commit();
$this->success('成功');
}else{
Db::rollback();
$this->error('失败');
}
}
}
\ No newline at end of file
... ...
... ... @@ -266,7 +266,7 @@ class Teacher extends Api
* @ApiRoute (/api/teacher/comment)
*
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
* @ApiParams (name="teacher_id", type="int", required=true, description="老师ID")
* @ApiParams (name="order_id", type="int", required=true, description="订单ID")
* @ApiParams (name="service", type="int", required=true, description="服务态度评分")
* @ApiParams (name="ability", type="int", required=true, description="专业能力评分")
* @ApiParams (name="effect", type="int", required=true, description="解决效果评分")
... ... @@ -287,7 +287,7 @@ class Teacher extends Api
$param = $this->request->param();
$param['user_id'] = $this->getUserId();
$validate = new Validate([
'teacher_id' => 'require',
'order_id' => 'require',
'service' => 'require',
'ability'=>'require',
'effect'=>'require',
... ... @@ -300,9 +300,6 @@ class Teacher extends Api
$param['createtime'] = time();
$data = Db::name('comment')
->insertGetId($param);
// $teacher = Db::name('teacher')->where('id',$param['teacher_id'])->find();
// Db::name('teacher')->where('id',$param['teacher_id'])
if(empty($data)){
$this->error('失败');
}else{
... ... @@ -351,10 +348,109 @@ class Teacher extends Api
if(empty($data)){
$this->error('失败');
}else{
Db::name('order')
->where('id',$param['order_id'])
->update(['is_complaint'=>1,'finish_status'=>3]);
$this->success('投诉成功',['id'=>$data]);
}
}
/**
* @ApiTitle (投诉详情)
* @ApiSummary (投诉详情)
* @ApiMethod (POST)
* @ApiRoute (/api/teacher/detail)
*
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
*
* @ApiParams (name="order_id", type="int", required=true, description="订单ID")
*
* @ApiReturn({
"code": 1,
"msg": "成功",
"time": "1571492001",
"data": {
"id": //投诉id,
"user_id"://用户ID
"teacher_id"://老师ID
"order_id"://订单ID
"wxnum"://微信号
"createtime"://创建时间
"content"://投诉理由
"phone"://手机号
}
})
*/
public function detail()
{
$user_id = $this->getUserId();
$order_id = $this->request->param('order_id');
if(empty($order_id)){
$this->error('缺少必要参数');
}
$data = Db::name('complaint')
->where('order_id',$order_id)
->where('user_id',$user_id)
->find();
$this->success('success',$data);
}
/**
* @ApiTitle (老师总结)
* @ApiSummary (老师总结)
* @ApiMethod (POST)
* @ApiRoute (/api/teacher/summarize)
*
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
*
* @ApiParams (name="order_id", type="int", required=true, description="订单ID")
* @ApiParams (name="background", type="string", required=true, description="背景")
* @ApiParams (name="questions", type="string", required=false, description="问题")
* @ApiParams (name="Research", type="string", required=true, description="调研")
* @ApiParams (name="analyze", type="string", required=true, description="分析")
* @ApiParams (name="conclusion", type="string", required=true, description="结论")
* @ApiParams (name="plana", type="string", required=true, description="方案一")
* @ApiParams (name="planb", type="string", required=true, description="方案二")
* @ApiParams (name="planc", type="string", required=false, description="方案三")
*
* @ApiReturn({
"code": 1,
"msg": "成功",
"time": "1571492001",
"data": {
'id'://总结ID
}
})
*/
public function summarize()
{
$param = $this->request->param();
// $param['user_id'] = $this->getUserId();
$validate = new Validate([
'order_id'=>'require',
'background' => 'require',
'questions' => 'require',
'Research' => 'require',
'analyze'=>'require',
'conclusion'=>'require',
'plana'=>'require',
'planb'=>'require'
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
$param['createtime'] = time();
$data = Db::name('summarize')->insertGetId($param);
if(empty($data)){
$this->error('失败');
}else{
Db::name('order')->where('id',$param['order_id'])->update(['is_summarize'=>1]);
$this->success('success',['id'=>$data]);
}
}
}
\ No newline at end of file
... ...
... ... @@ -254,9 +254,28 @@ class User extends Api
$this->success('SUCCESS',$data);
}
public function member(){
$this->success('SUCCESS',$this->user);
/**
* @ApiTitle (判断用户身份)
* @ApiSummary (判断用户身份)
* @ApiMethod (POST)
* @ApiRoute (/api/user/judge)
*
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
*
* @ApiReturn({
"identity"://身份(1学生2老师)
*/
public function judge()
{
$user_id = $this->getUserId();
$data = Db::name('teacher')
->where('user_id',$user_id)
->find();
if(empty($data)){
$res['identity'] = 1;
}else{
$res['identity'] = 2;
}
$this->success('success',$res);
}
}
... ...
此 diff 太大无法显示。
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'allow/index' + location.search,
add_url: 'allow/add',
edit_url: 'allow/edit',
del_url: 'allow/del',
multi_url: 'allow/multi',
table: 'allow',
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'id',
columns: [
[
{checkbox: true},
{field: 'id', title: __('Id')},
{field: 'money', title: __('Money'), operate:'BETWEEN'},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: function (value, row, index) {
var that = $.extend({}, this);
var table = $(that.table).clone(true);
$(table).data("operate-del", null);
that.table = table;
return Table.api.formatter.operate.call(that, value, row, index);
}}
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},
add: function () {
Controller.api.bindevent();
},
edit: function () {
Controller.api.bindevent();
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
}
}
};
return Controller;
});
\ No newline at end of file
... ...
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'commission/index' + location.search,
add_url: 'commission/add',
edit_url: 'commission/edit',
del_url: 'commission/del',
multi_url: 'commission/multi',
table: 'commission',
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'id',
columns: [
[
{checkbox: true},
{field: 'id', title: __('Id')},
{field: 'proportion', title: __('Proportion')},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: function (value, row, index) {
var that = $.extend({}, this);
var table = $(that.table).clone(true);
$(table).data("operate-del", null);
that.table = table;
return Table.api.formatter.operate.call(that, value, row, index);
}}
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},
add: function () {
Controller.api.bindevent();
},
edit: function () {
Controller.api.bindevent();
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
}
}
};
return Controller;
});
\ No newline at end of file
... ...
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'order/index' + location.search,
add_url: 'order/add',
edit_url: 'order/edit',
del_url: 'order/del',
multi_url: 'order/multi',
table: 'order',
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'id',
columns: [
[
{checkbox: true},
{field: 'id', title: __('Id'), operate:false},
{field: 'user.nickname', title: __('User.nickname'), operate:false},
{field: 'teacher.name', title: __('Teacher.name'), operate:false},
{field: 'teacher.thumbnail', title: __('Teacher.thumbnail'), operate:false, events: Table.api.events.image, formatter: Table.api.formatter.image},
{field: 'territory_id', title: __('Territory_id'), operate:false},
{field: 'is_use', title: __('Is_use'), operate:false,formatter: Table.api.formatter.label,searchList:{'0': '不使用','1':'使用'}},
{field: 'money', title: __('Money'), operate:'BETWEEN'},
{field: 'status', title: __('Status'),formatter: Table.api.formatter.status,custom: {2:'success', 1:'error'},searchList:{'1': '待支付','2':'已支付'}},
{field: 'num', title: __('Num'), operate:false},
{field: 'business', title: __('Business'), operate:false},
{field: 'address', title: __('Address'), operate:false},
{field: 'product', title: __('Product'), operate:false},
{field: 'scale', title: __('Scale'), operate:false},
{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: '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/detail',
extend: 'data-area=\'["80%","80%"]\'',
},
{
text: '老师总结',
title: '老师总结详情',
icon: 'fa fa-list',
classname: 'btn btn-xs btn-primary btn-dialog',
url: 'order/summary',
extend: 'data-area=\'["80%","80%"]\'',
}
], 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},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},
add: function () {
Controller.api.bindevent();
},
edit: function () {
Controller.api.bindevent();
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
}
}
};
return Controller;
});
\ No newline at end of file
... ...
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'territory/index' + location.search,
add_url: 'territory/add',
edit_url: 'territory/edit',
del_url: 'territory/del',
multi_url: 'territory/multi',
table: 'territory',
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'id',
columns: [
[
{checkbox: true},
{field: 'id', title: __('Id')},
{field: 'user.nickname', title: __('User.nickname')},
{field: 'teacher.name', title: __('Teacher.name')},
{field: 'teacher.thumbnail', title: __('Teacher.thumbnail'), operate:false, events: Table.api.events.image, formatter: Table.api.formatter.image},
{field: 'contype.title', title: __('Contype.title')},
{field: 'money', title: __('Money')},
{field: 'content', title: __('Content')},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'contype.type', title: __('Contype.type'),formatter: Table.api.formatter.label,searchList:{'1': '经营管理','2':'职业发展'}},
// {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},
add: function () {
Controller.api.bindevent();
},
edit: function () {
Controller.api.bindevent();
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
}
}
};
return Controller;
});
\ No newline at end of file
... ...
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'withdraw/index' + location.search,
add_url: 'withdraw/add',
edit_url: 'withdraw/edit',
del_url: 'withdraw/del',
multi_url: 'withdraw/multi',
table: 'withdraw',
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'id',
columns: [
[
{checkbox: true},
{field: 'id', title: __('Id'), operate:false},
{field: 'user_id', title: __('User_id'), operate:false},
{field: 'teacher.name', title: __('Teacher.name'), operate:false},
{field: 'money', title: __('Money'), operate:'BETWEEN'},
{field: 'status', title: __('Status'),formatter: Table.api.formatter.status,custom: {1:'success', 0:'error'},searchList:{'0': '未处理','1':'已处理'}},
{field: 'card', title: __('Card'), operate:false},
{field: 'bank', title: __('Bank'), operate:false},
{field: 'name', title: __('Name'), operate:false},
{field: 'phone', title: __('Phone'), operate:false},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},
add: function () {
Controller.api.bindevent();
},
edit: function () {
Controller.api.bindevent();
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
}
}
};
return Controller;
});
\ No newline at end of file
... ...