where('status', 1)->get(); } /** * 根据渠道、分类获取自定义智能推送内容列表 */ static function smartPushByDistributionChannelIdAndCategorySex($distribtion_channel_id,$category_type,$sex) { return self::where('distribution_channel_id', $distribtion_channel_id)->where('category_type', $category_type)->where('sex', $sex)->first(); } /** * 根据渠道、分类获取自定义智能推送内容列表 */ static function checkSexAllEdit($distribtion_channel_id,$category_type) { $man = self::smartPushByDistributionChannelIdAndCategorySex($distribtion_channel_id,$category_type,'a'); $women = self::smartPushByDistributionChannelIdAndCategorySex($distribtion_channel_id,$category_type,'b'); if(empty($man) || empty($women)){ return false; } return true; } /** * 根据id获取自定义智能推送内容 */ static function smartPushMsgsById($id) { return self::where('id', $id)->first(); } /** * 更新自定义智能推送内容状态 */ static function updateSmartPushMsgStatus($id,$status) { return self::where('id', $id)->update(['status'=>$status,'updated_at'=>date('Y-m-d H:i:s')]); } }