YzActivityPromoCode.php 610 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace app\txx\model;
  3. use think\Model;
  4. class YzActivityPromoCode extends Model{
  5. protected $connection = 'mysql_yz';//切换连接参数
  6. protected $name = 'activity_promocode';
  7. protected $pk = 'id';
  8. protected $autoWriteTimestamp = false;
  9. protected $createTime='createTime';
  10. protected $updateTime='updateTime';
  11. public static function GetOrderNumById($id){
  12. $coupid= self::where(["act_good_id"=>$id])->value("group_id",0);
  13. if ($coupid>0){
  14. return self::name("order_promotion")->where(["coupon_id"=>$coupid])->count();
  15. }
  16. return 0;
  17. }
  18. }