1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Model;
- class MjMcnImport extends Model
- {
- protected $table = 'mj_mcn_import';
- public $timestamps = false;
- protected static $unguarded = true;
- public static function delByMcnId($id)
- {
- $info = OrderMcn::select('task_id', 'month')
- ->where('id', $id)
- ->first();
- if(empty($info)){
- return false;
- }
- return self::where('task_id', $info->task_id)->where('month', $info->month)->update(['enable'=>0]);
- }
- public static function delByCaId($id)
- {
- $info = OrderMcn::select('task_id', 'original_month')
- ->where('id', $id)
- ->first();
- if(empty($info)){
- return false;
- }
- return self::where('task_id', $info->task_id)->where('month', $info->original_month)->update(['enable'=>0]);
- }
- }
|