YzActivityPromoCode.php 852 B

1234567891011121314151617181920212223242526
  1. <?php
  2. declare (strict_types = 1);
  3. namespace app\txx\model;
  4. use think\Model;
  5. /**
  6. * @mixin \think\Model
  7. */
  8. class YzActivityPromoCode extends Model
  9. {
  10. protected $connection = 'mysql_yz';//切换连接参数
  11. protected $table = 'yz_activity_promocode';
  12. protected $pk = 'id';
  13. protected $autoWriteTimestamp = false;
  14. protected $createTime="createTime";
  15. protected $updateTime="updateTime";
  16. public static $statusCn=['待创建','有效','失效','微信审核中','创建失败'];
  17. public static $codeTypeCn=["UNIQUE"=>"一卡一码","GENERAL"=>"通用码"];
  18. public static $rangeTypeCn=["ALL"=>"全部","PART"=>"部分指定商品可用","EXCLUDED"=>"部分指定商品不可用"];
  19. public function Good()
  20. {
  21. return $this->belongsTo(YzGood::class,'skuCode','item_no')->bind(["good_name"=>"title"]);
  22. }
  23. }