yingzi 1 year ago
parent
commit
c05095bd89
2 changed files with 16 additions and 5 deletions
  1. 4 1
      Controller/Shop/ApiShopCard.Class.php
  2. 12 4
      Controller/Shop/ShopRostering.Class.php

+ 4 - 1
Controller/Shop/ApiShopCard.Class.php

@@ -25,6 +25,9 @@ class ApiShopCard extends BaseController
     private $obj;
     private $objCardBind;
     private $objCardOrder;
+    private $objCardNum;
+    private $objProject;
+    private $objCustomer;
 
     public function __construct($isCheckAcl = true, $isMustLogin = false, $checkToken = true, $getAreaCode = false, $checkShopToken = true, $checkSupplierToken = false)
     {
@@ -116,7 +119,7 @@ class ApiShopCard extends BaseController
         $selectParams['paid'] = 1;
 
         $list = $this->objCardOrder->list($selectParams)->getData();
-
+        
         $pageData = [
             'pageIndex' => $params['page'],
             'pageSize' => $params['pageSize'],

+ 12 - 4
Controller/Shop/ShopRostering.Class.php

@@ -387,6 +387,7 @@ class ShopRostering extends BaseController
 //        if (!$user)  parent::sendOutput('不是该店铺店员', 1005);
 
         $url = 'https://oapi.dingtalk.com/topapi/attendance/group/add?access_token='.$this->voucher();
+        
 
         $data = [
             'op_user_id' => '',
@@ -398,13 +399,15 @@ class ShopRostering extends BaseController
                 'enable_next_day' => 'true',
                 'enable_position_ble' => 'true',
             ],
-        ];
+        ];        
         foreach (explode(',', $param['shift_vo_list']) as $item){
             $data['top_group']['shift_vo_list'][] =[
                 'id' => $item
             ];
         }
-        foreach (explode(',',$param['staff_id']) as $item){
+        $staff_id_ar = empty($param['staff_id']) ? [] : explode(',',$param['staff_id']);
+        
+        foreach ($staff_id_ar as $item){
             $user = $this->staff->getStaffInfo(['id' => $item])->getData();
             $data['top_group']['members'][] =[
                 'role' => 'Attendance',
@@ -711,9 +714,14 @@ class ShopRostering extends BaseController
         $uids = [];
         foreach (explode(',', $param['staff_id']) as $item){
             $staff = $this->staff->getStaffInfo(['id' => $item, 'shopId' => $this->shopId])->getData();
-            $uids[] = $staff['userId'];
+            if(!empty($staff['userId'])){
+                $uids[] = $staff['userId'];
+            }
         }
-
+        if(empty($uids)){
+            parent::sendOutput("员工未绑定钉钉账号", 1);
+        }
+        
         $data = [
             'group_key' => $this->group_key($param['id']),
             'user_id_list' => implode(',', $uids),