cqp преди 2 месеца
родител
ревизия
31dae5acbf

+ 77 - 0
app/Console/Commands/ToDoReminder.php

@@ -0,0 +1,77 @@
+<?php
+
+namespace App\Console\Commands;
+
+use App\Model\TodoList;
+use Illuminate\Console\Command;
+use Illuminate\Support\Facades\DB;
+
+class ToDoReminder extends Command
+{
+    /**
+     * The name and signature of the console command.
+     *
+     * @var string
+     */
+    protected $signature = 'command:todo_reminder';
+
+    /**
+     * The console command description.
+     *
+     * @var string
+     */
+    protected $description = 'Command description';
+
+    /**
+     * Create a new command instance.
+     *
+     * @return void
+     */
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    /**
+     * Execute the console command.
+     *
+     * @return mixed
+     */
+    public function handle()
+    {
+        $this->handleReminders();
+    }
+
+    public function handleReminders()
+    {
+        $now = time();
+
+        TodoList::where('status', '<', TodoList::status_two)
+            ->where('del_time', 0)
+            ->where('remind_start', '<=', $now)
+            ->select(TodoList::$field)
+            ->orderBy('id')
+            ->chunkById(10, function ($data) use ($now) {
+                DB::transaction(function () use ($data, $now) {
+                    foreach ($data as $todo) {
+                        // 单次提醒
+                        if ($todo->remind_interval == 0) {
+                            if (empty($todo->last_remind_time)) {
+                                $this->sendReminder($todo);
+                                $todo->last_remind_time = $now;
+                                $todo->save();
+                            }
+                            continue;
+                        }
+
+                        // 第一次提醒 或 距离上次提醒超过间隔时间
+                        if (empty($todo->last_remind_time) || ($now - $todo->last_remind_time) >= $todo->remind_interval) {
+                            $this->sendReminder($todo);
+                            $todo->last_remind_time = $now;
+                            $todo->save();
+                        }
+                    }
+                });
+            });
+    }
+}

+ 67 - 0
app/Http/Controllers/Api/OrderController.php

@@ -140,4 +140,71 @@ class OrderController extends BaseController
             return $this->json_return(201,$data);
         }
     }
