You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
640 B
PHTML
24 lines
640 B
PHTML
2 years ago
|
<?php
|
||
|
|
||
|
declare(strict_types=1);
|
||
|
|
||
|
namespace App\Service;
|
||
|
|
||
|
use App\Model\Merchant;
|
||
|
|
||
|
class MerchantService extends AbstractService
|
||
|
{
|
||
|
public function createMerchant($params) {
|
||
|
$merchant = new Merchant();
|
||
|
$merchant->username = $params['username'];
|
||
|
$merchant->password = $params['password'];
|
||
|
$merchant->email = $params['email'] ?: '';
|
||
|
$merchant->mobile = $params['mobile'] ?: '';
|
||
|
$merchant->register_at = date('Y-m-d H:i:s');
|
||
|
$merchant->register_ip = $params['ip'] ?: '';
|
||
|
$merchant->status = Merchant::STATUS_ACTIVE;
|
||
|
$merchant->save();
|
||
|
return $merchant;
|
||
|
}
|
||
|
}
|