UserTax.php 367 B

12345678910111213141516171819202122
  1. <?php
  2. namespace app\common\model;
  3. use think\Model;
  4. class UserTax extends Model
  5. {
  6. protected $type=[
  7. 'tax'=>'json',
  8. ];
  9. public static function fromOrder(Orders $orders){
  10. if($orders['tax']){
  11. self::create([
  12. 'user_id'=>$orders['user_id'],
  13. 'tax'=>$orders['tax'],
  14. ]);
  15. }
  16. }
  17. }