|
@@ -90,25 +90,39 @@ class TestController
|
|
}
|
|
}
|
|
|
|
|
|
public function test_push(){
|
|
public function test_push(){
|
|
- try {
|
|
|
|
- $res = JPushService::pushNotify([
|
|
|
|
- //标题
|
|
|
|
- 'title' => '测试',
|
|
|
|
- //内容
|
|
|
|
- 'content' => '测试',
|
|
|
|
- //设备标识,跟设备相关
|
|
|
|
- 'reg_id' => 'xxxxxxxxxxx',
|
|
|
|
- //扩展字段
|
|
|
|
- 'extras' => [
|
|
|
|
- 'key' => 'value',
|
|
|
|
- ],
|
|
|
|
- //推送类型
|
|
|
|
- 'type' => JPushService::PUSH_TYPE_ALL,
|
|
|
|
- ]);
|
|
|
|
- }catch (\Exception $exception){
|
|
|
|
- return response()->json(['msg'=>$exception->getMessage()]);
|
|
|
|
|
|
+ $users_info = UserInfoModel::query()->get();
|
|
|
|
+ foreach ($users_info as $item){
|
|
|
|
+ if(!empty($item->photo)){
|
|
|
|
+ $photo = json_decode($item->photo,true);
|
|
|
|
+ if(count($photo)>0){
|
|
|
|
+ foreach ($photo as $k=>$v){
|
|
|
|
+ $photo[$k]['state'] = (empty($v['state']) || $v['state']==0)?0:$v['state'];
|
|
|
|
+ }
|
|
|
|
+ $item->photo = json_encode($photo);
|
|
|
|
+ $item->save();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- return response()->json(['data'=>$res]);
|
|
|
|
|
|
+
|
|
|
|
+// try {
|
|
|
|
+// $res = JPushService::pushNotify([
|
|
|
|
+// //标题
|
|
|
|
+// 'title' => '测试',
|
|
|
|
+// //内容
|
|
|
|
+// 'content' => '测试',
|
|
|
|
+// //设备标识,跟设备相关
|
|
|
|
+// 'reg_id' => 'xxxxxxxxxxx',
|
|
|
|
+// //扩展字段
|
|
|
|
+// 'extras' => [
|
|
|
|
+// 'key' => 'value',
|
|
|
|
+// ],
|
|
|
|
+// //推送类型
|
|
|
|
+// 'type' => JPushService::PUSH_TYPE_ALL,
|
|
|
|
+// ]);
|
|
|
|
+// }catch (\Exception $exception){
|
|
|
|
+// return response()->json(['msg'=>$exception->getMessage()]);
|
|
|
|
+// }
|
|
|
|
+// return response()->json(['data'=>$res]);
|
|
}
|
|
}
|
|
|
|
|
|
public function jg_auth(){
|
|
public function jg_auth(){
|