ShopOrder.php 775 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace app\admin\model\dao;
  3. use app\common\model\ShopOrder as ShopOrderModel;
  4. use app\common\model\UserModel;
  5. use think\facade\Db;
  6. class ShopOrder extends BaseDao
  7. {
  8. protected $model;
  9. public static $table = "db_shop_order";
  10. public function __construct()
  11. {
  12. $this->model = new ShopOrderModel();
  13. }
  14. public static function editStatus($orderId, $status)
  15. {
  16. return Db::table(self::$table)
  17. ->where(['order_id' => $orderId])
  18. ->update([
  19. 'status' => $status,
  20. 'updated_time' => date('Y-m-d H:i:s')
  21. ]);
  22. }
  23. public static function getOrderById($orderId)
  24. {
  25. return Db::table(self::$table)->where(['order_id' => $orderId])->find();
  26. }
  27. }