PointTransfer.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /****************************************************************
  3. * Author: libaojia
  4. * Date: 2017/9/4 上午10:52
  5. * Email: livsyitian@163.com
  6. * QQ: 995265288
  7. * User: 芸众商城 www.yunzshop.com
  8. ****************************************************************/
  9. namespace app\common\models\finance;
  10. use app\common\models\BaseModel;
  11. use app\common\scopes\UniacidScope;
  12. use app\common\traits\CreateOrderSnTrait;
  13. class PointTransfer extends BaseModel
  14. {
  15. use CreateOrderSnTrait;
  16. protected $table = 'yz_point_transfer';
  17. protected $guarded =[''];
  18. public static function boot()
  19. {
  20. parent::boot();
  21. self::addGlobalScope(new UniacidScope);
  22. }
  23. /**
  24. * 定义字段名
  25. *
  26. * @return array */
  27. public function atributeNames() {
  28. return [
  29. 'uniacid' => "公众号",
  30. 'transferor'=> "转让者",
  31. 'recipient' => '被转让者',
  32. 'money' => '转让金额',
  33. 'status' => '状态'
  34. ];
  35. }
  36. /**
  37. * 字段规则
  38. *
  39. * @return array */
  40. public function rules()
  41. {
  42. return [
  43. 'uniacid' => "required",
  44. 'transferor'=> "required",
  45. 'recipient' => 'required',
  46. 'money' => 'numeric|regex:/^[0-9]+(.[0-9]{1,2})?$/',
  47. 'status' => 'required'
  48. ];
  49. }
  50. }