wupengfei 1 年之前
父节点
当前提交
c7a2f5a8d2
共有 3 个文件被更改,包括 22 次插入7 次删除
  1. 6 6
      .idea/workspace.xml
  2. 9 1
      application/common/model/UserMessage.php
  3. 7 0
      application/synth/controller/BillApply.php

+ 6 - 6
.idea/workspace.xml

@@ -3,8 +3,8 @@
   <component name="ChangeListManager">
   <component name="ChangeListManager">
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/common/model/UserMessage.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/common/model/UserMessage.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/application/synth/controller/BillApply.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/synth/controller/BillApply.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/application/synth/controller/BillApply.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/synth/controller/BillApply.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/synth/view/bill_apply/form.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/synth/view/bill_apply/form.html" afterDir="false" />
     </list>
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -328,7 +328,7 @@
       <workItem from="1684543423796" duration="10653000" />
       <workItem from="1684543423796" duration="10653000" />
       <workItem from="1684716593546" duration="15730000" />
       <workItem from="1684716593546" duration="15730000" />
       <workItem from="1684743465298" duration="6526000" />
       <workItem from="1684743465298" duration="6526000" />
-      <workItem from="1684802887863" duration="11406000" />
+      <workItem from="1684802887863" duration="12789000" />
     </task>
     </task>
     <servers />
     <servers />
   </component>
   </component>
@@ -458,14 +458,14 @@
       <screen x="0" y="0" width="2560" height="1400" />
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
     </state>
     <state x="1410" y="539" key="#com.intellij.fileTypes.FileTypeChooser/0.0.2560.1400@0.0.2560.1400" timestamp="1684374232836" />
     <state x="1410" y="539" key="#com.intellij.fileTypes.FileTypeChooser/0.0.2560.1400@0.0.2560.1400" timestamp="1684374232836" />
-    <state x="1106" y="469" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog" timestamp="1684805451788">
+    <state x="1106" y="469" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog" timestamp="1684827424008">
       <screen x="0" y="0" width="2560" height="1400" />
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
     </state>
-    <state x="1106" y="469" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog/0.0.2560.1400@0.0.2560.1400" timestamp="1684805451788" />
-    <state x="420" y="147" width="1942" height="1088" key="DiffContextDialog" timestamp="1684740077011">
+    <state x="1106" y="469" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog/0.0.2560.1400@0.0.2560.1400" timestamp="1684827424008" />
+    <state x="420" y="147" width="1942" height="1088" key="DiffContextDialog" timestamp="1684827948998">
       <screen x="0" y="0" width="2560" height="1400" />
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
     </state>
-    <state x="420" y="147" width="1942" height="1088" key="DiffContextDialog/0.0.2560.1400@0.0.2560.1400" timestamp="1684740077011" />
+    <state x="420" y="147" width="1942" height="1088" key="DiffContextDialog/0.0.2560.1400@0.0.2560.1400" timestamp="1684827948998" />
     <state x="1418" y="514" key="FileChooserDialogImpl" timestamp="1684742788772">
     <state x="1418" y="514" key="FileChooserDialogImpl" timestamp="1684742788772">
       <screen x="0" y="0" width="2560" height="1400" />
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
     </state>

+ 9 - 1
application/common/model/UserMessage.php

@@ -2,6 +2,8 @@
 namespace app\common\model;
 namespace app\common\model;
 use think\Model;
 use think\Model;
 use JPush\Client;
 use JPush\Client;
+use function Symfony\Component\String\b;
+
 require_once env('root_path').'vendor/jpush/jpush/autoload.php';
 require_once env('root_path').'vendor/jpush/jpush/autoload.php';
 // 会员消息
 // 会员消息
 class UserMessage extends Model
 class UserMessage extends Model
@@ -41,6 +43,7 @@ class UserMessage extends Model
             2=>['title'=>'活动更改','msg'=>['活动有变更']],
             2=>['title'=>'活动更改','msg'=>['活动有变更']],
             3=>['title'=>'活动提醒','msg'=>['活动有变更']],
             3=>['title'=>'活动提醒','msg'=>['活动有变更']],
             4=>['title'=>'活动订单','msg'=>['未支付订单提醒']],
             4=>['title'=>'活动订单','msg'=>['未支付订单提醒']],
