1234567891011121314151617181920212223 |
- <?php
- namespace app\txx\model;
- use think\Model;
- class YzActivityPromoCode extends Model{
- protected $connection = 'mysql_yz';//切换连接参数
- protected $name = 'activity_promocode';
- protected $pk = 'id';
- protected $autoWriteTimestamp = false;
- protected $createTime='createTime';
- protected $updateTime='updateTime';
- public static function GetOrderNumById($id){
- $coupid= self::where(["act_good_id"=>$id])->value("group_id",0);
- if ($coupid>0){
- return self::name("order_promotion")->where(["coupon_id"=>$coupid])->count();
- }
- return 0;
- }
- }
|