带后台试用,时间授权,群组个人记账等

安装

第一步:C:\Users\Administrator\Desktop\jzcs.zxun.cc\application\api\controller
修改 index 和 user 文件数据

第二步:访问 https://api.telegram.org/bot机器人TOKEN/getMe 获取ID填写

第三步:C:\Users\Administrator\Desktop\jzcs.zxun.cc\application\admin\controller\bookbill
修改 Bookgroup 数据

第四步:C:\Users\Administrator\Desktop\jzcs.zxun.cc\application\common\model
修改 AUth文件 beat64进行解码 给解码替换掉原先代码 ][ 这个符号进行空换 留开头结尾

where(‘is_freeze’,0)->where(‘status’,0)->where(‘chat’,$group_id)->where(‘is_show’,0)->where(‘actual_time’,’>=’,$beginToday)->where(‘actual_time’,'<=’,$endToday)->order(‘id desc’)->limit(6)->select(); $issue = Db::name(‘tg_book_keeping’)->where(‘is_freeze’,0)->where(‘status’,1)->where(‘chat’,$group_id)->where(‘is_show’,0)->where(‘actual_time’,’>=’,$beginToday)->where(‘actual_time’,'<=’,$endToday)->order(‘id’,’desc’)->limit(6)->select(); $inflow_count = Db::name(‘tg_book_keeping’)->where(‘is_freeze’,0)->where(‘status’,0)->where(‘chat’,$group_id)->where(‘is_show’,0)->where(‘actual_time’,’>=’,$beginToday)->where(‘actual_time’,'<=’,$endToday)->count(); $issue_count = Db::name(‘tg_book_keeping’)->where(‘is_freeze’,0)->where(‘status’,1)->where(‘chat’,$group_id)->where(‘is_show’,0)->where(‘actual_time’,’>=’,$beginToday)->where(‘actual_time’,'<=’,$endToday)->count(); $inflow_amount_date_all = Db::name(‘tg_book_keeping’)->where(‘is_freeze’,0)->where(‘chat’,$group_id)->where(‘status’,0)->where(‘is_show’,0)->where(‘actual_time’,’>=’,$beginToday)->where(‘actual_time’,'<=’,$endToday)->sum(‘price’); $issue_amount_date_all
= Db::name(‘tg_book_keeping’)->where(‘is_freeze’,0)->where(‘chat’,$group_id)->where(‘status’,1)->where(‘is_show’,0)->where(‘actual_time’,’>=’,$beginToday)->where(‘actual_time’,'<=’,$endToday)->sum(‘price’); $guanggao = Db::name(‘config’)->where(‘name’,’guanggao’)->value(‘value’); $sendText = PHP_EOL.”; $sendText .= ‘入款(’. $inflow_count . ‘)笔:’ . PHP_EOL; $inflow_amount = 0; $issue_amount = 0; if( !empty( $inflow ) ) { $inflow = array_reverse($inflow); foreach ($inflow as $key=>$val) { $inflow_amount += $val[‘price’]; if( $val[‘rate’] == 0 ){ $amount = ‘U’; } else { $amount = round($val[‘price’] / $val[‘rate’],2) . ‘ U’; } $te = ‘'.date('H:i:s',$val['created_at']).'‘. ‘ ‘ . ‘‘. $val[‘price’] .’‘; if( $rate > 0 ){ if( $val[‘rate’] == 0 ){ $te .= $amount; } else { $te .= ‘ / ‘ . $val[‘rate’] . ‘=’.$amount; } } $sendText .= $te . PHP_EOL; } } $sendText .= PHP_EOL; $sendText .= ‘下发(’. $issue_count . ‘)笔:’ . PHP_EOL; if( !empty( $issue ) ) { $issue = array_reverse($issue); foreach ($issue
as $key=>$val) { $tes = ”; $issue_amount += $val[‘price’]; if( $val[‘rate’] == 0 ){ $amount = round($val[‘price’],2) . ‘U’; } else { $amount = round($val[‘price’] / $val[‘rate’],2) . ‘ U’; } if( $rate > 0 ){ $tes = ‘'.date('H:i:s',$val['created_at']).'‘. ‘ ‘; $tes .= $amount.’ ‘ . ‘[ [‘. round($val[‘price’],2) .’] ]’; } else { $tes = ‘'.date('H:i:s',$val['created_at']).'‘. ‘ ‘; $tes .= round($val[‘price’],2); } $sendText .= $tes.PHP_EOL; } } $yesterday_beginToday = mktime(0,0,0,date(‘m’),date(‘d’)-1,date(‘Y’)); $yesterday_endToday = mktime(0,0,0,date(‘m’),date(‘d’),date(‘Y’))-1; $yesterday_inflow_amount = Db::name(‘tg_book_keeping’)->where(‘is_freeze’,0)->where(‘chat’,$group_id)->where(‘status’,0)->where(‘is_show’,0)->sum(‘price’); $yesterday_issue_amount_all = Db::name(‘tg_book_keeping’)->where(‘is_freeze’,0)->where(‘chat’,$group_id)->where(‘status’,1)->where(‘is_show’,0)->sum(‘price’); $date_amount = $yesterday_inflow_amount – $yesterday_issue_amount_all; $balance = round($date_amount);
$sendText .= PHP_EOL; $sendText .= ‘总入款:’. ‘'.$inflow_amount_date_all.'‘ . PHP_EOL; return $sendText; } public static function operatorAuth($group_id , $resUlt , $type = 0 , $is_start){ if( !$is_start ){ $user_form_id = 0; $username = isset( $resUlt[‘message’][‘from’][‘username’]) ? $resUlt[‘message’][‘from’][‘username’] : ”; if( empty( $username ) ){ $user_form_id = $resUlt[‘message’][‘from’][‘id’]; } $chat_form_id = $resUlt[‘message’][‘from’][‘id’]; $chat_auth = Db::name(‘chat_auth’)->where(‘form_id’ ,$chat_form_id )->find(); if( $type ){ if( !empty( $chat_auth ) ){ if( $chat_auth[‘expire_time’] < time() ){ if(!$user_form_id){ $operator_user = Db::name(‘setting_operation’)->where(‘chat’ ,$group_id )->where(‘from_id’,$username)->find(); } else { $operator_user = Db::name(‘setting_operation’)->where(‘chat’ ,$group_id )->where(‘user_form_id’,$user_form_id)->find(); } if(empty( $operator_user )) { $this->success(‘请求成功’); } } } else { $this->success(‘请求成功’); } } else { if( !empty( $chat_auth ) ){ if( $chat_auth[‘expire_time’] < time() ){ if(!$user_form_id){ $operator_user = Db::name(‘setting_operation’)->where(‘chat’ ,$group_id )->where(‘from_id’,$username)->find(); } else { $operator_user = Db::name(‘setting_operation’)->where(‘chat’ ,$group_id )->where(‘user_form_id’,$user_form_id)->find(); } if( empty( $operator_user ) ){ $tg_group = Db::name(‘tg_group’)->where(‘chat’ ,$resUlt[‘message’][‘chat’][‘id’] )->find(); if(empty( $tg_group[‘auth_user’] )) { Request::sendMessage([ ‘text’ => ‘您的授
权已经过期!’, ‘chat_id’ => $resUlt[‘message’][‘chat’][‘id’], ‘parse_mode’ => ‘html’, ‘reply_to_message_id’ => 0, ]); } $this->success(‘请求成功’); } } } else { if(!$user_form_id){ $operator_user = Db::name(‘setting_operation’)->where(‘chat’ ,$group_id )->where(‘from_id’,$username)->find(); } else { $operator_user = Db::name(‘setting_operation’)->where(‘chat’ ,$group_id )->where(‘user_form_id’,$user_form_id)->find(); } if( empty( $operator_user ) ) { $this->success(‘请求成功’); } } } } } }

伪静态
location ~* (runtime|application)/{
return 403;
}
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last; break;
}
}

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。