123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417 |
- <?php
- namespace app\base;
- use think\Controller;
- use think\Cookie;
- //公用配置文件
- class CBase extends Controller
- {
- protected function _initialize()
- {
- header("Content-type: text/html; charset=utf-8");
- parent::_initialize();
- }
- //显示范围
- protected function showScope(){
- return [
- 1 => '全部',
- 2 => '线上',
- 3 => '线下',
- ];
- }
- //海媚门店地址
- protected function hmApiUrl()
- {
- return [
- //西门店
- 0 => '111.111.111.111:808',
- ];
- }
- //商品销售范围
- protected function salesScope(){
- return [
- '1' => '全部',
- '2' => '微信',
- '3' => '线下',
- ];
- }
- //包厢类型备注
- protected function boxTypeText()
- {
- return [
- '1' => '免费WIFI+专业无线麦克风,可容纳8~10人',
- '2' => '免费WIFI+专业无线麦克风,可容纳10~12人',
- '3' => '免费WIFI+专业无线麦克风,可容纳12~15人',
- '4' => '免费WIFI+专业无线麦克风,可容纳15~20人',
- ];
- }
- //包厢可容纳人数
- protected function boxAcceptNum()
- {
- return [
- '1' => '3-5人',
- '2' => '8-10人',
- '3' => '12-15人',
- '4' => '15-20人',
- '5' => '20-30人',
- '6' => '50-60人'
- ];
- }
- //时间排序
- protected function orderByTime()
- {
- return [
- '0' => '默认',
- '1' => '由近到远',
- '2' => '由远到近',
- ];
- }
- //价格排序
- protected function ordByPrice()
- {
- return [
- '0' => '默认',
- '1' => '由低到高',
- '2' => '由高到低',
- ];
- }
- //是否积分抵扣
- protected function using_integral()
- {
- return [
- '0' => '否',
- '1' => '是',
- ];
- }
- //是否支持存取
- protected function save()
- {
- return [
- '1' => '支持',
- '0' => '不支持',
- ];
- }
- //出入库类型
- protected function type()
- {
- return [
- '1' => '出库',
- '2' => '入库',
- ];
- }
- //存取状态
- protected function cunqu()
- {
- return [
- '1' => '存酒',
- '2' => '取酒',
- ];
- }
- //分类归属
- protected function catalog()
- {
- return [
- '1' => '归属商品',
- // '2' => '归属增值',
- // '3' => '归属套餐',
- ];
- }
- //对内对外
- protected function supply()
- {
- return [
- '0' => '内耗',
- '1' => '对外',
- ];
- }
- //商品归属
- protected function affiliation()
- {
- return [
- '1' => '厨房',
- '2' => '超市',
- ];
- }
- //线上预定设置 断电
- protected function predetermine()
- {
- return [
- '1' => '可预定',
- '2' => '不可预定',
- ];
- }
- //存取订单状态
- protected function access()
- {
- return [
- '1' => '待确认',
- '2' => '已完成',
- '3' => '被驳回',
- ];
- }
- //订单类型
- protected function ordType()
- {
- return [
- '1' => '正常',
- '2' => '续时',
- '3' => '换包前',
- '30' => '换包后',
- '31' => '换包前',
- '32' => '换包后',
- '4' => '退包',
- ];
- }
- //订单状态
- protected function ordStatText()
- {
- return [
- '-1' => '已取消',
- '0' => '<span style="color: red">待付款</span>',
- '1' => '已付款',
- '11' => '退款中',
- '12' => '退款成功',
- '2' => '进行中',
- '3' => '已完成',
- '4' => '电话预订',
- ];
- }
- //套餐种类
- protected function sort()
- {
- return [
- '1' => '普通套餐',
- '2' => '包厢套餐'
- ];
- }
- //包厢空闲状态
- protected function idleState()
- {
- return [
- '1' => '空闲',
- '2' => '使用中..',
- '3' => '被预定',
- '4' => '清理中..',
- '5' => '维修中',
- ];
- }
- //包厢显示类型
- protected function showType()
- {
- return [
- '1' => '可订包厢',
- '2' => '禁订包厢',
- '3' => '所有包厢',
- ];
- }
- //订单来源
- protected function ordSource()
- {
- return [
- '1' => '在线下单',
- '2' => '客服下单',
- '3' => '线下下单',
- ];
- }
- //订单来源
- protected function ordSources()
- {
- return [
- '1' => '微信',
- '2' => '微信',
- '3' => '线下'
- ];
- }
- //支付方式
- protected function linePayWay()
- {
- return [
- '1' => '现金',
- '2' => '刷卡',
- '3' => '微信',
- '4' => '会员后台扣款',
- '5' => '会员卡',
- '6' => '其它',
- '7' => '美团',
- '8' => '积分兑换',
- '9' => '抵用券',
- '10' => '抹零',
- '11' => '八折',
- '12' => '优惠',
- '13' => '扫码',
- '14' => '恒程支付',
- '15' => '接待',
- '16' => '云POS',
- '17' => '口碑',
- '18' => '电子券',
- '19' => '挂账',
- '20' => '消费'
- ];
- }
- //列表控制
- protected function listHtml($ulClass, $liClass, $fzClass)
- {
- $str = $this->fetch('public/leftList');
- $str = str_replace($ulClass, 'db', $str);
- $str = str_replace($liClass, 'cor', $str);
- $str = str_replace($fzClass, 'fz', $str);
- return $str;
- }
- //系统消息类型
- protected function sysMsgType()
- {
- return [
- '1' => '换房申请',
- '2' => '退款申请',
- '3' => '订单配送'
- ];
- }
- //获取短信验证码
- public function sendSMS($tel)
- {
- if (is_numeric($tel) && strlen($tel) == 11) {
- $random = rand(1000, 9999);
- $num = iconv("UTF-8", "GB2312//IGNORE", "短信验证码".$random);
- $zn = iconv("UTF-8", "GB2312//IGNORE", '盛世欢唱提醒您:');
- Cookie::set('no_time', $random, 90);
- $url = 'http://111.111.111.111:9050/cgi-bin/sendsms?username=sshc@sshc&password=******' . $tel . '&text=' . $zn . $num . '&subid=&msgtype=4';
- $this->curl($url);
- }
- return true;
- }
- //万能curl
- public function curl($url, $data = null)
- {
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- if (!empty($data)) {
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
- }
- $out = curl_exec($ch);
- curl_close($ch);
- return json_decode($out, true);
- }
- //消息读取状态
- public function msgReadState()
- {
- return [
- '0' => '未读',
- '1' => '已读',
- ];
- }
- // 模板列表(盛世公司模板-曦尚测试)
- public function template_list()
- {
- $data = array(
- //寄存成功通知
- "deposit" => array(
- "template_id" => "dG2lTfmcqxQAzM9m-FMgAoni_x9OiW6iviW-47GgEGI",
- "data" => array(
- "first" => array('value' => '', 'color' => ''), //开头语
- "keyword1" => array('value' => '', 'color' => ''), //物品名称
- 'keyword2' => array('value' => '', 'color' => ''), //物品数量
- 'keyword3' => array('value' => '', 'color' => ''), //物品单位
- 'keyword4' => array('value' => '', 'color' => ''), //特殊说明
- 'keyword5' => array('value' => '', 'color' => ''), //到期时间
- 'remark' => array('value' => '', 'color' => ''), //结尾语
- ),
- ),
- //支取成功通知
- "draw" => array(
- "template_id" => "Adtzv7Z7bMmo5fbruKbwH3aOLe_Rv7ltmb0tTsPF8KA",
- "data" => array(
- "first" => array('value' => '', 'color' => ''), //开头语
- "keyword1" => array('value' => '', 'color' => ''), //物品名称
- 'keyword2' => array('value' => '', 'color' => ''), //物品数量
- 'keyword3' => array('value' => '', 'color' => ''), //物品单位
- 'remark' => array('value' => '', 'color' => ''), //结尾语
- ),
- ),
- //会员卡消费通知
- "card_consume" => array(
- "template_id" => "H8SWgAi7X3roaLeL6DY5TuWsr-YNIYrcHdM-ZGTW4BY",
- "data" => array(
- "first" => array('value' => '', 'color' => ''), //开头语
- "keyword1" => array('value' => '', 'color' => ''), //消费时间
- 'keyword2' => array('value' => '', 'color' => ''), //消费金额
- 'keyword3' => array('value' => '', 'color' => ''), //储值减扣
- 'keyword4' => array('value' => '', 'color' => ''), //卡上余额
- 'remark' => array('value' => '', 'color' => ''), //结尾语
- ),
- ),
-
- "remind" => array(
- "template_id" => "Gtgr-UEEDRNe4hCom8YNZJkRQr47lGdMV9XCWxIwk40",
- "data" => array(
- "first" => array('value' => '', 'color' => ''), //开头语
- "keyword1" => array('value' => '', 'color' => ''), //消费时间
- 'keyword2' => array('value' => '', 'color' => ''), //消费金额
- 'remark' => array('value' => '', 'color' => ''), //结尾语
- ),
- ),
- //寄存到期提醒
- "deposit_maturity" => array(
- "template_id" => "9iMI92uq2_KKEVT092l4ZRUUg9Jd3hBeJ4BlULTjd0A",
- "data" => array(
- "first" => array('value' => '', 'color' => ''), //开头语
- "keyword1" => array('value' => '', 'color' => ''), //物品名称
- "keyword2" => array('value' => '', 'color' => ''), //物品数量
- "keyword3" => array('value' => '', 'color' => ''), //物品单位
- "keyword4" => array('value' => '', 'color' => ''), //特殊说明
- "keyword5" => array('value' => '', 'color' => ''), //到期时间
- 'remark' => array('value' => '', 'color' => ''), //结尾语
- ),
- ),
- );
- return $data;
- }
- public function pay_type()
- {
- // 1 2刷卡 3微信 4支付宝 5会员卡 6其它',
- return array(
- 'xianjin' => 1, 'yinlianka' => 2, 'weixin' => 3, 'zhifubao' => 4, 'huiyuanka' => 5,
- 'meituan' => 7, 'jifenduihuan' => 8, 'diyongjuan' => 9, 'moling' => 10, 'bazhe' => 11,
- 'youhui' => 12, 'saoma' => 13, 'hengcheng' => 14, 'jiedai' => 15, 'yunPOS' => 16,
- 'koubei' => 17, 'dianzijuan' => 18, 'guazhang' => 19
- );
- }
- }
|