RecruitTicketField.php 576 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. class RecruitTicketField extends Model
  5. {
  6. protected $table = 'recruit_ticket_field';
  7. protected $guarded = [];
  8. public static function ticketFieldData($type)
  9. {
  10. $fields = self::where(['type' => $type])->orderBy('listorder','asc')->select(['id', 'field', 'name', 'is_appoint'])->get();
  11. $field = [];
  12. foreach ($fields as $item) {
  13. $field[$item->field] = '变量名:${' . $item->field . '},标题:'.$item->name;
  14. }
  15. return $field;
  16. }
  17. }