+            5=>['title'=>'活动发票','msg'=>['已开据电子发票','纸质发票物流已配送']],
             ],// 活动
             ],// 活动
         'demand'=>[
         'demand'=>[
             1=>['title'=>'需求投稿','msg'=>['需求投稿成功请等待审核']],
             1=>['title'=>'需求投稿','msg'=>['需求投稿成功请等待审核']],
@@ -138,6 +141,11 @@ class UserMessage extends Model
                     $message['jg_res']  = is_array($res) ? json_encode($res) :$res;
                     $message['jg_res']  = is_array($res) ? json_encode($res) :$res;
                 }
                 }
                 break;
                 break;
+            case 'activity':
+                $message['jg_type'] = 1;
+                $res =  static::Jpush($to_user,$message['content'],$module,$type,$rel_id,$children_id);
+                $message['jg_res']  = is_array($res) ? json_encode($res) :$res;
+                break;
 
 
         }
         }
         self::create($message);
         self::create($message);
@@ -175,7 +183,7 @@ class UserMessage extends Model
                     'children_id'=>$children_id
                     'children_id'=>$children_id
                 ),
                 ),
             ))->options(array(
             ))->options(array(
-                'apns_production' => false,// false 开发环境 ,true 生产环境
+                'apns_production' => true,// false 开发环境 ,true 生产环境
             ));
             ));
         try {
         try {
             $response = $push_payload->send();
             $response = $push_payload->send();

+ 7 - 0
application/synth/controller/BillApply.php

@@ -2,6 +2,7 @@
 namespace app\synth\controller;
 namespace app\synth\controller;
 use app\common\model\ActivityApply;
 use app\common\model\ActivityApply;
 use app\common\model\StoreOrderRefund;
 use app\common\model\StoreOrderRefund;
+use app\common\model\UserMessage;
 use library\Controller;
 use library\Controller;
 use think\Db;
 use think\Db;
 
 
@@ -92,10 +93,13 @@ class BillApply extends Controller
         }
         }
 
 
         if ($this->request->isPost() && $this->request->action() == 'deliver') {
         if ($this->request->isPost() && $this->request->action() == 'deliver') {
+            $act_id = \app\common\model\BillApply::where('b.id',$data['id'])->alias('b')
+                ->leftJoin('ActivityApply y','y.id = b.order_id')->value('y.act_id');
             $express_company =  Db::name('express_company')->field('id,express_title')->find($data['express_company_id']);
             $express_company =  Db::name('express_company')->field('id,express_title')->find($data['express_company_id']);
             $data['express_company_title'] = $express_company['express_title'] ? $express_company['express_title'] : '';
             $data['express_company_title'] = $express_company['express_title'] ? $express_company['express_title'] : '';
             $data['express_send_at'] = date("Y-m-d H:i:s");
             $data['express_send_at'] = date("Y-m-d H:i:s");
             $data['express_state'] = 1;
             $data['express_state'] = 1;
+            UserMessage::sendUserMessage($data['user_id'],'activity',5,1,0,$act_id,'',$data['id']);
         }
         }
     }
     }
 
 
@@ -148,6 +152,9 @@ class BillApply extends Controller
             $id  = input('post.id');
             $id  = input('post.id');
             $bill_img  = input('post.bill_img');
             $bill_img  = input('post.bill_img');
             \app\common\model\BillApply::where('id',$id)->update(['bill_img'=>$bill_img,'bill_time'=>date("Y-m-d H:i:s")]);
             \app\common\model\BillApply::where('id',$id)->update(['bill_img'=>$bill_img,'bill_time'=>date("Y-m-d H:i:s")]);
+            $info = \app\common\model\BillApply::where('b.id',$id)->alias('b')->field('b.user_id,y.act_id')
+                ->leftJoin('ActivityApply y','y.id = b.order_id')->find()->toArray();
+            UserMessage::sendUserMessage($info['user_id'],'activity',5,0,0,$info['act_id'],'',$id);
             $this->success('保存成功');
             $this->success('保存成功');
         }
         }
     }
     }