|
@@ -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),
|