WechatGroupApi.php 533 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace App\Http\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. use DB;
  5. class WechatGroupApi extends Model
  6. {
  7. protected $table = 'wechat_group_apis';
  8. protected $guarded = ['id'];
  9. static function get_group_api($group_nick){
  10. $group_apis = self::where('group_nick',$group_nick)->get()->toarray();
  11. $result = array();
  12. if(!empty($group_apis)){
  13. foreach($group_apis as $group_api){
  14. $result[$group_api['api_nick']] = $group_api;
  15. }
  16. }
  17. return $result;
  18. }
  19. }