|
|
|
@ -5,12 +5,18 @@ namespace App\Http\Controllers\Api; |
|
|
|
use App\Http\Controllers\Controller; |
|
|
|
use App\Models\AgentInfo; |
|
|
|
use Illuminate\Http\Request; |
|
|
|
use Illuminate\Support\Facades\Cache; |
|
|
|
|
|
|
|
class AgentInfoController extends Controller |
|
|
|
{ |
|
|
|
public function about() |
|
|
|
public function info() |
|
|
|
{ |
|
|
|
$about = AgentInfo::where('agent_id', $this->agent_id)->value('about'); |
|
|
|
return $this->success(['about' => $about]); |
|
|
|
$type = request()->route('type');; |
|
|
|
//关于我们、注册协议、购买协议
|
|
|
|
if (!in_array($type, ['about', 'reg_protocol', 'buy_protocol'])) { |
|
|
|
return $this->error('参数无效'); |
|
|
|
} |
|
|
|
$about = AgentInfo::where('agent_id', $this->agent_id)->value($type); |
|
|
|
return $this->success([$type => $about]); |
|
|
|
} |
|
|
|
} |