123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- /**
- * Created by PhpStorm.
- * User: z-yang
- * Date: 2019/7/27
- * Time: 18:01
- */
- namespace App\Modules\User\Services;
- use App\Modules\User\Models\UserMonthOrder;
- use App\Modules\User\Models\UserMonthSign;
- class UserMonthService
- {
- public static function createSign(int $uid, int $plan_id, string $change_type)
- {
- $model = new UserMonthSign();
- $info = $model->where('uid', $uid)->where('plan_id', $plan_id)->first();
- if ($info) {
- $info->change_type = $change_type;
- $info->save();
- } else {
- $model->uid = $uid;
- $model->plan_id = $plan_id;
- $model->change_type = $change_type;
- $model->save();
- }
- return;
- }
- public static function createLOrder(int $uid, int $plan_id, int $total_fee, string $trade_no)
- {
- $model = new UserMonthOrder();
- $model->uid = $uid;
- $model->plan_id = $plan_id;
- $model->total_fee = $total_fee;
- $model->trade_no = $trade_no;
- $model->save();
- return;
- }
- }
|