+
+    public function toDoEdit(Request $request)
+    {
+        $service = new OrderService();
+        $user = $request->userData;
+        list($status,$data) = $service->toDoEdit($request->all(),$user);
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function toDoAdd(Request $request)
+    {
+        $service = new OrderService();
+        $user = $request->userData;
+        list($status,$data) = $service->toDoAdd($request->all(),$user);
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+    public function toDoDel(Request $request)
+    {
+        $service = new OrderService();
+        $user = $request->userData;
+        list($status,$data) = $service->toDoDel($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+    public function toDoList(Request $request)
+    {
+        $service = new OrderService();
+        $user = $request->userData;
+        list($status,$data) = $service->toDoList($request->all(),$user);
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function toDoDetail(Request $request)
+    {
+        $service = new OrderService();
+        $user = $request->userData;
+        list($status,$data) = $service->toDoDetail($request->all(),$user);
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
 }

+ 51 - 0
app/Model/TodoList.php

@@ -0,0 +1,51 @@
+<?php
+
+namespace App\Model;
+
+class TodoList extends UseScopeBaseModel
+{
+    protected $table = "to_do_list"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+    const employee_column = "crt_id";
+
+    public static $field = ['title','id','type','remind_start','man_type','organization_name','crt_id','crt_time','contact','address','content','decision_maker','status','remind_interval','last_remind_time'];
+
+    const type_one = 1;
+    const type_two = 2;
+    const type_three = 3;
+    const type_four = 4;
+    const type_five = 5;
+    const type_six = 6;
+    const type_seven = 7;
+    public static $type_value = [
+        self::type_one => 0,
+        self::type_two => 300,
+        self::type_three => 600,
+        self::type_four => 1200,
+        self::type_five => 1800,
+        self::type_six => 3600,
+        self::type_seven => 7200,
+    ];
+
+    public static $type_name = [
+        self::type_one => '单次',
+        self::type_two => '5分钟',
+        self::type_three => '10分钟',
+        self::type_four => '20分钟',
+        self::type_five => '30分钟',
+        self::type_six => '1小时',
+        self::type_seven => '2小时',
+    ];
+
+    const status_zero = 0;
+    const status_one = 1;
+    const status_two = 2;
+
+    public static $status_name = [
+        self::status_zero => '未开始',
+        self::type_one => '进行中',
+        self::type_two => '已完成',
+    ];
+}

+ 189 - 0
app/Service/OrderService.php

@@ -7,6 +7,7 @@ use App\Model\Order;
 use App\Model\OrderDetails;
 use App\Model\Reminder;
 use App\Model\ReminderDetails;
+use App\Model\TodoList;
 use Illuminate\Support\Facades\DB;
 
 class OrderService extends Service
@@ -540,4 +541,192 @@ class OrderService extends Service
     public function createOrderNumber(){
         return date('YmdHis',time()) . rand(1000,9999);
     }
+
+    //催单管理---------------------------------------------
+
+
+    //待办管理---------------------------------------------
+
+    public function toDoEdit($data,$user){
+        list($status,$msg) = $this->toDoRule($data, $user, false);
+        if(!$status) return [$status,$msg];
+
+        try {
+            DB::beginTransaction();
+
+            $model = TodoList::where('id',$data['id'])->first();
+            $model->title = $data['title'] ?? "";
+            $model->type = $data['type'] ?? '';
+            $model->remind_start = $data['remind_start'] ?? '';
+            $model->remind_interval = $data['remind_interval'] ?? 0;
+            $model->last_remind_time = $data['last_remind_time'] ?? 0;
+            $model->man_type = $data['man_type'] ?? '';
+            $model->organization_name = $data['organization_name'] ?? '';
+            $model->contact = $data['contact'] ?? '';
+            $model->address = $data['address'] ?? '';
+            $model->content = $data['content'] ?? '';
+            $model->save();
+
+            DB::commit();
+        }catch (\Exception $exception){
+            DB::rollBack();
+            return [false,$exception->getMessage()];
+        }
+
+        return [true, ''];
+    }
+
+    public function toDoAdd($data,$user){
+        list($status,$msg) = $this->toDoRule($data, $user);
+        if(!$status) return [$status,$msg];
+
+        try {
+            DB::beginTransaction();
+
+            $model = new Reminder();
+            $model->title = $data['title'] ?? "";
+            $model->type = $data['type'] ?? '';
+            $model->remind_start = $data['remind_start'] ?? '';
+            $model->remind_interval = $data['remind_interval'] ?? 0;
+            $model->last_remind_time = $data['last_remind_time'] ?? 0;
+            $model->man_type = $data['man_type'] ?? '';
+            $model->organization_name = $data['organization_name'] ?? '';
+            $model->contact = $data['contact'] ?? '';
+            $model->address = $data['address'] ?? '';
+            $model->content = $data['content'] ?? '';
+            $model->crt_id = $user['id'];
+            $model->save();
+
+            DB::commit();
+        }catch (\Exception $exception){
+            DB::rollBack();
+            return [false,$exception->getMessage()];
+        }
+
+        return [true, ''];
+    }
+
+    public function toDoDel($data){
+        if($this->isEmpty($data,'id')) return [false,'请选择数据!'];
+
+//        $bool = TodoList::where('del_time',0)
+//            ->whereIn('id',$data['id'])
+//            ->where('status','>',TodoList::status_zero)
+//            ->exists();
+//        if($bool) return [false, '待办状态已变更,删除失败'];
+        try {
+            DB::beginTransaction();
+            $time = time();
+
+            TodoList::where('del_time',0)
+                ->whereIn('id',$data['id'])
+                ->update(['del_time' => $time]);
+
+            DB::commit();
+        }catch (\Exception $exception){
+            DB::rollBack();
+            return [false,$exception->getMessage()];
+        }
+
+        return [true, ''];
+    }
+
+    public function toDoDetail($data, $user){
+        if($this->isEmpty($data,'id')) return [false,'请选择数据!'];
+        $customer = TodoList::where('del_time',0)
+            ->where('id',$data['id'])
+            ->first();
+        if(empty($customer)) return [false,'催单不存在或已被删除'];
+        $customer = $customer->toArray();
+        $customer['crt_name'] = Employee::where('id',$customer['crt_id'])->value('emp_name');
+        $customer['crt_time'] = $customer['crt_time'] ? date("Y-m-d H:i:s",$customer['crt_time']): '';
+        $customer['remind_start'] = $customer['remind_start'] ? date("Y-m-d H:i",$customer['remind_start']): '';
+        $customer['type_title'] = TodoList::$type_name[$customer['df_type']] ?? "";
+        $customer['status_title'] = TodoList::$status_name[$customer['status']] ?? "";
+
+        return [true, $customer];
+    }
+
+    public function toDoCommon($data,$user, $field = []){
+        if(empty($field)) $field = TodoList::$field;
+
+        $model = TodoList::Clear($user,$data);
+        $model = $model->where('del_time',0)
+            ->select($field)
+            ->orderby('id', 'desc');
+
+        if(! empty($data['title'])) $model->where('title', 'LIKE', '%'.$data['title'].'%');
+        if(! empty($data['id'])) $model->whereIn('id', $data['id']);
+        if(isset($data['status'])) $model->where('status', $data['status']);
+        if(! empty($data['crt_time'][0]) && ! empty($data['crt_time'][1])) {
+            $return = $this->changeDateToTimeStampAboutRange($data['crt_time']);
+            $model->where('crt_time','>=',$return[0]);
+            $model->where('crt_time','<=',$return[1]);
+        }
+        if(! empty($data['remind_start'][0]) && ! empty($data['remind_start'][1])) {
+            $return = $this->changeDateToTimeStampAboutRange($data['remind_start']);
+            $model->where('remind_start','>=',$return[0]);
+            $model->where('remind_start','<=',$return[1]);
+        }
+
+        return $model;
+    }
+
+    public function toDoList($data,$user){
+        $model = $this->toDoCommon($data, $user);
+        $list = $this->limit($model,'',$data);
+        $list = $this->fillToDoData($list,$user,$data);
+
+        return [true, $list];
+    }
+
+    public function toDoRule(&$data, $user, $is_add = true){
+        if(empty($data['title'])) return [false, '待办标题不能为空'];
+        if(empty($data['type'])) return [false, '间隔时长不能为空'];
+        if(! isset(TodoList::$type_value[$data['type']])) return [false, '间隔时长错误'];
+        $data['remind_interval'] = TodoList::$type_value[$data['type']];
+        if(empty($data['remind_start'])) return [false, '提醒开始时间不能为空'];
+        $data['remind_start'] = $this->changeDateToDateMin($data['remind_start']);
+        $now = strtotime(date("Y-m-d H:i"));
+        if ($data['remind_start'] - $now < 300) return [false, '提醒开始时间必须至少比当前时间晚5分钟'];
+
+//        if(empty($data['man_type'])) return [false, '拜访人员类型不能为空'];
+//        if(empty($data['organization_name'])) return [false, '组织名称不能为空'];
+//        if(empty($data['contact'])) return [false, '联系人不能为空'];
+//        if(empty($data['address'])) return [false, '地点不能为空'];
+        if(empty($data['content'])) return [false, '内容不能为空'];
+
+        if($is_add){
+
+        }else{
+            if(empty($data['id'])) return [false,'ID不能为空'];
+            $order = TodoList::where('id',$data['id'])
+                ->where('del_time',0)
+                ->first();
+            if(empty($order)) return [false, '待办事项不存在或已被删除'];
+            $order = $order->toArray();
+            if($order['status'] > TodoList::status_zero) return [false, '待办事项状态已变更,编辑失败'];
+            if ($order->remind_start != $data['remind_start'] || $order->remind_interval != $data['remind_interval']) {
+                $data['last_remind_time'] = 0;
+            }
+        }
+
+        return [true, $data];
+    }
+
+    public function fillToDoData($data, $user, $search){
+        if(empty($data['data'])) return $data;
+
+        $emp = (new EmployeeService())->getEmployeeMap(array_unique(array_column($data['data'],'id')));
+        foreach ($data['data'] as $key => $value){
+            $data['data'][$key]['crt_time'] = $value['crt_time'] ? date('Y-m-d H:i:s',$value['crt_time']) : '';
+            $data['data'][$key]['remind_start'] = $value['remind_start'] ? date('Y-m-d H:i',$value['remind_start']) : '';
+            $data['data'][$key]['crt_name'] = $emp[$value['crt_id']] ?? '';
+
+            $data['data'][$key]['type_title'] = TodoList::$type_name[$value['df_type']] ?? "";
+            $data['data'][$key]['status_title'] = TodoList::$status_name[$value['status']] ?? "";
+        }
+
+        return $data;
+    }
 }

+ 16 - 74
app/Service/Weixin/WeixinService.php

@@ -7,21 +7,25 @@ use Illuminate\Support\Facades\Redis;
 
 class WeixinService extends Service
 {
-    const APPID = 'wxe048bcdcc21aae6e';
-    const APPSECRET = '191789c5b4ef2b3d5b9e79bb62428092';
+    public $appid = '';
+    public $secret = '';
     const ACCESS_URL = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s';
-    const OPENID = '';
-    const TOKEN = '';
-    const KEY = 'weixinsupplymarketing';
+    const KEY = '';
 
     const STABLE_TOKEN_URL = 'https://api.weixin.qq.com/cgi-bin/stable_token'; // 稳定版接口
     const KEY_STABLE = 'weixinsupplymarketing';
 
+    public function __construct()
+    {
+        $this->appid = config("wx_msg.f_appid");
+        $this->secret = config("wx_msg.f_appSecret");
+    }
+
     public function getToken(){
         $token_key = self::KEY.'_'.'token';
         $token = Redis::get($token_key);
         if(! $token){
-            $url = sprintf(self::ACCESS_URL,self::APPID,self::APPSECRET);
+            $url = sprintf(self::ACCESS_URL,$this->appid, $this->secret);
             $res = $this->curlOpen($url);
             $res = json_decode($res,true);
             if(isset($res['errmsg'])) return [false,$res['errmsg']];
@@ -45,8 +49,8 @@ class WeixinService extends Service
         // 构建 POST 请求体
         $postData = json_encode([
             'grant_type' => 'client_credential',
-            'appid' => self::APPID,
-            'secret' => self::APPSECRET,
+            'appid' => $this->appid,
+            'secret' => $this->secret,
             // 可选:'force_refresh' => true 强制刷新
         ]);
 
@@ -71,18 +75,18 @@ class WeixinService extends Service
         $url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=%s&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
         $param = isset($data['param']) ? $data['param'] : '';
         $redirect_uri = urlencode('https://t9api.qingyaokeji.com/wxapi/getUnionid?uri='.$uri.'&param='.$param);
-        $url = sprintf($url,self::APPID,$redirect_uri);
+        $url = sprintf($url,$this->appid,$redirect_uri);
         header("Location:".$url);exit;
         echo 'ok';die;
     }
 
     public function getUnionid($data){
-        file_put_contents('22.txt',date('YmdHis').json_encode($data));
+//        file_put_contents('22.txt',date('YmdHis').json_encode($data));
 //        echo $data['code'];
 
         if(isset($data['code'])) {
             list($status,$openid) = $this->getOpenid($data);
-            file_put_contents('222.txt',date('YmdHis').json_encode($openid));
+//            file_put_contents('222.txt',date('YmdHis').json_encode($openid));
             if(!$status) return [false,$openid];
             $uri = $data['uri'];
             $openid = $openid['openid'];
@@ -96,73 +100,11 @@ class WeixinService extends Service
         if(empty($data['code'])) return [false, 'code不能为空'];
         $code = $data['code'];
         $url = 'https://api.weixin.qq.com/sns/oauth2/access_token?appid=%s&secret=%s&code=%s&grant_type=authorization_code';
-        $url = sprintf($url,self::APPID,self::APPSECRET,$code);
+        $url = sprintf($url,$this->appid,$this->secret,$code);
         $res = $this->curlOpen($url);
         $res = json_decode($res,true);
         if(!isset($res['openid'])) return [false,$res['errmsg']??'request error'];
         $openid = $res['openid'];
         return [true,['openid' => $openid]];
     }
-
-//    public function sendTmpMsg($data){
-//        //        $openid = 'okXNa69ggEX61KvHUhCq9PcGrPKI';
-//        $data = [
-//            'openid' => 'o7B4f68DuDlBSevGdctFyP8MD-nw',
-//            'tempid' => '5azHlaoAu6MgRzkxn_HL6ygFt_wIkXEz9CklPWEdP70',
-//            'reload_url' => '',
-//            'first' => '工资发放',
-//            'remark' => '请查收',
-//            'detail' => [
-//                'thing2' => '姓名',
-//                'thing6' => '10',
-//                'time4' => '2023-09-01',
-//                'character_string3' => 'st.1231',
-//                'thing1' => '类型',
-//            ]
-//        ];
-//        if(!isset($data['detail'])) return [false,'invalid detail'];
-//        if(!isset($data['openid'])) return [false,'invalid openid'];
-//        if(!isset($data['tempid'])) return [false,'invalid tempid'];
-//        if(!isset($data['reload_url'])) return [false,'invalid reload_url'];
-//        $templateID = $data['tempid'];
-//        $reload_url = $data['reload_url'];
-//        list($status,$token) = $this->getToken();
-//        if(!$status) return [false,$token];
-//        $url = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=".$token;
-//        $post = '{
-//           "touser":"'.$data['openid'].'",
-//           "template_id":"'.$templateID.'",
-//           "url":"'.$reload_url.'",
-//           "data":{
-//                   "first": {
-//                       "value":"'.$data['first'].'",
-//                       "color":"#173177"
-//                   },
-//                   %s
-//                   "remark":{
-//                       "value":"'.$data['remark'].'",
-//                       "color":"#173177"
-//                   }
-//           }
-//       }';
-//        $content = "";
-//        foreach ($data['detail'] as $k=>$v){
-//
-//            $content .= '"'.$k.'": {
-//                       "value":"'.$v.'",
-//                       "color":"#173177"
-//                   },';
-//        }
-//        $post = sprintf($post,$content);
-////        var_dump($post);
-////        var_dump(json_decode($post));die;
-////        var_dump($url);
-////        var_dump(json_encode(json_decode($post)));
-//        $res = $this->curlOpen($url,['post'=>$post]);
-//        $res = json_decode($res,true);
-//        if(isset($res['errcode'])&&$res['errcode'] != 0) return [false,$res['errmsg']];
-//        if(isset($res['errcode'])&&$res['errcode'] === 0) return [true,''];
-//        return [false,json_encode($res)];
-//
-//    }
 }

+ 89 - 0
app/Service/Weixin/WxTemplateMessageService.php

@@ -0,0 +1,89 @@
+<?php
+
+namespace App\Service\Weixin;
+
+use Exception;
+
+class WxTemplateMessageService extends WeixinService
+{
+    /**
+     * 发送微信模板消息
+     *
+     * @param string      $templateKey 模板配置key(对应 config 中的 template_map)
+     * @param array       $dataData 模板参数(key 对应 config 中定义)
+     * @param array       $options [
+     *                                'pagepath' => '',  // 小程序路径
+     *                                'url' => '',       // 网页路径
+     *                                'openid' => '',    // 可选,优先使用
+     *                                'first' => '',     // 可选,覆盖默认
+     *                                'remark' => '',    // 可选,覆盖默认
+     *                             ]
+     * @return array [bool, string]
+     */
+    public function sendTemplateMessage(string $templateKey, array $dataData, array $options = []): array
+    {
+        try {
+            $config = config("wx_msg.template_map.$templateKey");
+            if (!$config) return [false, "微信消息模板键值不存在: {$templateKey}"];
+
+            $openid = $options['openid'] ?? "";
+            if (empty($openid)) return [false, "openid 不能为空"];
+
+            list($tokenOk, $token) = $this->getTokenSTABLE();
+            if (! $tokenOk) return [false, $token];
+
+            $jumpType = $config['jump_type'] ?? '';
+            $payload = [
+                'touser' => $openid,
+                'template_id' => $config['tmp_id'],
+                'data' => $this->buildTemplateData($config, $dataData, $options),
+            ];
+
+            // 动态跳转处理
+            if ($jumpType === 'h5') {
+                $payload['url'] = $options['url'] ?? '';
+            } elseif ($jumpType === 'mp') {
+                $payload['miniprogram'] = [
+                    'appid' => config('wx_msg.default_appid'),
+                    'pagepath' => $options['pagepath'] ?? '',
+                ];
+            }
+
+            $url = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token={$token}";
+            $res = $this->curlOpen($url, ['post' => json_encode($payload, JSON_UNESCAPED_UNICODE)]);
+            $res = json_decode($res, true);
+
+            if (isset($res['errcode']) && $res['errcode'] === 0) return [true, ''];
+
+            return [false , $res['errmsg']];
+        } catch (Exception $e) {
+            return [false, $e->getMessage()];
+        }
+    }
+
+    /**
+     * 构建模板数据结构
+     */
+    protected function buildTemplateData(array $config, array $dataData, array $options = []): array
+    {
+        $result = [];
+
+        $first = $options['first'] ?? $config['first'] ?? '';
+        $remark = $options['remark'] ?? $config['remark'] ?? '';
+
+        if ($first) {
+            $result['first'] = ['value' => $first, 'color' => '#173177'];
+        }
+
+        foreach ($config['params'] as $key => $field) {
+            $value = $dataData[$key] ?? '';
+            $result[$field] = ['value' => (string)$value, 'color' => '#173177'];
+        }
+
+        if ($remark) {
+            $result['remark'] = ['value' => $remark, 'color' => '#173177'];
+        }
+
+        return $result;
+    }
+}

+ 7 - 11
app/Service/Wx/WxService.php

@@ -7,20 +7,16 @@ use Illuminate\Support\Facades\Redis;
 
 class WxService extends Service
 {
-//    public $appid = 'wx4e1324c600df37a6';
-//    public $secret = '72f8c912d462b0f4ff46cbedac0c80bf';
+    public $appid = '';
+    public $secret = '';
 
-    //测试
-//    public $appid = 'wx4e1324c600df37a6';
-//    public $secret = 'cec65770bf168a57dc8e5a012d4c9537';
-
-    //正式
-    public $appid = 'wxc0bc3dfc58b4e00e';
-    public $secret = 'ad37474f1a646281052438206b8aaed2';
+    public function __construct()
+    {
+        $this->appid = config("wx_msg.appid");
+        $this->secret = config("wx_msg.appSecret");
+    }
 
     public function getOpenid($code){
-
-
         $appid = $this->appid;
         $secret = $this->secret;
 //        $code = '0b1tFv100Sm91Q1kko0004vZGu0tFv12';

+ 4 - 4
config/aliyun.php

@@ -1,9 +1,9 @@
 <?php
 
 return [
-    "accessKeyId" => "LTAI5tSXsZ18jvcjG7xfiZua",
-    "accessKeySecret" => "rLplgBkrn3d4y93GOg1NECz5rat1vb",
-    "endpoint" => "oss-cn-hangzhou.aliyuncs.com",
-    "ossBucket" => "qingyaon",
+    "accessKeyId" => "",
+    "accessKeySecret" => "",
+    "endpoint" => "",
+    "ossBucket" => "",
 ];
 

+ 12 - 33
config/header/71.php

@@ -8,48 +8,27 @@
 return [
     [
         'key' =>'order_number',
-        'value' => '回款单号',
+        'value' => '订单编码',
     ],
     [
-        'key' =>'order_time',
-        'value' => '单据日期',
-    ],
-    [
-        'key' =>'employee_id_1_title',
-        'value' => '业务员',
-    ],
-    [
-        'key' =>'employee_id_2_title',
-        'value' => '上级管理人员',
+        'key' =>'customer_title',
+        'value' => '客户',
     ],
     [
-        'key' =>'channel_finance',
-        'value' => '渠道财务',
+        'key' =>'supply_title',
+        'value' => '供应商',
     ],
     [
-        'key' =>'payment_amount',
-        'value' => '回款金额',
-        'sum' => 1,
+        'key' =>'order_time',
+        'value' => '订单日期',
     ],
     [
-        'key' =>'price_4_total',
-        'value' => '业务成本金额',
-        'value1' => '开票数量 * 存货业务成本单价',
+        'key' =>'quantity',
+        'value' => '订单数量',
         'sum' => 1,
     ],
     [
-        'key' =>'profit',
-        'value' => '毛利',
-        'value1' => '回款金额 - 业务成本金额',
-        'sum' => 2,
-        'formula' => 'payment_amount - price_4_total',
-    ],
-    [
-        'key' =>'profit_rate',
-        'value' => '毛利率%',
-        'value1' => '毛利 / 回款金额',
-        'sum' => 2,
-        'formula' => 'profit / payment_amount * 100',
-        'split_join' => '%',
-    ],
+        'key' =>'crt_time',
+        'value' => '创建时间',
+    ]
 ];

+ 10 - 12
config/header/72.php

@@ -7,25 +7,23 @@
 
 return [
     [
-        'key' =>'employee_id_1_title',
-        'value' => '业务人员名',
+        'key' =>'title',
+        'value' => '待办事项标题',
     ],
     [
-        'key' =>'send_time',
-        'value' => '发放日期',
+        'key' =>'type_title',
+        'value' => '间隔时长',
     ],
     [
-        'key' =>'belong_time',
-        'value' => '归属日期',
-        'value1' => '分红发放的金额归属于某个季度中,最后用于分红利润的已发放金额合计',
+        'key' =>'remind_start',
+        'value' => '提醒开始时间',
     ],
     [
-        'key' =>'give_out_amount',
-        'value' => '分红已发放金额',
-        'sum' => 1,
+        'key' =>'status_title',
+        'value' => '状态',
     ],
     [
-        'key' =>'mark',
-        'value' => '备注',
+        'key' =>'crt_name',
+        'value' => '创建人',
     ],
 ];

+ 0 - 64
config/wx/msg.php

@@ -1,64 +0,0 @@
-<?php
-return [
-    //前面为菜单id,后面为类型
-    'wx_menu' => [
-        '37_1' => 1,
-        '37_2' => 2,
-        '37_3_2' => 3,
-        '34_1' => 1,
-        '34_2' => 2,
-        '34_3_2' => 3,
-        '35_1' => 1,
-        '35_2' => 2,
-        '35_3_2' => 3,
-        '38_1' => 1,
-        '38_2' => 2,
-        '38_3_2' => 3,
-        '44_1' => 1,
-        '44_2' => 2,
-        '44_3_2' => 3,
-        '45_1' => 1,
-        '45_2' => 2,
-        '45_3_2' => 3,
-        '48_1' => 1,
-        '48_2' => 2,
-        '48_3_2' => 3,
-        '16_1' => 1,
-        '16_2' => 2,
-        '16_3_2' => 3,
-        '30_1' => 1,
-        '30_2' => 2,
-        '30_3_2' => 3,
-    ],
-
-    'wx_tmp_id' => [
-        1=>[
-            'tmp_id'=>'5azHlaoAu6MgRzkxn_HL69dFinNFUQLQffCCXYCnAeQ',
-            'param' => [
-                'character_string3',
-                'thing2',
-                'thing6',
-                'time4',
-            ]
-        ],
-        2=>[
-            'tmp_id'=>'ukAyDJg6oueXjD_dhg9zMFwdFSk5NYSUkCbwAOl1m88',
-            'param' => [
-                'character_string2',
-                'thing7',
-                'phrase15',
-                'thing10',
-                'time11',
-            ]
-        ],
-        3=>[
-            'tmp_id'=>'fp56KqG8iR3QrAaDe-FRh_WWcrWJB58THaXm_cpwndA',
-            'param' => [
-                'character_string2',
-                'phrase3',
-                'time5',
-                'thing4'
-            ]
-        ]
-    ]
-];

+ 35 - 0
config/wx_msg.php

@@ -0,0 +1,35 @@
+<?php
+
+return [
+    'template_map' => [
+        'audit_apply' => [
+            'tmp_id' => '5azHlaoAu6MgRzkxn_HL69dFinNFUQLQffCCXYCnAeQ',
+            'params' => [
+                'order_no' => 'character_string3',
+                'applicant' => 'thing2',
+                'content' => 'thing6',
+                'apply_time' => 'time4',
+            ],
+            'first' => '您有一条新的审核申请待处理',
+            'remark' => '请尽快登录系统进行审批',
+            'jump_type' => 'mp', // 'mp'小程序 | 'h5'网页 | 'auto'两者都有优先小程序
+        ],
+
+        'audit_result' => [
+            'tmp_id' => '',
+            'params' => [
+                'title' => 'thing1',
+                'status' => 'phrase2',
+                'time' => 'time3',
+            ],
+            'first' => '您的申请已完成审核',
+            'remark' => '感谢您的配合',
+            'jump_type' => 'h5',
+        ],
+    ],
+
+    'appid' => '', // 小程序 appid
+    'appSecret' => '', // 小程序 密码
+    'f_appid' => 'wxc98d589b271423bc', // 服务号 appid
+    'f_appSecret' => 'aea299509ab589df54f975765ee69905', // 服务号 密码
+];

+ 7 - 0
routes/api.php

@@ -138,6 +138,13 @@ Route::group(['middleware'=> ['checkLogin']],function ($route){
     $route->any('reminderDel', 'Api\OrderController@reminderDel');
     $route->any('reminderDetail', 'Api\OrderController@reminderDetail');
 
+    //待办
+    $route->any('toDoList', 'Api\OrderController@toDoList');
+    $route->any('toDoEdit', 'Api\OrderController@toDoEdit');
+    $route->any('toDoAdd', 'Api\OrderController@toDoAdd');
+    $route->any('toDoDel', 'Api\OrderController@toDoDel');
+    $route->any('toDoDetail', 'Api\OrderController@toDoDetail');
+
     //获取默认表头
     $route->any('getTableHead','Api\TableHeadController@tableHeadGet');
     //设置表头