Num.php 545 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace Heanup\App\Api\Package\Database;
  3. use Heanup\Frame\Package\Database\Single;
  4. class Num extends Single
  5. {
  6. const CONFIG_CLASS = 'MySQL\\Core';
  7. protected static $tableName = 'phone_num';
  8. protected static $fields = [];
  9. protected static $primaryKey = 'id';
  10. public static function insert($data, $returnLastInsertId = true)
  11. {
  12. if (self::getOne(['country'=>$data['country'],'phone'=>$data['phone']])){
  13. return true;
  14. }
  15. return parent::insert($data, $returnLastInsertId);
  16. }
  17. }