-
Make a registration form. A registree must be able to choose an account type (person or organization). Person fields: email, fullname, tax identification number (if the person is an entrepreneur). Organization fields: email, fullname, organization name, tax identification number.
-
Cache the function:
function($date, $type) {
$userId = Yii::$app->user->id;
$dataList = SomeDataModel::find()->where(['date' => $date, 'type' => $type, 'user_id' => $userId])->all();
$result = [];
if (!empty($dataList)) {
foreach ($dataList as $dataItem) {
$result[$dataItem->id] = ['a' => $dataItem->a, 'b' => $dataItem->b];
}
}
}
return $result;
-
Create a db structure to store drug information according the following rules: Drug has a name, a shelf life and disease list that the drug may treat.
-
Perform some code before render any page (e.g. checking a value of some db field). Use better approach.