|
@@ -12,7 +12,7 @@ use app\common\library\Email;
|
|
*/
|
|
*/
|
|
class Lessonslot extends Backend
|
|
class Lessonslot extends Backend
|
|
{
|
|
{
|
|
- protected $noNeedLogin = ['vue_index','vue_staff','slot_add','slot_info','slot_edit'];
|
|
|
|
|
|
+ protected $noNeedLogin = ['vue_index','vue_staff','slot_add','slot_info','slot_edit','cancel'];
|
|
|
|
|
|
/**
|
|
/**
|
|
* Lessonslot模型对象
|
|
* Lessonslot模型对象
|
|
@@ -79,15 +79,18 @@ class Lessonslot extends Backend
|
|
*/
|
|
*/
|
|
public function cancel(){
|
|
public function cancel(){
|
|
$id = input('id');
|
|
$id = input('id');
|
|
- $info = Db::name('lesson_slot')->where('id',$id)->where('status',0)->find();
|
|
|
|
|
|
+ $info = Db::name('lesson_slot')->where('id',$id)->find();
|
|
if(!$info){
|
|
if(!$info){
|
|
$this->error('请刷新重试');
|
|
$this->error('请刷新重试');
|
|
}
|
|
}
|
|
|
|
+ if($info['status'] != 0){
|
|
|
|
+ $this->error('当前订单不能取消');
|
|
|
|
+ }
|
|
|
|
|
|
if($this->request->isPost()){
|
|
if($this->request->isPost()){
|
|
$remark = input('remark','');
|
|
$remark = input('remark','');
|
|
$cancel_reason = input('cancel_reason','');
|
|
$cancel_reason = input('cancel_reason','');
|
|
- $cancel_time = strtotime(input('cancel_time',''));
|
|
|
|
|
|
+ $cancel_time = time();
|
|
|
|
|
|
Db::startTrans();
|
|
Db::startTrans();
|
|
$update = [
|
|
$update = [
|
|
@@ -160,7 +163,15 @@ class Lessonslot extends Backend
|
|
}
|
|
}
|
|
|
|
|
|
Db::commit();
|
|
Db::commit();
|
|
- $this->success('取消完成');
|
|
|
|
|
|
+
|
|
|
|
+ $comefrom = input('comefrom','');
|
|
|
|
+ if($comefrom == 'backend'){
|
|
|
|
+ //后台来的
|
|
|
|
+ $this->success('取消完成');
|
|
|
|
+ }else{
|
|
|
|
+ //接口来的
|
|
|
|
+ $this->result('',1,'取消完成','json');
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|