新版订单消耗系统

MjOrdersImport.php 537B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. class MjOrdersImport extends Model
  5. {
  6. protected $table = 'mj_orders_import';
  7. public $timestamps = false;
  8. protected static $unguarded = true;
  9. public static function delByCostId($id)
  10. {
  11. $info = OrderCost::select('task_id', 'month')
  12. ->where('id', $id)
  13. ->first();
  14. if(empty($info)){
  15. return false;
  16. }
  17. return self::where('task_id', $info->task_id)->where('month', $info->month)->update(['enable'=>0]);
  18. }
  19. }