1234567891011121314151617181920212223242526272829 |
- <?php
- namespace App\Modules\WechatMaterial\Models;
- use Illuminate\Database\Eloquent\Model;
- class BatchWechatMaterial extends Model
- {
- protected $table = 'batch_wechat_materials';
- protected $connection = 'api_mysql';
- protected $fillable = ['id','name', 'send_time', 'content', 'subscribe_time', 'balance','sex','pay_type','interaction_time',
- 'status','is_all_user','del_flag','created_at','','updated_at','channel_user_id','distribution_channel_id'];
-
- public static function get_zs_wechat_material_list($channel_user_id){
- return self::where('del_flag',0)->where('channel_user_id',$channel_user_id)->paginate();
- }
-
- public static function del_zs_wechat_material($batch_id,$channel_user_id){
- return self::where(['id'=>$batch_id,'channel_user_id'=>$channel_user_id])->update(['del_flag'=>1,'updated_at'=>date('Y-m-d H:i:s')]);
- }
-
- public static function get_zs_wechat_material($batch_id,$channel_user_id){
- return self::where(['id'=>$batch_id,'channel_user_id'=>$channel_user_id])->first();
- }
- }
|