feat : wechatPay callback
This commit is contained in:
@@ -29,12 +29,16 @@ class OrderOptionCateringLog extends Model
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = [];
|
||||
protected array $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*/
|
||||
protected array $casts = ['id' => 'integer', 'cycle_id' => 'integer', 'kitchen_id' => 'integer', 'site_id' => 'integer', 'quantity' => 'integer', 'add_staple_food_num' => 'integer', 'status' => 'integer'];
|
||||
|
||||
const string CREATED_AT = 'create_time';
|
||||
const string UPDATED_AT = 'update_time';
|
||||
|
||||
/**
|
||||
* @param int $siteId
|
||||
* @param int $cycleId
|
||||
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
use App\Constants\Common\PayCode;
|
||||
use Hyperf\Database\Concerns\BuildsQueries;
|
||||
use Hyperf\Database\Model\Builder;
|
||||
use Hyperf\DbConnection\Model\Model;
|
||||
@@ -51,6 +52,11 @@ class PayOrder extends Model
|
||||
*/
|
||||
public function getInfoByOrderIdAndType(int $id,int $type): \Hyperf\Database\Model\Model|null
|
||||
{
|
||||
return $this->where('order_id',$id)->where('order_type',$type)->first();
|
||||
return $this->where('order_id',$id)->where('order_type',$type)->where('status',PayCode::FINISH_PAY)->first();
|
||||
}
|
||||
|
||||
public function getInfoByOrderIdAndTypeAndRType(int $id,int $type,int $rType)
|
||||
{
|
||||
return $this->where('order_id',$id)->where('order_type',$type)->where('recharge_type',$rType)->first();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user