<?php
namespace app\shared\logic\platform;
use app\shared\model\Option;
use app\shared\model\WxSubscription;
use think\exception\ValidateException;
use app\BaseController;
class TemplateMessageForm extends  Base
{
    //获取数据
    public  function index(){
        //预约通知
        $data['wx_subscibe_book_inform']=Option::get_data($this->acid,'platform','wx_subscibe_book_inform');
        //预约结束提醒
        $data['wx_subscibe_book_finish']=Option::get_data($this->acid,'platform','wx_subscibe_book_finish');
        //预约提醒加时
        $data['wx_subscibe_book_overtime']=Option::get_data($this->acid,'platform','wx_subscibe_book_overtime');
        //保洁通知
        $data['wx_template_cleaning_inform']=Option::get_data($this->acid,'platform','wx_template_cleaning_inform');
        //预订取消通知
        $data['wx_template_cancel_order_inform']=Option::get_data($this->acid,'platform','wx_template_cancel_order_inform');

        $data['wx_subscibe_book_sweep']=Option::get_data($this->acid,'platform','wx_subscibe_book_sweep');

        //公众号茶艺师新订单通知
        $data['wx_template_tea_specia_order_inform']=Option::get_data($this->acid,'platform','wx_template_tea_specia_order_inform');
         //公众号保洁端通知
        $data['wx_template_cleaning_port_inform']=Option::get_data($this->acid,'platform','wx_template_cleaning_port_inform');


         //小程序茶艺师接单订单通知
        $data['wx_subscibe_tea_specia_order_inform']=Option::get_data($this->acid,'platform','wx_subscibe_tea_specia_order_inform');

        //小程序茶艺师订单完成通知
        $data['wx_subscibe_tea_specia_order_finish']=Option::get_data($this->acid,'platform','wx_subscibe_tea_specia_order_finish');  
        

        return fetchJson($data);
    }
    //编辑
    public function edit(){
         //预约通知
        Option::set_data($this->acid,'platform','wx_subscibe_book_inform',input('wx_subscibe_book_inform'));
        //预约结束提醒
        Option::set_data($this->acid,'platform','wx_subscibe_book_finish',input('wx_subscibe_book_finish'));
        //预约提醒加时
        Option::set_data($this->acid,'platform','wx_subscibe_book_overtime',input('wx_subscibe_book_overtime'));
         //保洁通知
        Option::set_data($this->acid,'platform','wx_template_cleaning_inform',input('wx_template_cleaning_inform'));
        //预订取消通知
        Option::set_data($this->acid,'platform','wx_template_cancel_order_inform',input('wx_template_cancel_order_inform'));

        Option::set_data($this->acid,'platform','wx_subscibe_book_sweep',input('wx_subscibe_book_sweep'));

        //公众号茶艺师新订单通知 //ZnHsn4GD6RQUxGSaAhiUzUhaDtmu74NaG3agjhDCLgo
        Option::set_data($this->acid,'platform','wx_template_tea_specia_order_inform',input('wx_template_tea_specia_order_inform'));
 
        //小程序茶艺师接单订单通知
        Option::set_data($this->acid,'platform','wx_subscibe_tea_specia_order_inform',input('wx_subscibe_tea_specia_order_inform'));

        //小程序茶艺师订单完成通知
        Option::set_data($this->acid,'platform','wx_subscibe_tea_specia_order_finish',input('wx_subscibe_tea_specia_order_finish'));  

        //公众号保洁端通知
        Option::set_data($this->acid,'platform','wx_template_cleaning_port_inform',input('wx_template_cleaning_port_inform'));       

        return fetchJson([],'保存成功');
    }
    //获取列表
    public function getList(){
        $form=new WxSubscription();
        $res=$form->addTplData($this->acid);
        return fetchJson($res);
    }
    //删除
    public function delete(){
         return fetchJson([],'删除成功');
    }
}